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 gd...@apache.org on 2001/12/11 22:08:58 UTC
cvs commit: xml-axis/java/test/functional TestMiscSample.java TestProxySample.java
gdaniels 01/12/11 13:08:58
Modified: java/test/functional TestMiscSample.java
TestProxySample.java
Log:
Deploy the EchoService as needed for these tests, since it's no longer
deployed by default.
Revision Changes Path
1.8 +42 -2 xml-axis/java/test/functional/TestMiscSample.java
Index: TestMiscSample.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/functional/TestMiscSample.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestMiscSample.java 2001/10/30 16:46:42 1.7
+++ TestMiscSample.java 2001/12/11 21:08:58 1.8
@@ -57,19 +57,52 @@
import junit.framework.TestCase;
import org.apache.axis.AxisFault;
+import org.apache.axis.utils.Options;
+import org.apache.axis.deployment.wsdd.WSDDConstants;
+import org.apache.axis.client.AdminClient;
import org.apache.log4j.Category;
import samples.misc.TestClient;
+import java.io.ByteArrayInputStream;
+
/** Test the stock sample code.
*/
public class TestMiscSample extends TestCase {
static Category category =
Category.getInstance(TestMiscSample.class.getName());
+
+ static final String deployDoc =
+ "<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" " +
+ "xmlns:java=\"" + WSDDConstants.WSDD_JAVA + "\">\n" +
+ " <service name=\"EchoService\" provider=\"Handler\">\n" +
+ " <parameter name=\"handlerClass\" " +
+ " value=\"org.apache.axis.handlers.EchoHandler\"/>\n" +
+ " </service>\n" +
+ "</deployment>";
+
+ static final String undeployDoc =
+ "<undeployment xmlns=\"http://xml.apache.org/axis/wsdd/\">\n" +
+ " <service name=\"EchoService\"/>\n" +
+ "</undeployment>";
- public TestMiscSample(String name) {
+ AdminClient client;
+ Options opts = null;
+
+ public TestMiscSample(String name) throws Exception {
super(name);
+ client = new AdminClient();
+ opts = new Options(new String [] {
+ "-lhttp://localhost:8080/axis/services/AdminService" } );
}
-
+
+ public void doDeploy () throws Exception {
+ client.process(opts, new ByteArrayInputStream(deployDoc.getBytes()));
+ }
+
+ public void doUndeploy () throws Exception {
+ client.process(opts, new ByteArrayInputStream(undeployDoc.getBytes()));
+ }
+
public void doTest () throws Exception {
String[] args = { "-d" };
TestClient.main(args);
@@ -78,8 +111,10 @@
public void testService () throws Exception {
try {
category.info("Testing misc sample.");
+ doDeploy();
category.info("Testing service...");
doTest();
+ doUndeploy();
category.info("Test complete.");
}
catch( Exception e ) {
@@ -87,6 +122,11 @@
e.printStackTrace();
throw new Exception("Fault returned from test: "+e);
}
+ }
+
+ public static void main(String[] args) throws Exception {
+ TestMiscSample tester = new TestMiscSample("tester");
+ tester.testService();
}
}
1.8 +1 -1 xml-axis/java/test/functional/TestProxySample.java
Index: TestProxySample.java
===================================================================
RCS file: /home/cvs/xml-axis/java/test/functional/TestProxySample.java,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -r1.7 -r1.8
--- TestProxySample.java 2001/10/30 16:46:42 1.7
+++ TestProxySample.java 2001/12/11 21:08:58 1.8
@@ -88,7 +88,7 @@
category.info("Testing deployment...");
// deploy the proxy service
- String[] args = { "samples/proxy/deploy.xml" };
+ String[] args = { "samples/proxy/deploy.wsdd" };
AdminClient.main(args);
category.info("Testing server-side client deployment...");