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/06/29 09:38:29 UTC
svn commit: r202329 - in
/webservices/axis/trunk/java/modules/samples/test/org/apache/axis: engine/
integration/
Author: hemapani
Date: Wed Jun 29 00:38:29 2005
New Revision: 202329
URL: http://svn.apache.org/viewcvs?rev=202329&view=rev
Log:
update the test cases to do assert on the result
Added:
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/TestingUtils.java
Modified:
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLChunckedTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLLoadTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsSyncTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MailEchoRawXMLTest.java
webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/OneWayRawXMLTest.java
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java?rev=202329&r1=202328&r2=202329&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/CommonsHTTPEchoRawXMLTest.java Wed Jun 29 00:38:29 2005
@@ -19,8 +19,6 @@
//todo
import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
import junit.framework.TestCase;
@@ -32,12 +30,10 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
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.om.OMOutput;
import org.apache.axis.soap.SOAPFactory;
import org.apache.axis.util.Utils;
import org.apache.commons.logging.Log;
@@ -88,19 +84,8 @@
UtilServer.stop();
}
- 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);
-
- return method;
- }
-
public void testEchoXMLASync() throws Exception {
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call(Constants.TESTING_PATH+"commons-http-enabledRepository");
@@ -109,13 +94,8 @@
Callback callback = new Callback() {
public void onComplete(AsyncResult result) {
- try {
- result.getResponseEnvelope().serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
- } catch (XMLStreamException e) {
- reportError(e);
- } finally {
- finish = true;
- }
+ TestingUtils.campareWithCreatedOMElement(result.getResponseEnvelope().getBody().getFirstElement());
+ finish = true;
}
public void reportError(Exception e) {
@@ -142,7 +122,7 @@
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call(Constants.TESTING_PATH+"commons-http-enabledRepository");
@@ -151,7 +131,7 @@
OMElement result =
(OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ TestingUtils.campareWithCreatedOMElement(result);
call.close();
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java?rev=202329&r1=202328&r2=202329&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawMTOMTest.java Wed Jun 29 00:38:29 2005
@@ -31,6 +31,7 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
@@ -99,6 +100,7 @@
data.addChild(textData);
return data;
}
+
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLChunckedTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLChunckedTest.java?rev=202329&r1=202328&r2=202329&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLChunckedTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLChunckedTest.java Wed Jun 29 00:38:29 2005
@@ -29,6 +29,7 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
@@ -86,16 +87,6 @@
UtilServer.stop();
}
- 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);
-
- return method;
- }
// public void testEchoXMLASync() throws Exception {
// OMElement payload = createEnvelope();
@@ -140,7 +131,7 @@
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call(Constants.TESTING_PATH + "chuncked-enabledRepository");
@@ -149,7 +140,7 @@
OMElement result =
(OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ TestingUtils.campareWithCreatedOMElement(result);
call.close();
}
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLLoadTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLLoadTest.java?rev=202329&r1=202328&r2=202329&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLLoadTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLLoadTest.java Wed Jun 29 00:38:29 2005
@@ -29,6 +29,7 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
@@ -85,16 +86,7 @@
UtilServer.stop();
}
- 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);
-
- return method;
- }
+
// public void testEchoXMLASync() throws Exception {
// OMElement payload = createEnvelope();
@@ -138,7 +130,7 @@
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
@@ -151,7 +143,7 @@
OMElement result1 =
(OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ TestingUtils.campareWithCreatedOMElement(result);
call.close();
}
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsSyncTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsSyncTest.java?rev=202329&r1=202328&r2=202329&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsSyncTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsSyncTest.java Wed Jun 29 00:38:29 2005
@@ -27,6 +27,7 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
@@ -86,16 +87,7 @@
UtilServer.stop();
}
- private SOAPEnvelope createEnvelope(SOAPFactory fac) {
- 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.addChild(fac.createText(value, "Isaac Assimov, the foundation Sega"));
- method.addChild(value);
- reqEnv.getBody().addChild(method);
- return reqEnv;
- }
+
public void testEchoXMLCompleteSync() throws Exception {
ServiceDescription service =
@@ -120,7 +112,7 @@
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, true);
OMElement result = (OMElement) call.invokeBlocking(operationName.getLocalPart(), method);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ TestingUtils.campareWithCreatedOMElement(result);
call.close();
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsTest.java?rev=202329&r1=202328&r2=202329&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/EchoRawXMLOnTwoChannelsTest.java Wed Jun 29 00:38:29 2005
@@ -30,6 +30,7 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
@@ -92,16 +93,7 @@
UtilServer.stop();
}
- private SOAPEnvelope createEnvelope(SOAPFactory fac) {
- 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.addChild(fac.createText(value, "Isaac Assimov, the foundation Sega"));
- method.addChild(value);
- reqEnv.getBody().addChild(method);
- return reqEnv;
- }
+
public void testEchoXMLCompleteASync() throws Exception {
ServiceDescription service =
@@ -128,14 +120,8 @@
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, true);
Callback callback = new Callback() {
public void onComplete(AsyncResult result) {
- try {
- result.getResponseEnvelope().serialize(
- new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
- } catch (XMLStreamException e) {
- reportError(e);
- } finally {
- finish = true;
- }
+ TestingUtils.campareWithCreatedOMElement(result.getResponseEnvelope().getBody().getFirstElement());
+ finish = true;
}
public void reportError(Exception e) {
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=202329&r1=202328&r2=202329&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 Wed Jun 29 00:38:29 2005
@@ -19,8 +19,6 @@
//todo
import javax.xml.namespace.QName;
-import javax.xml.stream.XMLOutputFactory;
-import javax.xml.stream.XMLStreamException;
import junit.framework.TestCase;
@@ -32,12 +30,10 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
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.om.OMOutput;
import org.apache.axis.soap.SOAPFactory;
import org.apache.axis.util.Utils;
import org.apache.commons.logging.Log;
@@ -88,19 +84,9 @@
UtilServer.stop();
}
- 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);
-
- return method;
- }
public void testEchoXMLASync() throws Exception {
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
@@ -109,13 +95,8 @@
Callback callback = new Callback() {
public void onComplete(AsyncResult result) {
- try {
- result.getResponseEnvelope().serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
- } catch (XMLStreamException e) {
- reportError(e);
- } finally {
- finish = true;
- }
+ TestingUtils.campareWithCreatedOMElement(result.getResponseEnvelope().getBody().getFirstElement());
+ finish = true;
}
public void reportError(Exception e) {
@@ -142,7 +123,7 @@
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
@@ -151,22 +132,21 @@
OMElement result =
(OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ TestingUtils.campareWithCreatedOMElement(result);
call.close();
}
public void testCorrectSOAPEnvelope() throws Exception {
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
call.setTo(targetEPR);
call.setTransportInfo(Constants.TRANSPORT_HTTP, Constants.TRANSPORT_HTTP, false);
- OMElement result =
- (OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ OMElement result = (OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
+ TestingUtils.campareWithCreatedOMElement(result);
call.close();
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MailEchoRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MailEchoRawXMLTest.java?rev=202329&r1=202328&r2=202329&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MailEchoRawXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/MailEchoRawXMLTest.java Wed Jun 29 00:38:29 2005
@@ -29,6 +29,7 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.context.ServiceContext;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
@@ -84,17 +85,7 @@
UtilServer.stop();
}
- 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);
-
- return method;
- }
-
+
// public void testEchoXMLASync() throws Exception {
// OMElement payload = createEnvelope();
//
@@ -137,7 +128,7 @@
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
org.apache.axis.clientapi.Call call = new org.apache.axis.clientapi.Call();
@@ -146,7 +137,7 @@
OMElement result =
(OMElement) call.invokeBlocking(operationName.getLocalPart(), payload);
- result.serializeWithCache(new OMOutput(XMLOutputFactory.newInstance().createXMLStreamWriter(System.out)));
+ TestingUtils.campareWithCreatedOMElement(result);
call.close();
}
Modified: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/OneWayRawXMLTest.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/OneWayRawXMLTest.java?rev=202329&r1=202328&r2=202329&view=diff
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/OneWayRawXMLTest.java (original)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/engine/OneWayRawXMLTest.java Wed Jun 29 00:38:29 2005
@@ -29,6 +29,7 @@
import org.apache.axis.context.MessageContext;
import org.apache.axis.description.OperationDescription;
import org.apache.axis.description.ServiceDescription;
+import org.apache.axis.integration.TestingUtils;
import org.apache.axis.integration.UtilServer;
import org.apache.axis.om.OMAbstractFactory;
import org.apache.axis.om.OMElement;
@@ -73,6 +74,7 @@
operation.setMessageReciever(new MessageReceiver() {
public void recieve(MessageContext messgeCtx) throws AxisFault {
envelope = messgeCtx.getEnvelope();
+ TestingUtils.campareWithCreatedOMElement(envelope.getBody().getFirstElement());
}
});
service.addOperation(operation);
@@ -85,21 +87,12 @@
UtilServer.stop();
}
- 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);
-
- return method;
- }
+
public void testEchoXMLSync() throws Exception {
SOAPFactory fac = OMAbstractFactory.getSOAP11Factory();
- OMElement payload = createEnvelope();
+ OMElement payload = TestingUtils.createDummyOMElement();
MessageSender sender = new MessageSender();
Added: webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/TestingUtils.java
URL: http://svn.apache.org/viewcvs/webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/TestingUtils.java?rev=202329&view=auto
==============================================================================
--- webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/TestingUtils.java (added)
+++ webservices/axis/trunk/java/modules/samples/test/org/apache/axis/integration/TestingUtils.java Wed Jun 29 00:38:29 2005
@@ -0,0 +1,45 @@
+/*
+ * 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.
+ *
+ * Runtime state of the engine
+ */
+package org.apache.axis.integration;
+
+import junit.framework.TestCase;
+
+import org.apache.axis.om.OMAbstractFactory;
+import org.apache.axis.om.OMElement;
+import org.apache.axis.om.OMFactory;
+import org.apache.axis.om.OMNamespace;
+
+public class TestingUtils {
+ public static OMElement createDummyOMElement() {
+ 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);
+ return method;
+ }
+
+ public static void campareWithCreatedOMElement(OMElement element){
+ OMElement firstChild = element.getFirstElement();
+ TestCase.assertNotNull(firstChild);
+ String textValue = firstChild.getText();
+ TestCase.assertEquals(textValue,"Isaac Assimov, the foundation Sega");
+ }
+
+}