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 he...@apache.org on 2005/04/14 18:39:23 UTC
svn commit: r161318 [2/2] - in webservices/axis/trunk/java: etc/
modules/core/src/org/apache/axis/ modules/core/src/org/apache/axis/clientapi/
modules/core/src/org/apache/axis/context/
modules/core/src/org/apache/axis/description/
modules/core/src/org/apache/axis/engine/
modules/core/src/org/apache/axis/phaseresolver/
modules/core/src/org/apache/axis/receivers/
modules/core/src/org/apache/axis/util/
modules/core/test/org/apache/axis/deployment/
modules/core/test/org/apache/axis/description/
modules/core/test/org/apache/axis/engine/
modules/samples/src/encoding/sample1/
modules/samples/src/encoding/sample2/benchMark/
modules/samples/src/interop/doclit/
modules/samples/src/org/apache/axis/testUtils/
modules/samples/src/userguide/sample1/
modules/samples/test/org/apache/axis/clientapi/
modules/samples/test/org/apache/axis/engine/
modules/samples/test/org/apache/axis/integration/
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java Thu Apr 14 09:39:15 2005
@@ -31,15 +31,14 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.description.AxisOperation;
import org.apache.axis.description.AxisService;
-import org.apache.axis.encoding.EncodingTest.Echo;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMElement;
import org.apache.axis.om.OMFactory;
import org.apache.axis.om.OMNamespace;
import org.apache.axis.om.OMNode;
import org.apache.axis.om.SOAPEnvelope;
-import org.apache.axis.providers.RawXMLProvider;
import org.apache.axis.transport.http.SimpleHTTPServer;
+import org.apache.axis.util.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -66,14 +65,10 @@
protected void setUp() throws Exception {
UtilServer.start();
- AxisService service = new AxisService(serviceName);
- service.setClassLoader(Thread.currentThread().getContextClassLoader());
- service.setServiceClass(Echo.class);
- service.setMessageReceiver(new RawXMLProvider());
+ AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName());
AxisOperation operation = new AxisOperation(operationName);
-
service.addOperation(operation);
- UtilServer.deployService(service);
+ UtilServer.deployService(Utils.createServiceContext(service));
}
@@ -97,7 +92,7 @@
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + UtilServer.TESTING_PORT + "/axis/services/EchoXMLService");
call.setTo(targetEPR);
- SOAPEnvelope resEnv = call.sendReceive(reqEnv);
+ SOAPEnvelope resEnv = call.sendReceiveSync(reqEnv);
resEnv.serialize(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out), true);
OMNode omNode = resEnv.getBody().getFirstChild();
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java Thu Apr 14 09:39:15 2005
@@ -29,8 +29,6 @@
import org.apache.axis.description.AxisService;
import org.apache.axis.description.Flow;
import org.apache.axis.description.FlowImpl;
-import org.apache.axis.description.Parameter;
-import org.apache.axis.description.ParameterImpl;
import org.apache.axis.handlers.AbstractHandler;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMElement;
@@ -38,7 +36,6 @@
import org.apache.axis.om.OMNamespace;
import org.apache.axis.om.SOAPBody;
import org.apache.axis.om.SOAPEnvelope;
-import org.apache.axis.providers.RawXMLProvider;
import org.apache.axis.transport.http.SimpleHTTPServer;
import org.apache.axis.util.Utils;
import org.apache.commons.logging.Log;
@@ -68,8 +65,6 @@
public void testFailureAtServerRequestFlow() throws Exception {
- AxisService service = new AxisService(serviceName);
-
Flow flow = new FlowImpl();
Utils.addHandler(flow, new SpeakingHandler());
Utils.addHandler(flow, new SpeakingHandler());
@@ -77,20 +72,14 @@
Utils.addHandler(flow, new SpeakingHandler());
Utils.addHandler(flow, culprit);
Utils.addHandler(flow, new SpeakingHandler());
+
+ AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName());
service.setInFlow(flow);
-
- service.setClassLoader(Thread.currentThread().getContextClassLoader());
- Parameter classParam = new ParameterImpl("className", Echo.class.getName());
- service.addParameter(classParam);
- service.setMessageReceiver(new RawXMLProvider());
AxisOperation operation = new AxisOperation(operationName);
-
service.addOperation(operation);
- Utils.createExecutionChains(service);
-
UtilServer.start();
- UtilServer.deployService(service);
+ UtilServer.deployService(Utils.createServiceContext(service));
try {
callTheService();
} finally {
@@ -100,7 +89,8 @@
}
public void testFailureAtServerResponseFlow() throws Exception {
- AxisService service = new AxisService(serviceName);
+ AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName());
+
Flow flow = new FlowImpl();
Utils.addHandler(flow, new SpeakingHandler());
@@ -120,17 +110,11 @@
Utils.addHandler(flow, new SpeakingHandler());
service.setInFlow(flow);
- service.setClassLoader(Thread.currentThread().getContextClassLoader());
- Parameter classParam = new ParameterImpl("className", Echo.class.getName());
- service.addParameter(classParam);
- service.setMessageReceiver(new RawXMLProvider());
AxisOperation operation = new AxisOperation(operationName);
-
service.addOperation(operation);
- Utils.createExecutionChains(service);
UtilServer.start();
- UtilServer.deployService(service);
+ UtilServer.deployService(Utils.createServiceContext(service));
try {
callTheService();
} finally {
@@ -161,7 +145,7 @@
//EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + Utils.TESTING_PORT + "/axis/services/EchoXMLService");
EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + (UtilServer.TESTING_PORT) + "/axis/services/EchoXMLService");
call.setTo(targetEPR);
- SOAPEnvelope resEnv = call.sendReceive(reqEnv);
+ SOAPEnvelope resEnv = call.sendReceiveSync(reqEnv);
SOAPBody sb = resEnv.getBody();
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MessageWithServerTest.java Thu Apr 14 09:39:15 2005
@@ -13,7 +13,7 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
-
+
package org.apache.axis.engine;
//todo
@@ -33,15 +33,16 @@
import org.apache.axis.description.AxisOperation;
import org.apache.axis.description.AxisService;
import org.apache.axis.integration.UtilServer;
-import org.apache.axis.testUtils.SimpleJavaProvider;
import org.apache.axis.transport.http.SimpleHTTPServer;
+import org.apache.axis.util.Utils;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
public class MessageWithServerTest extends TestCase {
private Log log = LogFactory.getLog(getClass());
private QName serviceName = new QName("", "EchoService");
- private QName operationName = new QName("http://ws.apache.org/axis2", "echoVoid");
+ private QName operationName =
+ new QName("http://ws.apache.org/axis2", "echoVoid");
private QName transportName = new QName("", "NullTransport");
private EngineConfiguration engineRegistry;
@@ -57,14 +58,12 @@
protected void setUp() throws Exception {
UtilServer.start();
- AxisService service = new AxisService(serviceName);
+ AxisService service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName());
+
+
service.setInFlow(new MockFlow("service inflow", 4));
service.setOutFlow(new MockFlow("service outflow", 5));
service.setFaultFlow(new MockFlow("service faultflow", 1));
- service.setClassLoader(Thread.currentThread().getContextClassLoader());
- service.setServiceClass(Echo.class);
-
- service.setMessageReceiver(new SimpleJavaProvider());
AxisModule m1 = new AxisModule(new QName("", "A Mdoule 1"));
m1.setInFlow(new MockFlow("service module inflow", 4));
@@ -74,7 +73,7 @@
AxisOperation operation = new AxisOperation(operationName);
service.addOperation(operation);
- UtilServer.deployService(service);
+ UtilServer.deployService(Utils.createServiceContext(service));
}
protected void tearDown() throws Exception {
@@ -82,7 +81,6 @@
UtilServer.stop();
}
-
public void testEchoStringServer() throws Exception {
InputStream in = cl.getResourceAsStream("soap/soapmessage.txt");
@@ -93,7 +91,6 @@
while ((index = in.read(buf)) > 0) {
out.write(buf, 0, index);
}
-
InputStream respose = socket.getInputStream();
Reader rReader = new InputStreamReader(respose);
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/EchoTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/EchoTest.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/EchoTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/EchoTest.java Thu Apr 14 09:39:15 2005
@@ -89,7 +89,7 @@
Call call = new Call();
call.setTo(targetEPR);
call.setListenerTransport(Constants.TRANSPORT_HTTP,true);
- SOAPEnvelope responseEnv = call.sendReceive(envelope);
+ SOAPEnvelope responseEnv = call.sendReceiveSync(envelope);
SOAPBody body = responseEnv.getBody();
if (body.hasFault()) {
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java?view=diff&r1=161317&r2=161318
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/UtilServer.java Thu Apr 14 09:39:15 2005
@@ -16,15 +16,16 @@
package org.apache.axis.integration;
-import org.apache.axis.description.AxisService;
+import java.net.ServerSocket;
+
+import javax.xml.namespace.QName;
+
+import org.apache.axis.context.EngineContext;
+import org.apache.axis.context.ServiceContext;
import org.apache.axis.engine.AxisFault;
-import org.apache.axis.engine.EngineConfiguration;
import org.apache.axis.engine.EngineRegistryFactory;
import org.apache.axis.transport.http.SimpleHTTPServer;
-import javax.xml.namespace.QName;
-import java.net.ServerSocket;
-
public class UtilServer {
private static int count = 0;
private static SimpleHTTPServer reciver;
@@ -33,21 +34,22 @@
- public static synchronized void deployService(AxisService service)
+ public static synchronized void deployService(ServiceContext service)
throws AxisFault {
reciver.getEngineReg().addService(service);
+ reciver.getEngineReg().getEngineConfig().addService(service.getServiceConfig());
}
public static synchronized void unDeployService(QName service)
throws AxisFault {
- reciver.getEngineReg().removeService(service);
+ reciver.getEngineReg().getEngineConfig().removeService(service);
}
public static synchronized void start() throws Exception {
if (count == 0) {
Class erClass = Class.forName("org.apache.axis.deployment.EngineRegistryFactoryImpl");
EngineRegistryFactory erfac = (EngineRegistryFactory)erClass.newInstance();
- EngineConfiguration er =
+ EngineContext er =
erfac.createEngineRegistry("target/test-resources/samples/");
try {
Thread.sleep(2000);