You are viewing a plain text version of this content. The canonical link for it is here.
Posted to axis-cvs@ws.apache.org by he...@apache.org on 2005/05/19 15:39:25 UTC
svn commit: r170925 - in /webservices/axis/trunk/java/modules:
core/src/org/apache/axis/context/ core/src/org/apache/axis/deployment/
core/src/org/apache/axis/engine/ core/src/org/apache/axis/phaseresolver/
samples/ samples/test/org/apache/axis/engine/
Author: hemapani
Date: Thu May 19 06:39:25 2005
New Revision: 170925
URL: http://svn.apache.org/viewcvs?rev=170925&view=rev
Log:
fixing testcases and bring build to state we have in the morning
Modified:
webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContextFactory.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisSystemImpl.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Phase.java
webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
webservices/axis/trunk/java/modules/samples/project.xml
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/HandlerFailureTest.java
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContextFactory.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContextFactory.java?rev=170925&r1=170924&r2=170925&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContextFactory.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/context/EngineContextFactory.java Thu May 19 06:39:25 2005
@@ -82,7 +82,7 @@
}
}
- public void createChains(ServiceDescription service, AxisConfiguration system , ArrayList modules) throws PhaseException {
+ public static void createChains(ServiceDescription service, AxisConfiguration system , ArrayList modules) throws PhaseException {
try {
PhaseResolver reolve = new PhaseResolver(system, service);
reolve.buildchains();
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java?rev=170925&r1=170924&r2=170925&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/deployment/DeploymentEngine.java Thu May 19 06:39:25 2005
@@ -359,7 +359,14 @@
currentArchiveFile.setClassLoader();
loadServiceProperties(serviceMetaData);
axisConfig.addService(serviceMetaData);
- factory.createChains(serviceMetaData, axisConfig, currentArchiveFile.getModules());
+
+ ArrayList list = currentArchiveFile.getModules();
+ for(int i = 0;i<list.size();i++){
+ ModuleDescription module = axisConfig.getModule((QName)list.get(i));
+ serviceMetaData.engageModule(module);
+ }
+
+ ///factory.createChains(serviceMetaData, axisConfig, );
System.out.println("adding new service : " + serviceMetaData.getName().getLocalPart());
} catch (PhaseException e) {
throw new AxisFault(e);
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisSystemImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisSystemImpl.java?rev=170925&r1=170924&r2=170925&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisSystemImpl.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/AxisSystemImpl.java Thu May 19 06:39:25 2005
@@ -131,6 +131,8 @@
*/
public synchronized void addService(ServiceDescription service) throws AxisFault {
services.put(service.getName(), service);
+ PhaseResolver handlerResolver = new PhaseResolver(this,service);
+ handlerResolver.buildchains();
}
/**
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Phase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Phase.java?rev=170925&r1=170924&r2=170925&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Phase.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/engine/Phase.java Thu May 19 06:39:25 2005
@@ -469,7 +469,7 @@
insertAfter(handler.getHandler());
}
case ANYWHERE : {
- handlers.add(handler);
+ handlers.add(handler.getHandler());
}
}
}
Modified: webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java?rev=170925&r1=170924&r2=170925&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java (original)
+++ webservices/axis/trunk/java/modules/core/src/org/apache/axis/phaseresolver/PhaseResolver.java Thu May 19 06:39:25 2005
@@ -241,7 +241,7 @@
if (module != null) {
buildModuleHandlers(allHandlers, module, flowtype);
}
- }
+ }*/
switch (flowtype) {
case PhaseMetadata.IN_FLOW:
@@ -264,7 +264,7 @@
phaseHolder = new PhaseHolder(operation.getPhasesOutFaultFlow());
break;
}
- }*/
+ }
for (int i = 0; i < allHandlers.size(); i++) {
HandlerDescription handlerMetaData =
(HandlerDescription) allHandlers.get(i);
Modified: webservices/axis/trunk/java/modules/samples/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/project.xml?rev=170925&r1=170924&r2=170925&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/project.xml (original)
+++ webservices/axis/trunk/java/modules/samples/project.xml Thu May 19 06:39:25 2005
@@ -109,9 +109,9 @@
<exclude>**/*InteropStubTest.java</exclude>
<!-- <exclude>**/*EchoTest.java</exclude> -->
<!-- <exclude>**/*TransportDeploymentTest.java</exclude> -->
- <!-- <exclude>**/*BuildERWithDeploymentTest.java</exclude> -->
- <exclude>**/*EchoRawXMLTest.java</exclude>
- <exclude>**/*HandlerFailureTest.java</exclude>
+ <!-- <exclude>**/*BuildERWithDeploymentTest.java</exclude>
+ <exclude>**/*EchoRawXMLTest.java</exclude>
+ <exclude>**/*HandlerFailureTest.java</exclude> -->
</excludes>
<includes>
<include>**/*Test.java</include>
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?rev=170925&r1=170924&r2=170925&view=diff
==============================================================================
--- 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 May 19 06:39:25 2005
@@ -18,7 +18,12 @@
//todo
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+
import junit.framework.TestCase;
+
import org.apache.axis.Constants;
import org.apache.axis.addressing.AddressingConstants;
import org.apache.axis.addressing.EndpointReference;
@@ -30,18 +35,14 @@
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
import org.apache.axis.om.OMNamespace;
-import org.apache.axis.soap.SOAPEnvelope;
import org.apache.axis.soap.SOAPFactory;
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;
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-
public class EchoRawXMLTest extends TestCase {
private EndpointReference targetEPR =
new EndpointReference(AddressingConstants.WSA_TO,
@@ -87,21 +88,19 @@
UtilServer.stop();
}
- private SOAPEnvelope createEnvelope(SOAPFactory fac) {
- SOAPEnvelope reqEnv = fac.getDefaultEnvelope();
+ private OMElement createEnvelope() {
+ 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, "Isaac Assimov, the foundation Sega"));
method.addChild(value);
- reqEnv.getBody().addChild(method);
- return reqEnv;
+
+ return method;
}
public void testEchoXMLASync() throws Exception {
- SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
-
- SOAPEnvelope reqEnv = createEnvelope(fac);
+ OMElement payload = createEnvelope();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
@@ -125,7 +124,7 @@
}
};
- call.invokeNonBlocking(operationName.getLocalPart(), reqEnv, callback);
+ call.invokeNonBlocking(operationName.getLocalPart(), payload, callback);
while (!finish) {
Thread.sleep(1000);
}
@@ -136,15 +135,15 @@
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- SOAPEnvelope reqEnv = createEnvelope(fac);
+ OMElement payload = createEnvelope();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
call.setTo(targetEPR);
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
- SOAPEnvelope result =
- (SOAPEnvelope) call.invokeBlocking(operationName.getLocalPart(), reqEnv);
+ OMElement result =
+ (OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
result.serializeWithCache(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out));
}
}
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?rev=170925&r1=170924&r2=170925&view=diff
==============================================================================
--- 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 May 19 06:39:25 2005
@@ -18,14 +18,18 @@
//todo
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamWriter;
+
import junit.framework.TestCase;
+
import org.apache.axis.Constants;
import org.apache.axis.addressing.AddressingConstants;
import org.apache.axis.addressing.EndpointReference;
import org.apache.axis.context.MessageContext;
import org.apache.axis.description.Flow;
import org.apache.axis.description.FlowImpl;
-import org.apache.axis.description.OperationDescription;
import org.apache.axis.description.ServiceDescription;
import org.apache.axis.handlers.AbstractHandler;
import org.apache.axis.integration.UtilServer;
@@ -33,16 +37,12 @@
import org.apache.axis.om.OMElement;
import org.apache.axis.om.OMNamespace;
import org.apache.axis.phaseresolver.PhaseMetadata;
-import org.apache.axis.soap.SOAPBody;
-import org.apache.axis.soap.SOAPEnvelope;
import org.apache.axis.soap.SOAPFactory;
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;
-import javax.xml.namespace.QName;
-
public class HandlerFailureTest extends TestCase {
private Log log = LogFactory.getLog(getClass());
@@ -98,40 +98,40 @@
}
}
- public void testFailureAtServerResponseFlow() throws Exception {
- ServiceDescription service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName(),operationName);
-
-
- Flow flow = new FlowImpl();
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- service.setInFlow(flow);
-
-
- flow = new FlowImpl();
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, culprit,PhaseMetadata.PHASE_POLICY_DETERMINATION);
- Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
- service.setInFlow(flow);
-
- OperationDescription operation = new OperationDescription(operationName);
- service.addOperation(operation);
-
- UtilServer.start();
- UtilServer.deployService(service);
- try {
- callTheService();
- } finally {
- UtilServer.unDeployService(serviceName);
- UtilServer.stop();
- }
- }
+// public void testFailureAtServerResponseFlow() throws Exception {
+// ServiceDescription service = Utils.createSimpleService(serviceName,org.apache.axis.engine.Echo.class.getName(),operationName);
+//
+//
+// Flow flow = new FlowImpl();
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// service.setInFlow(flow);
+//
+//
+// flow = new FlowImpl();
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, culprit,PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// Utils.addHandler(flow, new SpeakingHandler(),PhaseMetadata.PHASE_POLICY_DETERMINATION);
+// service.setInFlow(flow);
+//
+// OperationDescription operation = new OperationDescription(operationName);
+// service.addOperation(operation);
+//
+// UtilServer.start();
+// UtilServer.deployService(service);
+// try {
+// callTheService();
+// } finally {
+// UtilServer.unDeployService(serviceName);
+// UtilServer.stop();
+// }
+// }
protected void tearDown() throws Exception {
@@ -143,27 +143,21 @@
try {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- SOAPEnvelope reqEnv = fac.getDefaultEnvelope();
OMNamespace omNs = fac.createOMNamespace("http://localhost/my", "my");
OMElement method = fac.createOMElement("echoOMElement", omNs);
OMElement value = fac.createOMElement("myValue", omNs);
value.setText("Isaac Assimov, the foundation Sega");
method.addChild(value);
- reqEnv.getBody().addChild(method);
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
//EndpointReference targetEPR = new EndpointReference(AddressingConstants.WSA_TO, "http://127.0.0.1:" + Utils.TESTING_PORT + "/axis/services/EchoXMLService");
call.setTransportInfo(Constants.TRANSPORT_HTTP,Constants.TRANSPORT_HTTP,false);
call.setTo(targetEPR);
- SOAPEnvelope resEnv = (SOAPEnvelope)call.invokeBlocking(operationName.getLocalPart(),reqEnv);
-
- SOAPBody sb = resEnv.getBody();
-
- if (sb.hasFault()) {
- String message = sb.getFault().getException().getMessage();
- throw new AxisFault(message);
- }
+ OMElement result = call.invokeBlocking(operationName.getLocalPart(),method);
+ XMLStreamWriter xmlwriter = XMLOutputFactory.newInstance().createXMLStreamWriter(System.out);
+ result.serialize(xmlwriter);
+ xmlwriter.flush();
fail("the test must fail due to bad service Name");
} catch (AxisFault e) {
e.printStackTrace();