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/02/08 10:35:31 UTC
svn commit: r152653 - in webservices/axis/trunk/java/dev/scratch/prototype2:
./ src/java/org/apache/axis/encoding/ src/java/org/apache/axis/impl/llom/
src/java/org/apache/axis/impl/transport/http/
src/java/org/apache/axis/impl/transport/tcp/
src/java/org/apache/axis/transport/ src/samples/encoding/sample1/
src/samples/encoding/sample1/src/org/apache/axis/sample/echo/
src/test/org/apache/axis/ src/test/org/apache/axis/addressing/
src/test/org/apache/axis/clientapi/ src/test/org/apache/axis/deployment/
src/test/org/apache/axis/encoding/ src/test/org/apache/axis/engine/
src/test/org/apache/axis/integration/
Author: hemapani
Date: Tue Feb 8 01:35:25 2005
New Revision: 152653
URL: http://svn.apache.org/viewcvs?view=rev&rev=152653
Log:
add first integration test
Added:
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/EchoTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/UtilServer.java
Modified:
webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml
webservices/axis/trunk/java/dev/scratch/prototype2/project.xml
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/ArrayTypeEncoder.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMStAXWrapper.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/transport/AbstractTransportReceiver.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/build.xml
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoProvider.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStruct.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/AnyContentTypeTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/EndpointReferenceTypeTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadModuleTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServerXMLTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServiceXMLTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/Echo.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java
webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/maven.xml Tue Feb 8 01:35:25 2005
@@ -9,12 +9,13 @@
xmlns:ant="jelly:ant">
<preGoal name="test:test">
<j:jelly xmlns="jelly:ant">
- <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/general/sample1"/>
- <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/service1"/>
- <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/service2"/>
- <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/module1"/>
- <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/module2"/>
- </j:jelly>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/general/sample1"/>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/service1"/>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/service2"/>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/module1"/>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/deployment/module2"/>
+ <ant:ant antfile="build.xml" inheritall="true" inheritrefs="true" dir="src/samples/encoding/sample1"/>
+ </j:jelly>
<ant:copy file="${basedir}/src/test-resources/deployment/server.xml" tofile="${basedir}/target/test-resources/deployment/server.xml"/>
</preGoal>
<postGoal name="jar">
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/project.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/project.xml?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/project.xml (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/project.xml Tue Feb 8 01:35:25 2005
@@ -173,6 +173,7 @@
<directory>src/java</directory>
<includes>
<include>**/*.properties</include>
+ <include>**/*.xml</include>
</includes>
</resource>
</resources>
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/ArrayTypeEncoder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/ArrayTypeEncoder.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/ArrayTypeEncoder.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/encoding/ArrayTypeEncoder.java Tue Feb 8 01:35:25 2005
@@ -84,7 +84,7 @@
return null;
}
- event = xpp.next();
+// event = xpp.next();
while (true) {
if (XMLStreamConstants.START_ELEMENT == event) {
objs.add(arrayTypeEncoder.deSerialize(xpp));
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMElementImpl.java Tue Feb 8 01:35:25 2005
@@ -12,7 +12,6 @@
import org.apache.axis.impl.llom.traverse.OMChildrenIterator;
import org.apache.axis.impl.llom.traverse.OMChildrenQNameIterator;
import org.apache.axis.impl.llom.util.StreamWriterToContentHandlerConverter;
-import org.apache.axis.impl.utils.CollectionPool;
import org.apache.axis.om.OMAttribute;
import org.apache.axis.om.OMConstants;
import org.apache.axis.om.OMElement;
@@ -192,7 +191,7 @@
*/
public OMNamespace declareNamespace(OMNamespace namespace) {
if(namespaces == null){
- this.namespaces = CollectionPool.createHashMap(5);
+ this.namespaces = new HashMap(5);
}
namespaces.put(namespace.getPrefix(), namespace);
return namespace;
@@ -293,7 +292,7 @@
*/
public OMAttribute insertAttribute(OMAttribute attr) {
if(attributes == null){
- this.attributes = CollectionPool.createHashMap(5);
+ this.attributes = new HashMap(5);
}
attributes.put(attr.getQName(), attr);
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMStAXWrapper.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMStAXWrapper.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMStAXWrapper.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/llom/OMStAXWrapper.java Tue Feb 8 01:35:25 2005
@@ -655,7 +655,7 @@
throw new UnsupportedOperationException("incompatible parser found!");
}
log.info("Switching to the Real Stax parser to generated the future events");
- currentEvent = parser.next();
+ currentEvent = parser.getEventType();
updateCompleteStatus();
break;
case NAVIGABLE:
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/http/SimpleHTTPReceiver.java Tue Feb 8 01:35:25 2005
@@ -133,8 +133,8 @@
/**
* @param myAxisServer
*/
- public SimpleHTTPReceiver(AxisEngine myAxisServer) {
- super(myAxisServer);
+ public SimpleHTTPReceiver(EngineRegistry reg) {
+ super(reg);
}
public SimpleHTTPReceiver(String dir) throws AxisFault {
@@ -146,7 +146,7 @@
} catch (InterruptedException e1) {
throw new AxisFault("Thread interuptted",e1);
}
- this.engine = new AxisEngine(er);
+ this.engineReg = er;
} catch (PhaseException e) {
throw AxisFault.makeFault(e);
} catch (DeploymentException e) {
@@ -503,12 +503,7 @@
}
}
- /**
- * @return
- */
- public AxisEngine getEngine() {
- return engine;
- }
+
public static void main(String[] args) throws Exception{
if(args.length != 2){
@@ -529,7 +524,5 @@
reciver.stop();
}
-
}
-
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/impl/transport/tcp/TCPTransportReceiver.java Tue Feb 8 01:35:25 2005
@@ -38,8 +38,8 @@
*/
public class TCPTransportReceiver extends AbstractTransportReceiver {
- public TCPTransportReceiver(AxisEngine myAxisServer) {
- super(myAxisServer);
+ public TCPTransportReceiver(EngineRegistry reg) {
+ super(reg);
}
protected MessageContext parseTheTransport(AxisEngine engine,
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/transport/AbstractTransportReceiver.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/transport/AbstractTransportReceiver.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/transport/AbstractTransportReceiver.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/java/org/apache/axis/transport/AbstractTransportReceiver.java Tue Feb 8 01:35:25 2005
@@ -20,6 +20,7 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.engine.AxisEngine;
import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.EngineRegistry;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
@@ -42,7 +43,7 @@
public abstract class AbstractTransportReceiver implements Runnable {
protected Log log =
LogFactory.getLog(AbstractTransportReceiver.class.getName());
- protected AxisEngine engine = null;
+ protected EngineRegistry engineReg = null;
protected ServerSocket serverSocket;
protected Socket socket = null;
/**
@@ -52,8 +53,8 @@
private boolean stopped = false;
- public AbstractTransportReceiver(AxisEngine myAxisServer) {
- this.engine = myAxisServer;
+ public AbstractTransportReceiver(EngineRegistry reg) {
+ this.engineReg = reg;
}
@@ -88,12 +89,13 @@
break;
}
if (socket != null) {
- if(engine == null){
+ if(engineReg == null){
throw new AxisFault("Engine Must be null");
}
- MessageContext msgContext = parseTheTransport(engine, socket.getInputStream());
+ AxisEngine axisEngine = new AxisEngine(engineReg);
+ MessageContext msgContext = parseTheTransport(axisEngine, socket.getInputStream());
storeOutputInfo(msgContext, socket.getOutputStream());
- engine.receive(msgContext);
+ axisEngine.receive(msgContext);
this.socket.close();
this.socket = null;
}
@@ -177,4 +179,18 @@
protected abstract MessageContext parseTheTransport(AxisEngine engine, InputStream in) throws AxisFault;
protected abstract void storeOutputInfo(MessageContext msgctx, OutputStream out) throws AxisFault;
+ /**
+ * @param registry
+ */
+ public void setEngineReg(EngineRegistry registry) {
+ engineReg = registry;
+ }
+
+ /**
+ * @return
+ */
+ public EngineRegistry getEngineReg() {
+ return engineReg;
+ }
+
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/build.xml
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/build.xml?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/build.xml (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/build.xml Tue Feb 8 01:35:25 2005
@@ -6,7 +6,7 @@
<property name="build.lib" location="${build}/lib"/>
<property name="lib" location="lib"/>
<property name="root" location="../../../.."/>
- <property name="jar.dir" location="${root}/target/test-resources/samples/"/>
+ <property name="jar.dir" location="${root}/target/test-resources/samples/services"/>
<path id="axis.test.classpath">
<path refid="maven.dependency.classpath"></path>
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoProvider.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoProvider.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoProvider.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoProvider.java Tue Feb 8 01:35:25 2005
@@ -44,6 +44,14 @@
&& XMLStreamConstants.END_ELEMENT != event) {
event = xpp.next();
}
+ //now we are at the opearion element event
+ event = xpp.next();
+ while (XMLStreamConstants.START_ELEMENT != event
+ && XMLStreamConstants.END_ELEMENT != event) {
+ event = xpp.next();
+ }
+ // now we are at the parameter element event
+
if (XMLStreamConstants.END_ELEMENT == event) {
return null;
} else {
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStruct.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStruct.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStruct.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStruct.java Tue Feb 8 01:35:25 2005
@@ -7,7 +7,7 @@
package org.apache.axis.sample.echo;
-public class EchoStruct implements java.io.Serializable {
+public class EchoStruct implements java.io.Serializable {
private java.lang.String value1;
private java.lang.String value10;
private java.lang.String value11;
@@ -26,35 +26,34 @@
}
public EchoStruct(
- java.lang.String value1,
- java.lang.String value10,
- java.lang.String value11,
- java.lang.String value12,
- java.lang.String value13,
- java.lang.String value2,
- int value3,
- java.lang.String value4,
- java.lang.String value5,
- java.lang.String value6,
- java.lang.String value7,
- java.lang.String value8,
- java.lang.String value9) {
- this.value1 = value1;
- this.value10 = value10;
- this.value11 = value11;
- this.value12 = value12;
- this.value13 = value13;
- this.value2 = value2;
- this.value3 = value3;
- this.value4 = value4;
- this.value5 = value5;
- this.value6 = value6;
- this.value7 = value7;
- this.value8 = value8;
- this.value9 = value9;
+ java.lang.String value1,
+ java.lang.String value10,
+ java.lang.String value11,
+ java.lang.String value12,
+ java.lang.String value13,
+ java.lang.String value2,
+ int value3,
+ java.lang.String value4,
+ java.lang.String value5,
+ java.lang.String value6,
+ java.lang.String value7,
+ java.lang.String value8,
+ java.lang.String value9) {
+ this.value1 = value1;
+ this.value10 = value10;
+ this.value11 = value11;
+ this.value12 = value12;
+ this.value13 = value13;
+ this.value2 = value2;
+ this.value3 = value3;
+ this.value4 = value4;
+ this.value5 = value5;
+ this.value6 = value6;
+ this.value7 = value7;
+ this.value8 = value8;
+ this.value9 = value9;
}
-
/**
* Gets the value1 value for this EchoStruct.
*
@@ -64,7 +63,6 @@
return value1;
}
-
/**
* Sets the value1 value for this EchoStruct.
*
@@ -74,7 +72,6 @@
this.value1 = value1;
}
-
/**
* Gets the value10 value for this EchoStruct.
*
@@ -84,7 +81,6 @@
return value10;
}
-
/**
* Sets the value10 value for this EchoStruct.
*
@@ -94,7 +90,6 @@
this.value10 = value10;
}
-
/**
* Gets the value11 value for this EchoStruct.
*
@@ -104,7 +99,6 @@
return value11;
}
-
/**
* Sets the value11 value for this EchoStruct.
*
@@ -114,7 +108,6 @@
this.value11 = value11;
}
-
/**
* Gets the value12 value for this EchoStruct.
*
@@ -124,7 +117,6 @@
return value12;
}
-
/**
* Sets the value12 value for this EchoStruct.
*
@@ -134,7 +126,6 @@
this.value12 = value12;
}
-
/**
* Gets the value13 value for this EchoStruct.
*
@@ -144,7 +135,6 @@
return value13;
}
-
/**
* Sets the value13 value for this EchoStruct.
*
@@ -154,7 +144,6 @@
this.value13 = value13;
}
-
/**
* Gets the value2 value for this EchoStruct.
*
@@ -164,7 +153,6 @@
return value2;
}
-
/**
* Sets the value2 value for this EchoStruct.
*
@@ -174,7 +162,6 @@
this.value2 = value2;
}
-
/**
* Gets the value3 value for this EchoStruct.
*
@@ -184,7 +171,6 @@
return value3;
}
-
/**
* Sets the value3 value for this EchoStruct.
*
@@ -194,7 +180,6 @@
this.value3 = value3;
}
-
/**
* Gets the value4 value for this EchoStruct.
*
@@ -204,7 +189,6 @@
return value4;
}
-
/**
* Sets the value4 value for this EchoStruct.
*
@@ -214,7 +198,6 @@
this.value4 = value4;
}
-
/**
* Gets the value5 value for this EchoStruct.
*
@@ -224,7 +207,6 @@
return value5;
}
-
/**
* Sets the value5 value for this EchoStruct.
*
@@ -234,7 +216,6 @@
this.value5 = value5;
}
-
/**
* Gets the value6 value for this EchoStruct.
*
@@ -244,7 +225,6 @@
return value6;
}
-
/**
* Sets the value6 value for this EchoStruct.
*
@@ -254,7 +234,6 @@
this.value6 = value6;
}
-
/**
* Gets the value7 value for this EchoStruct.
*
@@ -264,7 +243,6 @@
return value7;
}
-
/**
* Sets the value7 value for this EchoStruct.
*
@@ -274,7 +252,6 @@
this.value7 = value7;
}
-
/**
* Gets the value8 value for this EchoStruct.
*
@@ -284,7 +261,6 @@
return value8;
}
-
/**
* Sets the value8 value for this EchoStruct.
*
@@ -294,7 +270,6 @@
this.value8 = value8;
}
-
/**
* Gets the value9 value for this EchoStruct.
*
@@ -304,7 +279,6 @@
return value9;
}
-
/**
* Sets the value9 value for this EchoStruct.
*
@@ -314,4 +288,32 @@
this.value9 = value9;
}
+ /* (non-Javadoc)
+ * @see java.lang.Object#equals(java.lang.Object)
+ */
+ public boolean equals(Object obj) {
+ if (obj instanceof EchoStruct) {
+ EchoStruct val = (EchoStruct) obj;
+ if (value1.equals(val.value1)
+ && value2.equals(val.value2)
+ && (value3 == val.value3)
+ && value4.equals(val.value4)
+ && value5.equals(val.value5)
+ && value6.equals(val.value6)
+ && value7.equals(val.value7)
+ && value8.equals(val.value8)
+ && value9.equals(val.value9)
+ && value10.equals(val.value10)
+ && value11.equals(val.value11)
+ && value12.equals(val.value12)
+ && value13.equals(val.value13)) {
+ return true;
+
+
+ }
+
+ }
+ return false;
+
}
+}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/samples/encoding/sample1/src/org/apache/axis/sample/echo/EchoStructEncoder.java Tue Feb 8 01:35:25 2005
@@ -38,6 +38,10 @@
private ContentHandler contentHandler;
private EchoStruct struct;
+
+
+ public EchoStructEncoder() {
+ }
public EchoStructEncoder(EchoStruct struct) {
this.struct = struct;
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/AbstractTestCase.java Tue Feb 8 01:35:25 2005
@@ -16,9 +16,9 @@
package org.apache.axis;
-import junit.framework.TestCase;
-
import java.io.File;
+
+import junit.framework.TestCase;
/**
* Abstract base class for test cases.
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/AnyContentTypeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/AnyContentTypeTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/AnyContentTypeTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/AnyContentTypeTest.java Tue Feb 8 01:35:25 2005
@@ -19,9 +19,9 @@
*/
package org.apache.axis.addressing;
-import junit.framework.TestCase;
-
import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
public class AnyContentTypeTest extends TestCase {
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/EndpointReferenceTypeTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/EndpointReferenceTypeTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/EndpointReferenceTypeTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/addressing/EndpointReferenceTypeTest.java Tue Feb 8 01:35:25 2005
@@ -19,9 +19,9 @@
*/
package org.apache.axis.addressing;
-import junit.framework.TestCase;
-
import javax.xml.namespace.QName;
+
+import junit.framework.TestCase;
public class EndpointReferenceTypeTest extends TestCase {
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceive.java Tue Feb 8 01:35:25 2005
@@ -10,6 +10,12 @@
*/
package org.apache.axis.clientapi;
+import java.io.FileReader;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+
import org.apache.axis.AbstractTestCase;
import org.apache.axis.addressing.AddressingConstants;
import org.apache.axis.addressing.EndpointReference;
@@ -26,11 +32,6 @@
import org.apache.axis.om.SOAPEnvelope;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import java.io.FileReader;
public class TestSendReceive extends AbstractTestCase {
private Log log = LogFactory.getLog(getClass());
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/clientapi/TestSendReceiveAsync.java Tue Feb 8 01:35:25 2005
@@ -6,6 +6,13 @@
*/
package org.apache.axis.clientapi;
+import java.io.FileReader;
+
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLInputFactory;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+
import org.apache.axis.AbstractTestCase;
import org.apache.axis.addressing.AddressingConstants;
import org.apache.axis.addressing.EndpointReference;
@@ -22,12 +29,6 @@
import org.apache.axis.om.SOAPEnvelope;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLInputFactory;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import java.io.FileReader;
/**
* @author Jaliya
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadModuleTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadModuleTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadModuleTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadModuleTest.java Tue Feb 8 01:35:25 2005
@@ -1,11 +1,11 @@
package org.apache.axis.deployment;
-import org.apache.axis.AbstractTestCase;
-import org.apache.axis.description.AxisGlobal;
-
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.description.AxisGlobal;
/**
* Copyright 2001-2004 The Apache Software Foundation.
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServerXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServerXMLTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServerXMLTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServerXMLTest.java Tue Feb 8 01:35:25 2005
@@ -1,11 +1,11 @@
package org.apache.axis.deployment;
-import org.apache.axis.AbstractTestCase;
-import org.apache.axis.description.AxisGlobal;
-
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.description.AxisGlobal;
/**
* Copyright 2001-2004 The Apache Software Foundation.
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServiceXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServiceXMLTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServiceXMLTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BadServiceXMLTest.java Tue Feb 8 01:35:25 2005
@@ -1,11 +1,11 @@
package org.apache.axis.deployment;
-import org.apache.axis.AbstractTestCase;
-import org.apache.axis.impl.description.AxisService;
-
import java.io.FileInputStream;
import java.io.FileNotFoundException;
import java.io.InputStream;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.impl.description.AxisService;
/**
* Copyright 2001-2004 The Apache Software Foundation.
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/BuildERWithDeploymentTest.java Tue Feb 8 01:35:25 2005
@@ -15,6 +15,8 @@
*/
package org.apache.axis.deployment;
+import javax.xml.namespace.QName;
+
import org.apache.axis.AbstractTestCase;
import org.apache.axis.description.AxisOperation;
import org.apache.axis.description.Flow;
@@ -22,8 +24,6 @@
import org.apache.axis.engine.Provider;
import org.apache.axis.impl.description.AxisService;
import org.apache.axis.impl.providers.RawXMLProvider;
-
-import javax.xml.namespace.QName;
public class BuildERWithDeploymentTest extends AbstractTestCase{
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/deployment/DeploymentotalTest.java Tue Feb 8 01:35:25 2005
@@ -1,11 +1,12 @@
package org.apache.axis.deployment;
+import javax.xml.stream.XMLStreamException;
+
import junit.framework.TestCase;
+
import org.apache.axis.engine.AxisFault;
import org.apache.axis.engine.EngineRegistry;
import org.apache.axis.phaseresolver.PhaseException;
-
-import javax.xml.stream.XMLStreamException;
/**
* Copyright 2001-2004 The Apache Software Foundation.
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/encoding/EncodingTest.java Tue Feb 8 01:35:25 2005
@@ -15,19 +15,18 @@
*/
package org.apache.axis.encoding;
-import org.apache.axis.AbstractTestCase;
-import org.apache.axis.context.MessageContext;
-import org.apache.axis.engine.AxisFault;
-import org.apache.axis.impl.providers.SimpleJavaProvider;
-import org.apache.axis.om.OMElement;
-import org.apache.axis.om.OMFactory;
-import org.apache.axis.om.OMNamespace;
+import java.lang.reflect.Method;
import javax.xml.stream.FactoryConfigurationError;
import javax.xml.stream.XMLOutputFactory;
import javax.xml.stream.XMLStreamException;
import javax.xml.stream.XMLStreamReader;
-import java.lang.reflect.Method;
+
+import org.apache.axis.AbstractTestCase;
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
public class EncodingTest extends AbstractTestCase {
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/CallUnregisterdServiceTest.java Tue Feb 8 01:35:25 2005
@@ -16,23 +16,25 @@
package org.apache.axis.engine;
//todo
+import javax.xml.namespace.QName;
+
import org.apache.axis.AbstractTestCase;
-import org.apache.axis.clientapi.Call;
-import org.apache.axis.addressing.EndpointReference;
import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.Call;
import org.apache.axis.context.MessageContext;
import org.apache.axis.description.AxisOperation;
import org.apache.axis.impl.description.AxisService;
import org.apache.axis.impl.description.SimpleAxisOperationImpl;
import org.apache.axis.impl.providers.RawXMLProvider;
import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
-import org.apache.axis.om.*;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.SOAPBody;
+import org.apache.axis.om.SOAPEnvelope;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import java.net.URL;
public class CallUnregisterdServiceTest extends AbstractTestCase{
private Log log = LogFactory.getLog(getClass());
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/Echo.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/Echo.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/Echo.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/Echo.java Tue Feb 8 01:35:25 2005
@@ -24,6 +24,11 @@
public class Echo{
public Echo(){}
+ public void echoVoid(){
+ System.out.println("echo Service Called");
+ }
+
+
public OMElement echoOMElement(OMElement omEle){
omEle.setLocalName(omEle.getLocalName()+"Response");
return omEle;
@@ -36,4 +41,5 @@
public int echoInt(int in){
return in;
}
+
}
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EchoRawXMLTest.java Tue Feb 8 01:35:25 2005
@@ -16,25 +16,28 @@
package org.apache.axis.engine;
//todo
+import javax.xml.namespace.QName;
+import javax.xml.stream.XMLOutputFactory;
+import javax.xml.stream.XMLStreamException;
+
import org.apache.axis.AbstractTestCase;
-import org.apache.axis.clientapi.Callback;
-import org.apache.axis.clientapi.AsyncResult;
-import org.apache.axis.addressing.EndpointReference;
import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.AsyncResult;
+import org.apache.axis.clientapi.Callback;
import org.apache.axis.context.MessageContext;
import org.apache.axis.description.AxisOperation;
import org.apache.axis.impl.description.AxisService;
import org.apache.axis.impl.description.SimpleAxisOperationImpl;
import org.apache.axis.impl.providers.RawXMLProvider;
import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
-import org.apache.axis.om.*;
+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.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
-
-import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
-import java.net.URL;
public class EchoRawXMLTest extends AbstractTestCase{
private Log log = LogFactory.getLog(getClass());
Modified: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java?view=diff&r1=152652&r2=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java (original)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/engine/EngineUtils.java Tue Feb 8 01:35:25 2005
@@ -42,7 +42,6 @@
}
public static synchronized SimpleHTTPReceiver startServer(EngineRegistry engineRegistry) throws IOException{
- AxisEngine engine = new AxisEngine(engineRegistry);
ServerSocket serverSoc = null;
if(sas == null){
}else{
@@ -55,7 +54,7 @@
}
}
serverSoc = new ServerSocket(TESTING_PORT);
- sas = new SimpleHTTPReceiver(engine);
+ sas = new SimpleHTTPReceiver(engineRegistry);
sas.setServerSocket(serverSoc);
Thread thisThread = new Thread(sas);
@@ -97,7 +96,7 @@
service.setOutFlow(new MockFlow("service outflow",5));
service.setFaultFlow(new MockFlow("service faultflow",1));
service.setClassLoader(Thread.currentThread().getContextClassLoader());
- service.setServiceClass(EchoService.class);
+ service.setServiceClass(Echo.class);
service.setProvider(new SimpleJavaProvider());
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/EchoTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/EchoTest.java?view=auto&rev=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/EchoTest.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/EchoTest.java Tue Feb 8 01:35:25 2005
@@ -0,0 +1,340 @@
+/*
+ * Copyright 2003,2004 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.axis.integration;
+
+import java.io.File;
+import java.lang.reflect.Constructor;
+import java.lang.reflect.Method;
+import java.net.MalformedURLException;
+import java.net.URL;
+import java.net.URLClassLoader;
+
+import javax.xml.stream.XMLStreamConstants;
+import javax.xml.stream.XMLStreamReader;
+
+import junit.framework.TestCase;
+
+import org.apache.axis.addressing.AddressingConstants;
+import org.apache.axis.addressing.EndpointReference;
+import org.apache.axis.clientapi.Call;
+import org.apache.axis.encoding.ArrayTypeEncoder;
+import org.apache.axis.encoding.Encoder;
+import org.apache.axis.encoding.SimpleTypeEncoder;
+import org.apache.axis.encoding.SimpleTypeEncodingUtils;
+import org.apache.axis.engine.EngineUtils;
+import org.apache.axis.impl.llom.builder.ObjectToOMBuilder;
+import org.apache.axis.om.OMConstants;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
+import org.apache.axis.om.SOAPEnvelope;
+
+
+public class EchoTest extends TestCase {
+ private final OMFactory fac = OMFactory.newInstance();
+ private final OMNamespace ns =
+ fac.createOMNamespace("http://apache.ws.apache.org/samples", "samples");
+ private final OMNamespace arrayNs =
+ fac.createOMNamespace(
+ OMConstants.ARRAY_ITEM_NSURI,
+ OMConstants.ARRAY_ITEM_NS_PREFIX);
+ private final OMNamespace targetNs =
+ fac.createOMNamespace("http://axis.apache.org", "s");
+ private final URLClassLoader cl;
+
+ public EchoTest() throws MalformedURLException {
+ cl = new URLClassLoader(
+ new URL[] {
+ new File("target/test-resources/samples/services/echo.jar")
+ .toURL()},EchoTest.class.getClassLoader());
+ }
+
+ public EchoTest(String arg0) throws MalformedURLException {
+ super(arg0);
+ cl = new URLClassLoader(
+ new URL[] {
+ new File("target/test-resources/samples/services/echo.jar")
+ .toURL()},EchoTest.class.getClassLoader());
+
+ }
+
+ private SOAPEnvelope createRawMessage(
+ String method,
+ OMElement parameters) {
+ SOAPEnvelope envelope = fac.getDefaultEnvelope();
+
+ OMElement responseMethodName = fac.createOMElement(method, ns);
+ envelope.getBody().addChild(responseMethodName);
+ responseMethodName.addChild(parameters);
+ return envelope;
+
+ }
+
+ private XMLStreamReader invokeTheService(SOAPEnvelope envelope)
+ throws Exception {
+ EndpointReference targetEPR =
+ new EndpointReference(
+ AddressingConstants.WSA_TO,
+ "http://127.0.0.1:"
+ + (EngineUtils.TESTING_PORT)
+ + "/axis/services/echo");
+ Call call = new Call();
+ call.setTo(targetEPR);
+ SOAPEnvelope responseEnv = call.sendReceive(envelope);
+ XMLStreamReader xpp = responseEnv.getBody().getPullParser(true);
+
+ int event = xpp.next();
+ while (event != XMLStreamConstants.START_ELEMENT) {
+ event = xpp.next();
+ }
+ event = xpp.next();
+ while (event != XMLStreamConstants.START_ELEMENT) {
+ event = xpp.next();
+ }
+ event = xpp.next();
+ while (event != XMLStreamConstants.START_ELEMENT) {
+ event = xpp.next();
+ }
+ return xpp;
+ }
+
+ public void testEchoString() throws Exception {
+ String message = "Hello testing";
+
+ OMElement returnelement = fac.createOMElement("param1", ns);
+ returnelement.setBuilder(
+ new ObjectToOMBuilder(
+ returnelement,
+ new SimpleTypeEncoder(message)));
+ returnelement.declareNamespace(arrayNs);
+ SOAPEnvelope envelope = createRawMessage("echoString", returnelement);
+ XMLStreamReader xpp = invokeTheService(envelope);
+ String value = SimpleTypeEncodingUtils.deserializeString(xpp);
+ assertEquals(value, message);
+ }
+
+ public void testEchoStringArray() throws Exception {
+ String[] messages =
+ new String[] {
+ "Hello testing1",
+ "Hello testing2",
+ "Hello testing3",
+ "Hello testing4",
+ "Hello testing5" };
+ OMElement returnelement = fac.createOMElement("param1", ns);
+
+ ObjectToOMBuilder builder =
+ new ObjectToOMBuilder(
+ returnelement,
+ new ArrayTypeEncoder(messages, new SimpleTypeEncoder(null)));
+
+ returnelement.setBuilder(builder);
+ returnelement.declareNamespace(arrayNs);
+ SOAPEnvelope envelope = createRawMessage("echoStringArray", returnelement);
+
+ XMLStreamReader xpp = invokeTheService(envelope);
+ String[] values = SimpleTypeEncodingUtils.deserializeStringArray(xpp);
+ for (int i = 0; i < values.length; i++) {
+ assertEquals(values[i], messages[i]);
+ }
+ }
+
+ public void testEchoStruct() throws Exception {
+ String[] messages =
+ new String[] {
+ "Hello testing1",
+ "Hello testing2",
+ "Hello testing3",
+ "Hello testing4",
+ "Hello testing5" };
+ Class clasname =
+ Class.forName("org.apache.axis.sample.echo.EchoStruct", true, cl);
+ Object obj = clasname.newInstance();
+
+ Method method1 =
+ clasname.getMethod("setValue1", new Class[] { String.class });
+ method1.invoke(obj, new Object[] { "Ruy Lopez" });
+ Method method2 =
+ clasname.getMethod("setValue2", new Class[] { String.class });
+ method2.invoke(obj, new Object[] { "Kings Gambit" });
+ Method method3 =
+ clasname.getMethod("setValue3", new Class[] { int.class });
+ method3.invoke(obj, new Object[] { new Integer(345)});
+ Method method4 =
+ clasname.getMethod("setValue4", new Class[] { String.class });
+ method4.invoke(obj, new Object[] { "Kings Indian Defence" });
+ Method method5 =
+ clasname.getMethod("setValue5", new Class[] { String.class });
+ method5.invoke(obj, new Object[] { "Musio Gambit" });
+ Method method6 =
+ clasname.getMethod("setValue6", new Class[] { String.class });
+ method6.invoke(obj, new Object[] { "Benko Gambit" });
+ Method method7 =
+ clasname.getMethod("setValue7", new Class[] { String.class });
+ method7.invoke(obj, new Object[] { "Secillian Defance" });
+ Method method8 =
+ clasname.getMethod("setValue8", new Class[] { String.class });
+ method8.invoke(obj, new Object[] { "Queens Gambit" });
+ Method method9 =
+ clasname.getMethod("setValue9", new Class[] { String.class });
+ method9.invoke(obj, new Object[] { "Queens Indian Defense" });
+ Method method10 =
+ clasname.getMethod("setValue10", new Class[] { String.class });
+ method10.invoke(obj, new Object[] { "Alekine's Defense" });
+ Method method11 =
+ clasname.getMethod("setValue11", new Class[] { String.class });
+ method11.invoke(obj, new Object[] { "Perc Defense" });
+ Method method12 =
+ clasname.getMethod("setValue12", new Class[] { String.class });
+ method12.invoke(obj, new Object[] { "Scotch Gambit" });
+ Method method13 =
+ clasname.getMethod("setValue13", new Class[] { String.class });
+ method13.invoke(obj, new Object[] { "English Opening" });
+
+ OMElement returnelement = fac.createOMElement("param1", ns);
+
+ Class encoderClass =
+ Class.forName(
+ "org.apache.axis.sample.echo.EchoStructEncoder",
+ true,
+ cl);
+ Constructor constCt =
+ encoderClass.getConstructor(new Class[] { clasname });
+ Object obj1 = constCt.newInstance(new Object[] { obj });
+
+ ObjectToOMBuilder builder =
+ new ObjectToOMBuilder(returnelement, (Encoder) obj1);
+
+ returnelement.setBuilder(builder);
+ returnelement.declareNamespace(
+ OMConstants.ARRAY_ITEM_NSURI,
+ OMConstants.ARRAY_ITEM_NS_PREFIX);
+ returnelement.declareNamespace(targetNs);
+
+ SOAPEnvelope envelope =
+ createRawMessage("echoEchoStruct", returnelement);
+
+ XMLStreamReader xpp = invokeTheService(envelope);
+
+ Method deserializeMethod =
+ encoderClass.getMethod(
+ "deSerialize",
+ new Class[] { XMLStreamReader.class });
+ Object result = deserializeMethod.invoke(obj1, new Object[] { xpp });
+ assertTrue(result.equals(obj));
+ }
+
+ public void testEchoStructArray() throws Exception {
+ Object[] objs = new Object[10];
+ Class clasname =
+ Class.forName("org.apache.axis.sample.echo.EchoStruct", true, cl);
+
+ for (int i = 0; i < objs.length; i++) {
+
+ objs[i] = clasname.newInstance();
+ Method method1 =
+ clasname.getMethod("setValue1", new Class[] { String.class });
+ method1.invoke(objs[i], new Object[] { "Ruy Lopez" });
+ Method method2 =
+ clasname.getMethod("setValue2", new Class[] { String.class });
+ method2.invoke(objs[i], new Object[] { "Kings Gambit" });
+ Method method3 =
+ clasname.getMethod("setValue3", new Class[] { int.class });
+ method3.invoke(objs[i], new Object[] { new Integer(345)});
+ Method method4 =
+ clasname.getMethod("setValue4", new Class[] { String.class });
+ method4.invoke(objs[i], new Object[] { "Kings Indian Defence" });
+ Method method5 =
+ clasname.getMethod("setValue5", new Class[] { String.class });
+ method5.invoke(objs[i], new Object[] { "Musio Gambit" });
+ Method method6 =
+ clasname.getMethod("setValue6", new Class[] { String.class });
+ method6.invoke(objs[i], new Object[] { "Benko Gambit" });
+ Method method7 =
+ clasname.getMethod("setValue7", new Class[] { String.class });
+ method7.invoke(objs[i], new Object[] { "Secillian Defance" });
+ Method method8 =
+ clasname.getMethod("setValue8", new Class[] { String.class });
+ method8.invoke(objs[i], new Object[] { "Queens Gambit" });
+ Method method9 =
+ clasname.getMethod("setValue9", new Class[] { String.class });
+ method9.invoke(objs[i], new Object[] { "Queens Indian Defense" });
+ Method method10 =
+ clasname.getMethod("setValue10", new Class[] { String.class });
+ method10.invoke(objs[i], new Object[] { "Alekine's Defense" });
+ Method method11 =
+ clasname.getMethod("setValue11", new Class[] { String.class });
+ method11.invoke(objs[i], new Object[] { "Perc Defense" });
+ Method method12 =
+ clasname.getMethod("setValue12", new Class[] { String.class });
+ method12.invoke(objs[i], new Object[] { "Scotch Gambit" });
+ Method method13 =
+ clasname.getMethod("setValue13", new Class[] { String.class });
+ method13.invoke(objs[i], new Object[] { "English Opening" });
+ }
+
+ OMElement returnelement = fac.createOMElement("param1", ns);
+
+ Class encoderClass =
+ Class.forName(
+ "org.apache.axis.sample.echo.EchoStructEncoder",
+ true,
+ cl);
+ Constructor constCt =
+ encoderClass.getConstructor(new Class[] { clasname });
+ Object obj1 = constCt.newInstance(new Object[] { null });
+
+ ObjectToOMBuilder builder =
+ new ObjectToOMBuilder(
+ returnelement,
+ new ArrayTypeEncoder(objs, (Encoder) obj1));
+
+ returnelement.setBuilder(builder);
+ returnelement.declareNamespace(arrayNs);
+ returnelement.declareNamespace(targetNs);
+
+ SOAPEnvelope envelope =
+ createRawMessage("echoEchoStructArray", returnelement);
+
+ XMLStreamReader xpp = invokeTheService(envelope);
+
+ Encoder enc = new ArrayTypeEncoder(objs, (Encoder) obj1);
+
+ Method deserializeMethod =
+ encoderClass.getMethod(
+ "deSerialize",
+ new Class[] { XMLStreamReader.class });
+ Object obj = enc.deSerialize(xpp);
+ Object[] structs = (Object[])obj;
+
+ for (int i = 0; i < structs.length; i++) {
+ assertTrue(structs[i].equals(objs[i]));
+
+ }
+
+
+
+ }
+
+ protected void setUp() throws Exception {
+ UtilServer.start();
+ }
+
+ protected void tearDown() throws Exception {
+ UtilServer.stop();
+ }
+}
Added: webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/UtilServer.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/UtilServer.java?view=auto&rev=152653
==============================================================================
--- webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/UtilServer.java (added)
+++ webservices/axis/trunk/java/dev/scratch/prototype2/src/test/org/apache/axis/integration/UtilServer.java Tue Feb 8 01:35:25 2005
@@ -0,0 +1,63 @@
+/*
+ * Copyright 2003,2004 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.axis.integration;
+
+import java.io.IOException;
+import java.net.ServerSocket;
+
+import org.apache.axis.engine.AxisFault;
+import org.apache.axis.engine.EngineUtils;
+import org.apache.axis.impl.description.AxisService;
+import org.apache.axis.impl.transport.http.SimpleHTTPReceiver;
+
+public class UtilServer {
+ private static int count = 0;
+ private static SimpleHTTPReceiver reciver;
+
+ public static synchronized void deployService(AxisService service)
+ throws AxisFault {
+ reciver.getEngineReg().addService(service);
+ }
+
+ public static synchronized void start() throws IOException {
+ if (count == 0) {
+ reciver = new SimpleHTTPReceiver("target/test-resources/samples/");
+
+ ServerSocket serverSoc = null;
+ serverSoc = new ServerSocket(EngineUtils.TESTING_PORT);
+ reciver.setServerSocket(serverSoc);
+ Thread thread = new Thread(reciver);
+ thread.setDaemon(true);
+
+ try {
+ thread.start();
+ } finally {
+
+ }
+ } else {
+ count++;
+ }
+ }
+
+ public static synchronized void stop() {
+ if (count == 1) {
+ reciver.stop();
+ } else {
+ count--;
+ }
+ }
+}