You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-dev@axis.apache.org by di...@apache.org on 2005/09/15 21:07:03 UTC
svn commit: r289289 [81/134] - in /webservices/axis2/trunk/java: ./ etc/
modules/addressing/ modules/addressing/src/META-INF/
modules/addressing/src/org/apache/axis2/handlers/addressing/
modules/addressing/test-resources/ modules/addressing/test/org/ap...
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDescriptionBuilderTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDescriptionBuilderTest.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDescriptionBuilderTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDescriptionBuilderTest.java Thu Sep 15 11:52:11 2005
@@ -1,73 +1,73 @@
-package org.apache.axis2.engine;
-
-import junit.framework.TestCase;
-import org.apache.axis2.description.AxisDescWSDLComponentFactory;
-import org.apache.axis2.description.ServiceDescription;
-import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-import org.apache.wsdl.WSDLDescription;
-
-import java.io.File;
-import java.io.FileInputStream;
-import java.io.InputStream;
-import java.util.Iterator;
-
-/*
-* Copyright 2004,2005 The Apache Software Foundation.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*
-*/
-
-/**
- * Author : Deepal Jayasinghe
- * Date: Jun 20, 2005
- * Time: 4:48:22 PM
- */
-public class ServiceDescriptionBuilderTest extends TestCase {
- private ServiceDescription service = null;
- private Log log = LogFactory.getLog(getClass());
-
- private void initialize() throws Exception {
-
- if (null == this.service) {
- InputStream in = new FileInputStream(
- new File("./test-resources/service.wsdl"));
- if (in == null) {
- throw new Exception("Input Stream is null , fileNot Found");
- }
- WSDLDescription womDescription = WOMBuilderFactory.getBuilder(
- WOMBuilderFactory.WSDL11)
- .build(in, new AxisDescWSDLComponentFactory())
- .getDescription();
- Iterator iterator = womDescription.getServices().keySet().iterator();
- if (iterator.hasNext()) {
- this.service = (ServiceDescription) iterator.next();
- }
- //todo fix me ajith , deepal
- // assertNotNull(this.service);
- }
-
- }
-
- public void test() {
- try {
- this.initialize();
- } catch (Exception e) {
- log.info(e.getMessage());
- }
- }
-}
-
+package org.apache.axis2.engine;
+
+import junit.framework.TestCase;
+import org.apache.axis2.description.AxisDescWSDLComponentFactory;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.wsdl.builder.WOMBuilderFactory;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+import org.apache.wsdl.WSDLDescription;
+
+import java.io.File;
+import java.io.FileInputStream;
+import java.io.InputStream;
+import java.util.Iterator;
+
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jun 20, 2005
+ * Time: 4:48:22 PM
+ */
+public class ServiceDescriptionBuilderTest extends TestCase {
+ private ServiceDescription service = null;
+ private Log log = LogFactory.getLog(getClass());
+
+ private void initialize() throws Exception {
+
+ if (null == this.service) {
+ InputStream in = new FileInputStream(
+ new File("./test-resources/service.wsdl"));
+ if (in == null) {
+ throw new Exception("Input Stream is null , fileNot Found");
+ }
+ WSDLDescription womDescription = WOMBuilderFactory.getBuilder(
+ WOMBuilderFactory.WSDL11)
+ .build(in, new AxisDescWSDLComponentFactory())
+ .getDescription();
+ Iterator iterator = womDescription.getServices().keySet().iterator();
+ if (iterator.hasNext()) {
+ this.service = (ServiceDescription) iterator.next();
+ }
+ //todo fix me ajith , deepal
+ // assertNotNull(this.service);
+ }
+
+ }
+
+ public void test() {
+ try {
+ this.initialize();
+ } catch (Exception e) {
+ log.info(e.getMessage());
+ }
+ }
+}
+
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDescriptionBuilderTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/ServiceDispatchingTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler.java Thu Sep 15 11:52:11 2005
@@ -1,52 +1,52 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.axis2.engine;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.handlers.AbstractHandler;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-
-public class SpeakingHandler extends AbstractHandler implements Handler {
- private Log log = LogFactory.getLog(getClass());
- private String message;
- private QName name;
-
- public SpeakingHandler() {
- this.message = "Hi I amtesting ";
- }
-
- public QName getName() {
- return name;
- }
-
- public void invoke(MessageContext msgContext) throws AxisFault {
- log.info("I am " + message + " Handler Running :)");
- }
-
- public void revoke(MessageContext msgContext) {
- log.info("I am " + message + " Handler Running :)");
- }
-
- public void setName(QName name) {
- this.name = name;
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis2.engine;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.handlers.AbstractHandler;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+
+public class SpeakingHandler extends AbstractHandler implements Handler {
+ private Log log = LogFactory.getLog(getClass());
+ private String message;
+ private QName name;
+
+ public SpeakingHandler() {
+ this.message = "Hi I amtesting ";
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ log.info("I am " + message + " Handler Running :)");
+ }
+
+ public void revoke(MessageContext msgContext) {
+ log.info("I am " + message + " Handler Running :)");
+ }
+
+ public void setName(QName name) {
+ this.name = name;
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java Thu Sep 15 11:52:11 2005
@@ -1,65 +1,65 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.axis2.engine;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.HandlerDescription;
-import org.apache.axis2.description.PhaseRule;
-import org.apache.axis2.handlers.AbstractHandler;
-import org.apache.axis2.phaseresolver.PhaseMetadata;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-
-public class SpeakingHandler1 extends AbstractHandler implements Handler {
- private Log log = LogFactory.getLog(getClass());
- private String message;
- private QName name;
-
- public SpeakingHandler1(String message) {
- this.message = message;
- HandlerDescription handlerDesc = new HandlerDescription();
- PhaseRule rule = new PhaseRule();
- rule.setPhaseName(PhaseMetadata.PHASE_POLICY_DETERMINATION);
- handlerDesc.setRules(rule);
- handlerDesc.setHandler(this);
- init(handlerDesc);
- }
-
- public QName getName() {
- return name;
- }
-
- public void invoke(MessageContext msgContext) throws AxisFault {
- log.info("I am " + message + " Handler Running :)");
- }
-
- public void revoke(MessageContext msgContext) {
- log.info("I am " + message + " Handler Running :)");
- }
-
- public void setName(QName name) {
- this.name = name;
- }
-
- public HandlerDescription getHandlerDescription() {
- return handlerDesc;
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis2.engine;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.HandlerDescription;
+import org.apache.axis2.description.PhaseRule;
+import org.apache.axis2.handlers.AbstractHandler;
+import org.apache.axis2.phaseresolver.PhaseMetadata;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+
+public class SpeakingHandler1 extends AbstractHandler implements Handler {
+ private Log log = LogFactory.getLog(getClass());
+ private String message;
+ private QName name;
+
+ public SpeakingHandler1(String message) {
+ this.message = message;
+ HandlerDescription handlerDesc = new HandlerDescription();
+ PhaseRule rule = new PhaseRule();
+ rule.setPhaseName(PhaseMetadata.PHASE_POLICY_DETERMINATION);
+ handlerDesc.setRules(rule);
+ handlerDesc.setHandler(this);
+ init(handlerDesc);
+ }
+
+ public QName getName() {
+ return name;
+ }
+
+ public void invoke(MessageContext msgContext) throws AxisFault {
+ log.info("I am " + message + " Handler Running :)");
+ }
+
+ public void revoke(MessageContext msgContext) {
+ log.info("I am " + message + " Handler Running :)");
+ }
+
+ public void setName(QName name) {
+ this.name = name;
+ }
+
+ public HandlerDescription getHandlerDescription() {
+ return handlerDesc;
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/SpeakingHandler1.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/chuncking-enabled-axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/chuncking-enabled-axis2.xml?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/chuncking-enabled-axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/chuncking-enabled-axis2.xml Thu Sep 15 11:52:11 2005
@@ -1,93 +1,93 @@
-<axisconfig name="AxisJava2.0">
- <!-- ================================================= -->
- <!-- Parameters -->
- <!-- ================================================= -->
- <parameter name="hotdeployment" locked="false">true</parameter>
- <parameter name="hotupdate" locked="false">false</parameter>
-
-
- <parameter name="userName" locked="false">admin</parameter>
- <parameter name="password" locked="false">axis2</parameter>
-
-
-
- <!-- ================================================= -->
- <!-- Message Receivers -->
- <!-- ================================================= -->
- <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
- <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-
- <!-- ================================================= -->
- <!-- Transport Ins -->
- <!-- ================================================= -->
- <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
- <parameter name="port" locked="false">6060</parameter>
- </transportReceiver>
-
- <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
- <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">
- <parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>
- <parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>
- <parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>
- <parameter name="transport.mail.pop3.port" locked="false">110</parameter>
- <parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>
- </transportReceiver> -->
-
- <transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
- <parameter name="port" locked="false">6060</parameter>
- </transportReceiver>
-
- <!-- ================================================= -->
- <!-- Transport Outs -->
- <!-- ================================================= -->
-
- <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
- <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
- <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
- </transportSender>
-
- <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
- <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
-
- <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
- <transportSender name="mail" class="org.apache.axis2.transport.mail.MailTransportSender">
- <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
- <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
- <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
- <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
- </transportSender>
- -->
-
- <!-- ================================================= -->
- <!-- Global Modules -->
- <!-- ================================================= -->
- <!-- Uncomment this to enable Addressing
- <module ref="addressing"/> -->
-
- <!-- ================================================= -->
- <!-- Phases -->
- <!-- ================================================= -->
- <phaseOrder type="inflow">
- <!-- System pre defined phases -->
- <phase name="TransportIn"/>
- <phase name="PreDispatch"/>
- <phase name="Dispatch"/>
- <phase name="PostDispatch"/>
- <!-- System pre defined phases -->
- <!-- After Postdispatch phase module author or or service author can add any phase he want -->
- <phase name="userphase1"/>
- </phaseOrder>
- <phaseOrder type="outflow">
- <!-- user can add his own phases to this area -->
- <phase name="userphase1"/>
- </phaseOrder>
- <phaseOrder type="INfaultflow">
- <!-- user can add his own phases to this area -->
- <phase name="userphase1"/>
- </phaseOrder>
- <phaseOrder type="Outfaultflow">
- <!-- user can add his own phases to this area -->
- <phase name="userphase1"/>
- </phaseOrder>
-</axisconfig>
-
+<axisconfig name="AxisJava2.0">
+ <!-- ================================================= -->
+ <!-- Parameters -->
+ <!-- ================================================= -->
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">false</parameter>
+
+
+ <parameter name="userName" locked="false">admin</parameter>
+ <parameter name="password" locked="false">axis2</parameter>
+
+
+
+ <!-- ================================================= -->
+ <!-- Message Receivers -->
+ <!-- ================================================= -->
+ <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <!-- ================================================= -->
+ <!-- Transport Ins -->
+ <!-- ================================================= -->
+ <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
+ <parameter name="port" locked="false">6060</parameter>
+ </transportReceiver>
+
+ <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+ <transportReceiver name="mail" class="org.apache.axis2.transport.mail.SimpleMailListener">
+ <parameter name="transport.mail.pop3.host" locked="false">127.0.0.1</parameter>
+ <parameter name="transport.mail.pop3.user" locked="false">axis2</parameter>
+ <parameter name="transport.mail.pop3.password" locked="false">axis2</parameter>
+ <parameter name="transport.mail.pop3.port" locked="false">110</parameter>
+ <parameter name="transport.mail.replyToAddress" locked="false">axis2@127.0.0.1</parameter>
+ </transportReceiver> -->
+
+ <transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
+ <parameter name="port" locked="false">6060</parameter>
+ </transportReceiver>
+
+ <!-- ================================================= -->
+ <!-- Transport Outs -->
+ <!-- ================================================= -->
+
+ <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.1</parameter>
+ <parameter name="Transfer-Encoding" locked="false">chunked</parameter>
+ </transportSender>
+
+ <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+ <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
+
+ <!-- Uncomment this one with the appropriate papameters to enable the SMTP transport Receiver
+ <transportSender name="mail" class="org.apache.axis2.transport.mail.MailTransportSender">
+ <parameter name="transport.mail.smtp.host" locked="false">127.0.0.1</parameter>
+ <parameter name="transport.mail.smtp.user" locked="false">axis2</parameter>
+ <parameter name="transport.mail.smtp.password" locked="false">axis2</parameter>
+ <parameter name="transport.mail.smtp.port" locked="false">25</parameter>
+ </transportSender>
+ -->
+
+ <!-- ================================================= -->
+ <!-- Global Modules -->
+ <!-- ================================================= -->
+ <!-- Uncomment this to enable Addressing
+ <module ref="addressing"/> -->
+
+ <!-- ================================================= -->
+ <!-- Phases -->
+ <!-- ================================================= -->
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="TransportIn"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch"/>
+ <phase name="PostDispatch"/>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+</axisconfig>
+
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/chuncking-enabled-axis2.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/commons-http-enabled-axis2.xml
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/commons-http-enabled-axis2.xml?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/commons-http-enabled-axis2.xml (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/commons-http-enabled-axis2.xml Thu Sep 15 11:52:11 2005
@@ -1,75 +1,75 @@
-<axisconfig name="AxisJava2.0">
- <!-- ================================================= -->
- <!-- Parameters -->
- <!-- ================================================= -->
- <parameter name="hotdeployment" locked="false">true</parameter>
- <parameter name="hotupdate" locked="false">false</parameter>
-
-
- <parameter name="userName" locked="false">admin</parameter>
- <parameter name="password" locked="false">axis2</parameter>
-
-
-
- <!-- ================================================= -->
- <!-- Message Receivers -->
- <!-- ================================================= -->
- <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
- <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
-
- <!-- ================================================= -->
- <!-- Transport Ins -->
- <!-- ================================================= -->
- <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
- <parameter name="port" locked="false">6060</parameter>
- </transportReceiver>
-
-
- <transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
- <parameter name="port" locked="false">6060</parameter>
- </transportReceiver>
-
- <!-- ================================================= -->
- <!-- Transport Outs -->
- <!-- ================================================= -->
-
- <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
- <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
-
- <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
- <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
- </transportSender>
-
- <!-- ================================================= -->
- <!-- Global Modules -->
- <!-- ================================================= -->
- <!-- Uncomment this to enable Addressing
- <module ref="addressing"/> -->
-
- <!-- ================================================= -->
- <!-- Phases -->
- <!-- ================================================= -->
- <phaseOrder type="inflow">
- <!-- System pre defined phases -->
- <phase name="TransportIn"/>
- <phase name="PreDispatch"/>
- <phase name="Dispatch"/>
- <phase name="PostDispatch"/>
- <!-- System pre defined phases -->
- <!-- After Postdispatch phase module author or or service author can add any phase he want -->
- <phase name="userphase1"/>
- </phaseOrder>
- <phaseOrder type="outflow">
- <!-- user can add his own phases to this area -->
- <phase name="userphase1"/>
- </phaseOrder>
- <phaseOrder type="INfaultflow">
- <!-- user can add his own phases to this area -->
- <phase name="userphase1"/>
- </phaseOrder>
- <phaseOrder type="Outfaultflow">
- <!-- user can add his own phases to this area -->
- <phase name="userphase1"/>
- </phaseOrder>
-</axisconfig>
-
+<axisconfig name="AxisJava2.0">
+ <!-- ================================================= -->
+ <!-- Parameters -->
+ <!-- ================================================= -->
+ <parameter name="hotdeployment" locked="false">true</parameter>
+ <parameter name="hotupdate" locked="false">false</parameter>
+
+
+ <parameter name="userName" locked="false">admin</parameter>
+ <parameter name="password" locked="false">axis2</parameter>
+
+
+
+ <!-- ================================================= -->
+ <!-- Message Receivers -->
+ <!-- ================================================= -->
+ <!-- This is the Deafult Message Receiver for the Request Response style Operations -->
+ <messageReceiver mep="INOUT" class="org.apache.axis2.receivers.RawXMLINOutMessageReceiver"/>
+
+ <!-- ================================================= -->
+ <!-- Transport Ins -->
+ <!-- ================================================= -->
+ <transportReceiver name="http" class="org.apache.axis2.transport.http.SimpleHTTPServer">
+ <parameter name="port" locked="false">6060</parameter>
+ </transportReceiver>
+
+
+ <transportReceiver name="tcp" class="org.apache.axis2.transport.tcp.TCPServer">
+ <parameter name="port" locked="false">6060</parameter>
+ </transportReceiver>
+
+ <!-- ================================================= -->
+ <!-- Transport Outs -->
+ <!-- ================================================= -->
+
+ <transportSender name="tcp" class="org.apache.axis2.transport.tcp.TCPTransportSender"/>
+ <transportSender name="local" class="org.apache.axis2.transport.local.LocalTransportSender"/>
+
+ <transportSender name="http" class="org.apache.axis2.transport.http.CommonsHTTPTransportSender">
+ <parameter name="PROTOCOL" locked="false">HTTP/1.0</parameter>
+ </transportSender>
+
+ <!-- ================================================= -->
+ <!-- Global Modules -->
+ <!-- ================================================= -->
+ <!-- Uncomment this to enable Addressing
+ <module ref="addressing"/> -->
+
+ <!-- ================================================= -->
+ <!-- Phases -->
+ <!-- ================================================= -->
+ <phaseOrder type="inflow">
+ <!-- System pre defined phases -->
+ <phase name="TransportIn"/>
+ <phase name="PreDispatch"/>
+ <phase name="Dispatch"/>
+ <phase name="PostDispatch"/>
+ <!-- System pre defined phases -->
+ <!-- After Postdispatch phase module author or or service author can add any phase he want -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="outflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="INfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+ <phaseOrder type="Outfaultflow">
+ <!-- user can add his own phases to this area -->
+ <phase name="userphase1"/>
+ </phaseOrder>
+</axisconfig>
+
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/commons-http-enabled-axis2.xml
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java Thu Sep 15 11:52:11 2005
@@ -1,94 +1,94 @@
-package org.apache.axis2.engine.util;
-
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.clientapi.Call;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.description.OperationDescription;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.soap.SOAPEnvelope;
-
-import javax.xml.namespace.QName;
-
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- * author : Eran Chinthaka (chinthaka@apache.org)
- */
-
-public class MyInOutMEPClient extends Call {
-
- public MyInOutMEPClient() throws AxisFault {
- super(assumeServiceContext(null));
- }
-
- public MyInOutMEPClient(String clientHome) throws AxisFault {
- super(clientHome);
- }
-
- public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
- OMElement toSend) throws AxisFault {
- OperationDescription axisConfig =
- serviceContext.getServiceConfig().getOperation(new QName(axisop));
- if (axisConfig == null) {
- axisConfig = new OperationDescription(new QName(axisop));
- axisConfig.setRemainingPhasesInFlow(operationTemplate.getRemainingPhasesInFlow());
- axisConfig.setPhasesOutFlow(operationTemplate.getPhasesOutFlow());
- axisConfig.setPhasesInFaultFlow(operationTemplate.getPhasesInFaultFlow());
- axisConfig.setPhasesOutFaultFlow(operationTemplate.getPhasesOutFaultFlow());
- serviceContext.getServiceConfig().addOperation(axisConfig);
- }
-
-// if (axisConfig == null) {
-// axisConfig = new OperationDescription(new QName(axisop));
-// serviceContext.getServiceConfig().addOperation(axisConfig);
-// }
- MessageContext msgctx = prepareTheSOAPEnvelope(toSend);
-
- MessageContext responseContext = super.invokeBlocking(axisConfig,
- msgctx);
- return responseContext.getEnvelope();
- }
-
-
- public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
- SOAPEnvelope reqEnvelope) throws AxisFault {
- OperationDescription axisConfig =
- serviceContext.getServiceConfig().getOperation(new QName(axisop));
- if (axisConfig == null) {
- axisConfig = new OperationDescription(new QName(axisop));
- axisConfig.setRemainingPhasesInFlow(operationTemplate.getRemainingPhasesInFlow());
- axisConfig.setPhasesOutFlow(operationTemplate.getPhasesOutFlow());
- axisConfig.setPhasesInFaultFlow(operationTemplate.getPhasesInFaultFlow());
- axisConfig.setPhasesOutFaultFlow(operationTemplate.getPhasesOutFaultFlow());
- serviceContext.getServiceConfig().addOperation(axisConfig);
- }
-
-// if (axisConfig == null) {
-// axisConfig = new OperationDescription(new QName(axisop));
-// serviceContext.getServiceConfig().addOperation(axisConfig);
-// }
- MessageContext msgctx = getMessageContext(reqEnvelope);
-
- MessageContext responseContext = super.invokeBlocking(axisConfig,
- msgctx);
- return responseContext.getEnvelope();
- }
-
- protected MessageContext getMessageContext(SOAPEnvelope envelope) throws AxisFault {
- MessageContext msgctx = new MessageContext(serviceContext.getEngineContext());
- msgctx.setEnvelope(envelope);
- return msgctx;
- }
-}
+package org.apache.axis2.engine.util;
+
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.clientapi.Call;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.description.OperationDescription;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.soap.SOAPEnvelope;
+
+import javax.xml.namespace.QName;
+
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ *
+ * author : Eran Chinthaka (chinthaka@apache.org)
+ */
+
+public class MyInOutMEPClient extends Call {
+
+ public MyInOutMEPClient() throws AxisFault {
+ super(assumeServiceContext(null));
+ }
+
+ public MyInOutMEPClient(String clientHome) throws AxisFault {
+ super(clientHome);
+ }
+
+ public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
+ OMElement toSend) throws AxisFault {
+ OperationDescription axisConfig =
+ serviceContext.getServiceConfig().getOperation(new QName(axisop));
+ if (axisConfig == null) {
+ axisConfig = new OperationDescription(new QName(axisop));
+ axisConfig.setRemainingPhasesInFlow(operationTemplate.getRemainingPhasesInFlow());
+ axisConfig.setPhasesOutFlow(operationTemplate.getPhasesOutFlow());
+ axisConfig.setPhasesInFaultFlow(operationTemplate.getPhasesInFaultFlow());
+ axisConfig.setPhasesOutFaultFlow(operationTemplate.getPhasesOutFaultFlow());
+ serviceContext.getServiceConfig().addOperation(axisConfig);
+ }
+
+// if (axisConfig == null) {
+// axisConfig = new OperationDescription(new QName(axisop));
+// serviceContext.getServiceConfig().addOperation(axisConfig);
+// }
+ MessageContext msgctx = prepareTheSOAPEnvelope(toSend);
+
+ MessageContext responseContext = super.invokeBlocking(axisConfig,
+ msgctx);
+ return responseContext.getEnvelope();
+ }
+
+
+ public SOAPEnvelope invokeBlockingWithEnvelopeOut(String axisop,
+ SOAPEnvelope reqEnvelope) throws AxisFault {
+ OperationDescription axisConfig =
+ serviceContext.getServiceConfig().getOperation(new QName(axisop));
+ if (axisConfig == null) {
+ axisConfig = new OperationDescription(new QName(axisop));
+ axisConfig.setRemainingPhasesInFlow(operationTemplate.getRemainingPhasesInFlow());
+ axisConfig.setPhasesOutFlow(operationTemplate.getPhasesOutFlow());
+ axisConfig.setPhasesInFaultFlow(operationTemplate.getPhasesInFaultFlow());
+ axisConfig.setPhasesOutFaultFlow(operationTemplate.getPhasesOutFaultFlow());
+ serviceContext.getServiceConfig().addOperation(axisConfig);
+ }
+
+// if (axisConfig == null) {
+// axisConfig = new OperationDescription(new QName(axisop));
+// serviceContext.getServiceConfig().addOperation(axisConfig);
+// }
+ MessageContext msgctx = getMessageContext(reqEnvelope);
+
+ MessageContext responseContext = super.invokeBlocking(axisConfig,
+ msgctx);
+ return responseContext.getEnvelope();
+ }
+
+ protected MessageContext getMessageContext(SOAPEnvelope envelope) throws AxisFault {
+ MessageContext msgctx = new MessageContext(serviceContext.getEngineContext());
+ msgctx.setEnvelope(envelope);
+ return msgctx;
+ }
+}
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/engine/util/MyInOutMEPClient.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java Thu Sep 15 11:52:11 2005
@@ -1,132 +1,132 @@
-package org.apache.axis2.groovy;
-
-import junit.framework.TestCase;
-import org.apache.axis2.Constants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.description.ServiceDescription;
-import org.apache.axis2.engine.EchoRawXMLTest;
-import org.apache.axis2.integration.UtilServer;
-import org.apache.axis2.om.OMAbstractFactory;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMFactory;
-import org.apache.axis2.om.impl.OMOutputImpl;
-import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
-import org.apache.axis2.soap.SOAPFactory;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import javax.xml.stream.XMLStreamReader;
-import java.io.ByteArrayInputStream;
-import java.io.StringWriter;
-
-/*
-* Copyright 2004,2005 The Apache Software Foundation.
-*
-* Licensed under the Apache License, Version 2.0 (the "License");
-* you may not use this file except in compliance with the License.
-* You may obtain a copy of the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS,
-* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-* See the License for the specific language governing permissions and
-* limitations under the License.
-*
-*
-*/
-
-/**
- * Author : Deepal Jayasinghe
- * Date: Jul 15, 2005
- * Time: 2:20:48 PM
- */
-public class GroovyServiceTest extends TestCase {
-
-
- private EndpointReference targetEPR =
- new EndpointReference("http://127.0.0.1:"
- + (UtilServer.TESTING_PORT)
- + "/axis/services/groovyService/echo");
- private QName serviceName = new QName("groovyService");
- private QName operationName = new QName("echo");
-
-
- public GroovyServiceTest() {
- super(EchoRawXMLTest.class.getName());
- }
-
- public GroovyServiceTest(String testName) {
- super(testName);
- }
-
- protected void setUp() throws Exception {
- String repository = "target/groovyRepo";
- UtilServer.start(repository);
- UtilServer.getConfigurationContext().getAxisConfiguration()
- .engageModule(new QName("addressing"));
- }
-
- protected void tearDown() throws Exception {
- UtilServer.unDeployService(serviceName);
- UtilServer.stop();
- }
-
-
- public void testServiceExists() throws Exception {
- ServiceDescription desc = UtilServer.getConfigurationContext().
- getAxisConfiguration().getService(serviceName.getLocalPart());
- assertNotNull(desc);
- }
-
-
- public void testEchoXMLSync() throws Exception {
- SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- //OMElement payload = createPayLoad();
- OMElement payload = getpayLoad();
-
- org.apache.axis2.clientapi.Call call =
- new org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
-
- call.setTo(targetEPR);
- call.setTransportInfo(Constants.TRANSPORT_HTTP,
- Constants.TRANSPORT_HTTP,
- false);
- call.setWsaAction(operationName.getLocalPart());
-
- OMElement result = call.invokeBlocking(operationName.getLocalPart(),
- payload);
- assertNotNull(result);
- OMElement person = (OMElement)result.getFirstChild();
- assertEquals(person.getLocalName(),"person");
-
- StringWriter writer = new StringWriter();
- result.build();
- result.serializeWithCache(new OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
- writer.flush();
- call.close();
- }
-
-
-
- private OMElement getpayLoad() throws XMLStreamException {
- String str= "<ADDRESS><DET><NAME>Ponnampalam Thayaparan</NAME> <OCC>Student</OCC>" +
- "<ADD>3-2/1,Hudson Road,Colombo-03</ADD><GENDER>Male</GENDER>" +
- "</DET><DET><NAME>Eranka Samaraweera</NAME><OCC>Student</OCC><ADD>Martara</ADD>" +
- "<GENDER>Male</GENDER></DET><DET><NAME>Sriskantharaja Ahilan</NAME>" +
- "<OCC>Student</OCC><ADD>Trincomalee</ADD><GENDER>Male</GENDER>" +
- "</DET></ADDRESS>";
- XMLStreamReader xmlReader= XMLInputFactory.newInstance().createXMLStreamReader(new
- ByteArrayInputStream(str.getBytes()));
- OMFactory fac = OMAbstractFactory.getOMFactory();
-
- StAXOMBuilder staxOMBuilder = new
- StAXOMBuilder(fac,xmlReader);
- return staxOMBuilder.getDocumentElement();
- }
-
-
-}
+package org.apache.axis2.groovy;
+
+import junit.framework.TestCase;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.engine.EchoRawXMLTest;
+import org.apache.axis2.integration.UtilServer;
+import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMFactory;
+import org.apache.axis2.om.impl.OMOutputImpl;
+import org.apache.axis2.om.impl.llom.builder.StAXOMBuilder;
+import org.apache.axis2.soap.SOAPFactory;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+import javax.xml.stream.XMLStreamReader;
+import java.io.ByteArrayInputStream;
+import java.io.StringWriter;
+
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License");
+* you may not use this file except in compliance with the License.
+* You may obtain a copy of the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS,
+* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+* See the License for the specific language governing permissions and
+* limitations under the License.
+*
+*
+*/
+
+/**
+ * Author : Deepal Jayasinghe
+ * Date: Jul 15, 2005
+ * Time: 2:20:48 PM
+ */
+public class GroovyServiceTest extends TestCase {
+
+
+ private EndpointReference targetEPR =
+ new EndpointReference("http://127.0.0.1:"
+ + (UtilServer.TESTING_PORT)
+ + "/axis/services/groovyService/echo");
+ private QName serviceName = new QName("groovyService");
+ private QName operationName = new QName("echo");
+
+
+ public GroovyServiceTest() {
+ super(EchoRawXMLTest.class.getName());
+ }
+
+ public GroovyServiceTest(String testName) {
+ super(testName);
+ }
+
+ protected void setUp() throws Exception {
+ String repository = "target/groovyRepo";
+ UtilServer.start(repository);
+ UtilServer.getConfigurationContext().getAxisConfiguration()
+ .engageModule(new QName("addressing"));
+ }
+
+ protected void tearDown() throws Exception {
+ UtilServer.unDeployService(serviceName);
+ UtilServer.stop();
+ }
+
+
+ public void testServiceExists() throws Exception {
+ ServiceDescription desc = UtilServer.getConfigurationContext().
+ getAxisConfiguration().getService(serviceName.getLocalPart());
+ assertNotNull(desc);
+ }
+
+
+ public void testEchoXMLSync() throws Exception {
+ SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
+ //OMElement payload = createPayLoad();
+ OMElement payload = getpayLoad();
+
+ org.apache.axis2.clientapi.Call call =
+ new org.apache.axis2.clientapi.Call("target/test-resources/intregrationRepo");
+
+ call.setTo(targetEPR);
+ call.setTransportInfo(Constants.TRANSPORT_HTTP,
+ Constants.TRANSPORT_HTTP,
+ false);
+ call.setWsaAction(operationName.getLocalPart());
+
+ OMElement result = call.invokeBlocking(operationName.getLocalPart(),
+ payload);
+ assertNotNull(result);
+ OMElement person = (OMElement)result.getFirstChild();
+ assertEquals(person.getLocalName(),"person");
+
+ StringWriter writer = new StringWriter();
+ result.build();
+ result.serializeWithCache(new OMOutputImpl(XMLOutputFactory.newInstance().createXMLStreamWriter(writer)));
+ writer.flush();
+ call.close();
+ }
+
+
+
+ private OMElement getpayLoad() throws XMLStreamException {
+ String str= "<ADDRESS><DET><NAME>Ponnampalam Thayaparan</NAME> <OCC>Student</OCC>" +
+ "<ADD>3-2/1,Hudson Road,Colombo-03</ADD><GENDER>Male</GENDER>" +
+ "</DET><DET><NAME>Eranka Samaraweera</NAME><OCC>Student</OCC><ADD>Martara</ADD>" +
+ "<GENDER>Male</GENDER></DET><DET><NAME>Sriskantharaja Ahilan</NAME>" +
+ "<OCC>Student</OCC><ADD>Trincomalee</ADD><GENDER>Male</GENDER>" +
+ "</DET></ADDRESS>";
+ XMLStreamReader xmlReader= XMLInputFactory.newInstance().createXMLStreamReader(new
+ ByteArrayInputStream(str.getBytes()));
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+
+ StAXOMBuilder staxOMBuilder = new
+ StAXOMBuilder(fac,xmlReader);
+ return staxOMBuilder.getDocumentElement();
+ }
+
+
+}
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/groovy/GroovyServiceTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/Constants.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/EchoTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/TestingUtils.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java Thu Sep 15 11:52:11 2005
@@ -1,159 +1,159 @@
-/*
- * Copyright 2004,2005 The Apache Software Foundation.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.axis2.integration;
-
-import junit.framework.TestCase;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.ConfigurationContextFactory;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.context.ServiceGroupContext;
-import org.apache.axis2.deployment.DeploymentEngine;
-import org.apache.axis2.description.ModuleDescription;
-import org.apache.axis2.description.ServiceDescription;
-import org.apache.axis2.transport.http.SimpleHTTPServer;
-import org.apache.axis2.util.Utils;
-
-import javax.xml.namespace.QName;
-import java.io.File;
-
-public class UtilServer {
- private static int count = 0;
- private static SimpleHTTPServer receiver;
- public static final int TESTING_PORT = 5555;
- public static final String FAILURE_MESSAGE = "Intentional Failure";
-
- public static synchronized void deployService(ServiceDescription service) throws AxisFault {
- receiver.getSystemContext().getAxisConfiguration().addService(service);
- Utils.resolvePhases(receiver.getSystemContext().getAxisConfiguration(),
- service);
- ServiceGroupContext serviceGroupContext = service.getParent().getServiceGroupContext(receiver.getSystemContext());
- }
-
- public static synchronized void unDeployService(QName service) throws AxisFault {
- receiver.getSystemContext().getAxisConfiguration().removeService(
- service.getLocalPart());
- }
-
- public static synchronized void start() throws Exception {
- start(org.apache.axis2.Constants.TESTING_REPOSITORY);
- }
-
- public static synchronized void start(String repositry) throws Exception {
- if (count == 0) {
- ConfigurationContext er = getNewConfigurationContext(repositry);
-
- receiver = new SimpleHTTPServer(er, Constants.TESTING_PORT);
-
- try {
- receiver.start();
- System.out.print(
- "Server started on port " + Constants.TESTING_PORT +
- ".....");
- } finally {
-
- }
-
- try {
- Thread.sleep(2000);
- } catch (InterruptedException e1) {
- throw new AxisFault("Thread interuptted", e1);
- }
-
- }
- count++;
- }
-
- public static ConfigurationContext getNewConfigurationContext(String repositry) throws Exception {
- ConfigurationContextFactory erfac = new ConfigurationContextFactory();
- File file = new File(repositry);
- if (!file.exists()) {
- throw new Exception(
- "repository directory " + file.getAbsolutePath() +
- " does not exists");
- }
- return erfac.buildConfigurationContext(
- file.getAbsolutePath());
- }
-
- public static synchronized void stop() {
- if (count == 1) {
- receiver.stop();
- while(receiver.isRunning()){
- try {
- Thread.sleep(1000);
- } catch (InterruptedException e1) {
- }
- }
- count = 0;
- System.out.print("Server stopped .....");
- } else {
- count--;
- }
- }
-
- public static ConfigurationContext getConfigurationContext() {
- return receiver.getSystemContext();
- }
-
- public static ServiceContext createAdressedEnabledClientSide(
- ServiceDescription service)
- throws AxisFault {
- DeploymentEngine deploymentEngine = new DeploymentEngine();
- File file = new File(
- org.apache.axis2.Constants.TESTING_REPOSITORY +
- "/modules/addressing.mar");
- TestCase.assertTrue(file.exists());
- ModuleDescription moduleDesc = deploymentEngine.buildModule(file);
-
- ConfigurationContextFactory efac = new ConfigurationContextFactory();
- ConfigurationContext sysContext =
- efac.buildClientConfigurationContext("target/test-resources/intregrationRepo");
-
- sysContext.getAxisConfiguration().addModule(moduleDesc);
- //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
-
- sysContext.getAxisConfiguration().addService(service);
-
- return service.getParent().getServiceGroupContext(sysContext
- ).getServiceContext(service.getName().getLocalPart());
- }
-
- public static ServiceContext createAdressedEnabledClientSide(
- ServiceDescription service, String clientHome)
- throws AxisFault {
- DeploymentEngine deploymentEngine = new DeploymentEngine();
- File file = new File(
- org.apache.axis2.Constants.TESTING_REPOSITORY +
- "/modules/addressing.mar");
- TestCase.assertTrue(file.exists());
- ModuleDescription moduleDesc = deploymentEngine.buildModule(file);
-
- ConfigurationContextFactory efac = new ConfigurationContextFactory();
- ConfigurationContext sysContext =
- efac.buildClientConfigurationContext(clientHome);
-
- sysContext.getAxisConfiguration().addModule(moduleDesc);
- //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
-
- sysContext.getAxisConfiguration().addService(service);
-
- return service.getParent().getServiceGroupContext(sysContext
- ).getServiceContext(service.getName().getLocalPart());
- }
-
-}
+/*
+ * Copyright 2004,2005 The Apache Software Foundation.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.axis2.integration;
+
+import junit.framework.TestCase;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.ConfigurationContextFactory;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.context.ServiceGroupContext;
+import org.apache.axis2.deployment.DeploymentEngine;
+import org.apache.axis2.description.ModuleDescription;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.transport.http.SimpleHTTPServer;
+import org.apache.axis2.util.Utils;
+
+import javax.xml.namespace.QName;
+import java.io.File;
+
+public class UtilServer {
+ private static int count = 0;
+ private static SimpleHTTPServer receiver;
+ public static final int TESTING_PORT = 5555;
+ public static final String FAILURE_MESSAGE = "Intentional Failure";
+
+ public static synchronized void deployService(ServiceDescription service) throws AxisFault {
+ receiver.getSystemContext().getAxisConfiguration().addService(service);
+ Utils.resolvePhases(receiver.getSystemContext().getAxisConfiguration(),
+ service);
+ ServiceGroupContext serviceGroupContext = service.getParent().getServiceGroupContext(receiver.getSystemContext());
+ }
+
+ public static synchronized void unDeployService(QName service) throws AxisFault {
+ receiver.getSystemContext().getAxisConfiguration().removeService(
+ service.getLocalPart());
+ }
+
+ public static synchronized void start() throws Exception {
+ start(org.apache.axis2.Constants.TESTING_REPOSITORY);
+ }
+
+ public static synchronized void start(String repositry) throws Exception {
+ if (count == 0) {
+ ConfigurationContext er = getNewConfigurationContext(repositry);
+
+ receiver = new SimpleHTTPServer(er, Constants.TESTING_PORT);
+
+ try {
+ receiver.start();
+ System.out.print(
+ "Server started on port " + Constants.TESTING_PORT +
+ ".....");
+ } finally {
+
+ }
+
+ try {
+ Thread.sleep(2000);
+ } catch (InterruptedException e1) {
+ throw new AxisFault("Thread interuptted", e1);
+ }
+
+ }
+ count++;
+ }
+
+ public static ConfigurationContext getNewConfigurationContext(String repositry) throws Exception {
+ ConfigurationContextFactory erfac = new ConfigurationContextFactory();
+ File file = new File(repositry);
+ if (!file.exists()) {
+ throw new Exception(
+ "repository directory " + file.getAbsolutePath() +
+ " does not exists");
+ }
+ return erfac.buildConfigurationContext(
+ file.getAbsolutePath());
+ }
+
+ public static synchronized void stop() {
+ if (count == 1) {
+ receiver.stop();
+ while(receiver.isRunning()){
+ try {
+ Thread.sleep(1000);
+ } catch (InterruptedException e1) {
+ }
+ }
+ count = 0;
+ System.out.print("Server stopped .....");
+ } else {
+ count--;
+ }
+ }
+
+ public static ConfigurationContext getConfigurationContext() {
+ return receiver.getSystemContext();
+ }
+
+ public static ServiceContext createAdressedEnabledClientSide(
+ ServiceDescription service)
+ throws AxisFault {
+ DeploymentEngine deploymentEngine = new DeploymentEngine();
+ File file = new File(
+ org.apache.axis2.Constants.TESTING_REPOSITORY +
+ "/modules/addressing.mar");
+ TestCase.assertTrue(file.exists());
+ ModuleDescription moduleDesc = deploymentEngine.buildModule(file);
+
+ ConfigurationContextFactory efac = new ConfigurationContextFactory();
+ ConfigurationContext sysContext =
+ efac.buildClientConfigurationContext("target/test-resources/intregrationRepo");
+
+ sysContext.getAxisConfiguration().addModule(moduleDesc);
+ //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
+
+ sysContext.getAxisConfiguration().addService(service);
+
+ return service.getParent().getServiceGroupContext(sysContext
+ ).getServiceContext(service.getName().getLocalPart());
+ }
+
+ public static ServiceContext createAdressedEnabledClientSide(
+ ServiceDescription service, String clientHome)
+ throws AxisFault {
+ DeploymentEngine deploymentEngine = new DeploymentEngine();
+ File file = new File(
+ org.apache.axis2.Constants.TESTING_REPOSITORY +
+ "/modules/addressing.mar");
+ TestCase.assertTrue(file.exists());
+ ModuleDescription moduleDesc = deploymentEngine.buildModule(file);
+
+ ConfigurationContextFactory efac = new ConfigurationContextFactory();
+ ConfigurationContext sysContext =
+ efac.buildClientConfigurationContext(clientHome);
+
+ sysContext.getAxisConfiguration().addModule(moduleDesc);
+ //sysContext.getAxisConfiguration().engageModule(moduleDesc.getName());
+
+ sysContext.getAxisConfiguration().addService(service);
+
+ return service.getParent().getServiceGroupContext(sysContext
+ ).getServiceContext(service.getName().getLocalPart());
+ }
+
+}
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/integration/UtilsTCPServer.java
------------------------------------------------------------------------------
svn:eol-style = native
Modified: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java?rev=289289&r1=289288&r2=289289&view=diff
==============================================================================
--- webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java (original)
+++ webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java Thu Sep 15 11:52:11 2005
@@ -1,241 +1,241 @@
-/*
-* Copyright 2004,2005 The Apache Software Foundation.
-*
-* Licensed under the Apache License, Version 2.0 (the "License"); you may not
-* use this file except in compliance with the License. You may obtain a copy of
-* the License at
-*
-* http://www.apache.org/licenses/LICENSE-2.0
-*
-* Unless required by applicable law or agreed to in writing, software
-* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
-* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
-* License for the specific language governing permissions and limitations under
-* the License.
-*
-*/
-
-package org.apache.axis2.mail;
-
-import junit.framework.TestCase;
-import org.apache.axis2.AxisFault;
-import org.apache.axis2.Constants;
-import org.apache.axis2.addressing.EndpointReference;
-import org.apache.axis2.clientapi.AsyncResult;
-import org.apache.axis2.clientapi.Callback;
-import org.apache.axis2.context.ConfigurationContext;
-import org.apache.axis2.context.MessageContext;
-import org.apache.axis2.context.ServiceContext;
-import org.apache.axis2.description.OperationDescription;
-import org.apache.axis2.description.ServiceDescription;
-import org.apache.axis2.engine.AxisConfiguration;
-import org.apache.axis2.engine.Echo;
-import org.apache.axis2.engine.MessageReceiver;
-import org.apache.axis2.om.OMAbstractFactory;
-import org.apache.axis2.om.OMElement;
-import org.apache.axis2.om.OMFactory;
-import org.apache.axis2.om.OMNamespace;
-import org.apache.axis2.soap.SOAPEnvelope;
-import org.apache.axis2.transport.mail.SimpleMailListener;
-import org.apache.axis2.util.Utils;
-import org.apache.commons.logging.Log;
-import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-
-/**
- * These tests willcheck wheather the mail transport works ok with charactor set
- * encoding changes.
- *
- * @author Chamil Thanthrimudalige <ch...@gmail.com>
- */
-public class MailCharSetEncodingTest extends TestCase {
-
- private EndpointReference targetEPR = new EndpointReference("foo@127.0.0.1"
- + "/axis/services/EchoXMLService/echoOMElement");
-
- private Log log = LogFactory.getLog(getClass());
-
- private QName serviceName = new QName("EchoXMLService");
-
- private QName operationName = new QName("echoOMElement");
-
- private QName transportName = new QName("http://localhost/my",
- "NullTransport");
-
- OMElement resultElem = null;
-
- private AxisConfiguration engineRegistry;
-
- private MessageContext mc;
-
- private SOAPEnvelope envelope;
-
- private boolean finish = false;
-
- ServiceContext clientServiceContext;
-
- ConfigurationContext clientConfigContext;
-
- ConfigurationContext configContext;
-
- public MailCharSetEncodingTest() {
- super(MailCharSetEncodingTest.class.getName());
- }
-
- protected void setUp() throws Exception {
- configContext = UtilsMailServer.start();
-
- ServiceDescription service = Utils.createSimpleService(serviceName,
- Echo.class.getName(), operationName);
- configContext.getAxisConfiguration().addService(service);
- Utils.resolvePhases(configContext.getAxisConfiguration(), service);
-
- SimpleMailListener ml = new SimpleMailListener();
-
- ml.init(configContext, configContext.getAxisConfiguration()
- .getTransportIn(new QName(Constants.TRANSPORT_MAIL)));
- ml.start();
-
- }
-
- public void runTest(String value) throws Exception {
- finish = false;
- resultElem = null;
- envelope = null;
- String expected = value;
- try {
- if (clientConfigContext ==null) {
- clientConfigContext = UtilsMailServer
- .createClientConfigurationContext();
- engineRegistry = clientConfigContext.getAxisConfiguration();
- }
- ServiceDescription clientService = new ServiceDescription(
- serviceName);
- OperationDescription clientOperation = new OperationDescription(
- operationName);
- clientOperation.setMessageReceiver(new MessageReceiver() {
- public void receive(MessageContext messgeCtx) throws AxisFault {
- envelope = messgeCtx.getEnvelope();
- }
- });
- engineRegistry.removeService(serviceName.getLocalPart());
- clientService.addOperation(clientOperation);
- engineRegistry.addService(clientService);
- Utils.resolvePhases(engineRegistry, clientService);
- clientServiceContext = Utils.fillContextInformation(clientOperation, clientService, clientConfigContext);
-
- org.apache.axis2.clientapi.Call call = new org.apache.axis2.clientapi.Call(
- clientServiceContext);
-
- call.setTo(targetEPR);
- call.setTransportInfo(Constants.TRANSPORT_MAIL,
- Constants.TRANSPORT_MAIL, true);
- Callback callback = new Callback() {
- public void onComplete(AsyncResult result) {
- resultElem = result.getResponseEnvelope();
- finish = true;
- }
-
- public void reportError(Exception e) {
- log.error(e.getMessage(), e);
- finish = true;
- }
- };
- call.invokeNonBlocking(operationName.getLocalPart(),
- createEnvelope(value), callback);
- int index = 0;
- while (!finish) {
- Thread.sleep(1000);
- index++;
- if (index > 10) {
- throw new AxisFault(
- "Async response is taking too long[10s+]. Server is being shut down.");
- }
- }
- // call.close();
- call = null;
- assertNotNull("Result is null", resultElem);
- String result = ((OMElement) resultElem.getFirstChild()
- .getNextSibling()).getFirstElement().getFirstElement()
- .getText();
-
- assertNotNull("Result value is null", result);
-
- assertEquals("Expected result not received.", expected, result);
-
- } catch (AxisFault e) {
- log.error(e, e);
- throw e;
- } catch (InterruptedException e) {
- log.error(e, e);
- throw e;
- } catch (Exception e) {
- log.error(e, e);
- throw e;
-
- }
- }
-
- public void testSimpleString() throws Exception {
- runTest("a simple string");
- }
-
- public void testStringWithApostrophes() throws Exception {
- runTest("this isn't a simple string");
- }
-
- public void testStringWithEntities() throws Exception {
- runTest("&<>'"");
- }
-
- public void testStringWithRawEntities() throws Exception {
- runTest("&<>'\"");
- }
-
- public void testStringWithLeadingAndTrailingSpaces() throws Exception {
- runTest(" centered ");
- }
-
- public void testWhitespace() throws Exception {
- runTest(" \n \t "); // note: \r fails
- }
-
- public void testFrenchAccents() throws Exception {
- runTest("\u00e0\u00e2\u00e4\u00e7\u00e8\u00e9\u00ea\u00eb\u00ee\u00ef\u00f4\u00f6\u00f9\u00fb\u00fc");
- }
-
- public void testGermanUmlauts() throws Exception {
- runTest(" Some text \u00df with \u00fc special \u00f6 chars \u00e4.");
- }
-
- public void testWelcomeUnicode() throws Exception {
- // welcome in several languages
- runTest("Chinese (trad.) : \u6b61\u8fce ");
- }
-
- public void testWelcomeUnicode2() throws Exception {
- // welcome in several languages
- runTest("Greek : \u03ba\u03b1\u03bb\u03ce\u03c2 \u03bf\u03c1\u03af\u03c3\u03b1\u03c4\u03b5");
- }
-
- public void testWelcomeUnicode3() throws Exception {
- // welcome in several languages
- runTest("Japanese : \u3088\u3046\u3053\u305d");
- }
-
- protected void tearDown() throws Exception {
- UtilsMailServer.stop();
- }
-
- private OMElement createEnvelope(String text) {
- OMFactory fac = OMAbstractFactory.getOMFactory();
- OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
- OMElement method = fac.createOMElement("echoOMElement", omNs);
- OMElement value = fac.createOMElement("myValue", omNs);
- value.addChild(fac.createText(value, text));
- method.addChild(value);
-
- return method;
- }
+/*
+* Copyright 2004,2005 The Apache Software Foundation.
+*
+* Licensed under the Apache License, Version 2.0 (the "License"); you may not
+* use this file except in compliance with the License. You may obtain a copy of
+* the License at
+*
+* http://www.apache.org/licenses/LICENSE-2.0
+*
+* Unless required by applicable law or agreed to in writing, software
+* distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
+* WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
+* License for the specific language governing permissions and limitations under
+* the License.
+*
+*/
+
+package org.apache.axis2.mail;
+
+import junit.framework.TestCase;
+import org.apache.axis2.AxisFault;
+import org.apache.axis2.Constants;
+import org.apache.axis2.addressing.EndpointReference;
+import org.apache.axis2.clientapi.AsyncResult;
+import org.apache.axis2.clientapi.Callback;
+import org.apache.axis2.context.ConfigurationContext;
+import org.apache.axis2.context.MessageContext;
+import org.apache.axis2.context.ServiceContext;
+import org.apache.axis2.description.OperationDescription;
+import org.apache.axis2.description.ServiceDescription;
+import org.apache.axis2.engine.AxisConfiguration;
+import org.apache.axis2.engine.Echo;
+import org.apache.axis2.engine.MessageReceiver;
+import org.apache.axis2.om.OMAbstractFactory;
+import org.apache.axis2.om.OMElement;
+import org.apache.axis2.om.OMFactory;
+import org.apache.axis2.om.OMNamespace;
+import org.apache.axis2.soap.SOAPEnvelope;
+import org.apache.axis2.transport.mail.SimpleMailListener;
+import org.apache.axis2.util.Utils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
+
+import javax.xml.namespace.QName;
+
+/**
+ * These tests willcheck wheather the mail transport works ok with charactor set
+ * encoding changes.
+ *
+ * @author Chamil Thanthrimudalige <ch...@gmail.com>
+ */
+public class MailCharSetEncodingTest extends TestCase {
+
+ private EndpointReference targetEPR = new EndpointReference("foo@127.0.0.1"
+ + "/axis/services/EchoXMLService/echoOMElement");
+
+ private Log log = LogFactory.getLog(getClass());
+
+ private QName serviceName = new QName("EchoXMLService");
+
+ private QName operationName = new QName("echoOMElement");
+
+ private QName transportName = new QName("http://localhost/my",
+ "NullTransport");
+
+ OMElement resultElem = null;
+
+ private AxisConfiguration engineRegistry;
+
+ private MessageContext mc;
+
+ private SOAPEnvelope envelope;
+
+ private boolean finish = false;
+
+ ServiceContext clientServiceContext;
+
+ ConfigurationContext clientConfigContext;
+
+ ConfigurationContext configContext;
+
+ public MailCharSetEncodingTest() {
+ super(MailCharSetEncodingTest.class.getName());
+ }
+
+ protected void setUp() throws Exception {
+ configContext = UtilsMailServer.start();
+
+ ServiceDescription service = Utils.createSimpleService(serviceName,
+ Echo.class.getName(), operationName);
+ configContext.getAxisConfiguration().addService(service);
+ Utils.resolvePhases(configContext.getAxisConfiguration(), service);
+
+ SimpleMailListener ml = new SimpleMailListener();
+
+ ml.init(configContext, configContext.getAxisConfiguration()
+ .getTransportIn(new QName(Constants.TRANSPORT_MAIL)));
+ ml.start();
+
+ }
+
+ public void runTest(String value) throws Exception {
+ finish = false;
+ resultElem = null;
+ envelope = null;
+ String expected = value;
+ try {
+ if (clientConfigContext ==null) {
+ clientConfigContext = UtilsMailServer
+ .createClientConfigurationContext();
+ engineRegistry = clientConfigContext.getAxisConfiguration();
+ }
+ ServiceDescription clientService = new ServiceDescription(
+ serviceName);
+ OperationDescription clientOperation = new OperationDescription(
+ operationName);
+ clientOperation.setMessageReceiver(new MessageReceiver() {
+ public void receive(MessageContext messgeCtx) throws AxisFault {
+ envelope = messgeCtx.getEnvelope();
+ }
+ });
+ engineRegistry.removeService(serviceName.getLocalPart());
+ clientService.addOperation(clientOperation);
+ engineRegistry.addService(clientService);
+ Utils.resolvePhases(engineRegistry, clientService);
+ clientServiceContext = Utils.fillContextInformation(clientOperation, clientService, clientConfigContext);
+
+ org.apache.axis2.clientapi.Call call = new org.apache.axis2.clientapi.Call(
+ clientServiceContext);
+
+ call.setTo(targetEPR);
+ call.setTransportInfo(Constants.TRANSPORT_MAIL,
+ Constants.TRANSPORT_MAIL, true);
+ Callback callback = new Callback() {
+ public void onComplete(AsyncResult result) {
+ resultElem = result.getResponseEnvelope();
+ finish = true;
+ }
+
+ public void reportError(Exception e) {
+ log.error(e.getMessage(), e);
+ finish = true;
+ }
+ };
+ call.invokeNonBlocking(operationName.getLocalPart(),
+ createEnvelope(value), callback);
+ int index = 0;
+ while (!finish) {
+ Thread.sleep(1000);
+ index++;
+ if (index > 10) {
+ throw new AxisFault(
+ "Async response is taking too long[10s+]. Server is being shut down.");
+ }
+ }
+ // call.close();
+ call = null;
+ assertNotNull("Result is null", resultElem);
+ String result = ((OMElement) resultElem.getFirstChild()
+ .getNextSibling()).getFirstElement().getFirstElement()
+ .getText();
+
+ assertNotNull("Result value is null", result);
+
+ assertEquals("Expected result not received.", expected, result);
+
+ } catch (AxisFault e) {
+ log.error(e, e);
+ throw e;
+ } catch (InterruptedException e) {
+ log.error(e, e);
+ throw e;
+ } catch (Exception e) {
+ log.error(e, e);
+ throw e;
+
+ }
+ }
+
+ public void testSimpleString() throws Exception {
+ runTest("a simple string");
+ }
+
+ public void testStringWithApostrophes() throws Exception {
+ runTest("this isn't a simple string");
+ }
+
+ public void testStringWithEntities() throws Exception {
+ runTest("&<>'"");
+ }
+
+ public void testStringWithRawEntities() throws Exception {
+ runTest("&<>'\"");
+ }
+
+ public void testStringWithLeadingAndTrailingSpaces() throws Exception {
+ runTest(" centered ");
+ }
+
+ public void testWhitespace() throws Exception {
+ runTest(" \n \t "); // note: \r fails
+ }
+
+ public void testFrenchAccents() throws Exception {
+ runTest("\u00e0\u00e2\u00e4\u00e7\u00e8\u00e9\u00ea\u00eb\u00ee\u00ef\u00f4\u00f6\u00f9\u00fb\u00fc");
+ }
+
+ public void testGermanUmlauts() throws Exception {
+ runTest(" Some text \u00df with \u00fc special \u00f6 chars \u00e4.");
+ }
+
+ public void testWelcomeUnicode() throws Exception {
+ // welcome in several languages
+ runTest("Chinese (trad.) : \u6b61\u8fce ");
+ }
+
+ public void testWelcomeUnicode2() throws Exception {
+ // welcome in several languages
+ runTest("Greek : \u03ba\u03b1\u03bb\u03ce\u03c2 \u03bf\u03c1\u03af\u03c3\u03b1\u03c4\u03b5");
+ }
+
+ public void testWelcomeUnicode3() throws Exception {
+ // welcome in several languages
+ runTest("Japanese : \u3088\u3046\u3053\u305d");
+ }
+
+ protected void tearDown() throws Exception {
+ UtilsMailServer.stop();
+ }
+
+ private OMElement createEnvelope(String text) {
+ OMFactory fac = OMAbstractFactory.getOMFactory();
+ OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
+ OMElement method = fac.createOMElement("echoOMElement", omNs);
+ OMElement value = fac.createOMElement("myValue", omNs);
+ value.addChild(fac.createText(value, text));
+ method.addChild(value);
+
+ return method;
+ }
}
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailCharSetEncodingTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailOneWayRawXMLTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailRequestResponseRawXMLTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/MailetRequestResponceRawXMLTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: webservices/axis2/trunk/java/modules/integration/test/org/apache/axis2/mail/UtilsMailServer.java
------------------------------------------------------------------------------
svn:eol-style = native