You are viewing a plain text version of this content. The canonical link for it is here.
Posted to java-commits@axis.apache.org by ve...@apache.org on 2012/02/10 22:47:08 UTC
svn commit: r1242945 - in /axis/axis1/java/trunk/samples: bidbuy-sample/
bidbuy-sample/src/test/java/test/functional/ encoding-sample/
encoding-sample/src/test/java/test/functional/ faults-sample/
faults-sample/src/test/java/test/functional/ handler-sa...
Author: veithen
Date: Fri Feb 10 21:47:07 2012
New Revision: 1242945
URL: http://svn.apache.org/viewvc?rev=1242945&view=rev
Log:
Simplified some unit tests.
Added:
axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/
axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/deploy.wsdd
axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/undeploy.wsdd
Modified:
axis/axis1/java/trunk/samples/bidbuy-sample/pom.xml
axis/axis1/java/trunk/samples/bidbuy-sample/src/test/java/test/functional/TestBidBuySample.java
axis/axis1/java/trunk/samples/encoding-sample/pom.xml
axis/axis1/java/trunk/samples/encoding-sample/src/test/java/test/functional/TestElementSample.java
axis/axis1/java/trunk/samples/faults-sample/pom.xml
axis/axis1/java/trunk/samples/faults-sample/src/test/java/test/functional/TestFaultsSample.java
axis/axis1/java/trunk/samples/handler-sample/src/test/java/test/functional/TestMimeHeaders.java
axis/axis1/java/trunk/samples/message-sample/pom.xml
axis/axis1/java/trunk/samples/message-sample/src/test/java/test/functional/TestMessageSample.java
axis/axis1/java/trunk/samples/misc-sample/pom.xml
axis/axis1/java/trunk/samples/misc-sample/src/test/java/test/functional/TestMiscSample.java
axis/axis1/java/trunk/samples/proxy-sample/pom.xml
axis/axis1/java/trunk/samples/proxy-sample/src/test/java/test/functional/TestProxySample.java
axis/axis1/java/trunk/samples/stock-sample/pom.xml
axis/axis1/java/trunk/samples/stock-sample/src/test/java/test/functional/TestStockSample.java
Modified: axis/axis1/java/trunk/samples/bidbuy-sample/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/bidbuy-sample/pom.xml?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/bidbuy-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/bidbuy-sample/pom.xml Fri Feb 10 21:47:07 2012
@@ -67,6 +67,16 @@
<goals>
<goal>start-server</goal>
</goals>
+ <configuration>
+ <wsdds>
+ <wsdd>
+ <directory>src/main/wsdd</directory>
+ <includes>
+ <include>**/*.wsdd</include>
+ </includes>
+ </wsdd>
+ </wsdds>
+ </configuration>
</execution>
<execution>
<id>stop-server</id>
Modified: axis/axis1/java/trunk/samples/bidbuy-sample/src/test/java/test/functional/TestBidBuySample.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/bidbuy-sample/src/test/java/test/functional/TestBidBuySample.java?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/bidbuy-sample/src/test/java/test/functional/TestBidBuySample.java (original)
+++ axis/axis1/java/trunk/samples/bidbuy-sample/src/test/java/test/functional/TestBidBuySample.java Fri Feb 10 21:47:07 2012
@@ -17,50 +17,14 @@
package test.functional;
import junit.framework.TestCase;
-import org.apache.axis.client.AdminClient;
-import org.apache.axis.components.logger.LogFactory;
-import org.apache.commons.logging.Log;
import samples.bidbuy.TestClient;
-
/** Test the stock sample code.
*/
public class TestBidBuySample extends TestCase {
- static Log log =
- LogFactory.getLog(TestBidBuySample.class.getName());
-
- public TestBidBuySample(String name) {
- super(name);
- }
-
- public void doTestDeploy () throws Exception {
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/deploy.wsdd" };
- AdminClient.main(args);
- }
-
- public void doTest () throws Exception {
+ public void test () throws Exception {
String[] args = { "http://localhost:8080" };
TestClient.main(args);
}
-
- public void testBidBuyService () throws Exception {
- try {
- log.info("Testing bidbuy sample.");
- log.info("Testing deployment...");
- doTestDeploy();
- log.info("Testing service...");
- doTest();
- log.info("Test complete.");
- }
- catch( Exception e ) {
- e.printStackTrace();
- throw new Exception("Fault returned from test: "+e);
- }
- }
-
- public static void main(String[] args) throws Exception {
- TestBidBuySample tester = new TestBidBuySample("test");
- tester.testBidBuyService();
- }
}
Modified: axis/axis1/java/trunk/samples/encoding-sample/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/encoding-sample/pom.xml?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/encoding-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/encoding-sample/pom.xml Fri Feb 10 21:47:07 2012
@@ -67,6 +67,16 @@
<goals>
<goal>start-server</goal>
</goals>
+ <configuration>
+ <wsdds>
+ <wsdd>
+ <directory>src/main/wsdd</directory>
+ <includes>
+ <include>**/*.wsdd</include>
+ </includes>
+ </wsdd>
+ </wsdds>
+ </configuration>
</execution>
<execution>
<id>stop-server</id>
Modified: axis/axis1/java/trunk/samples/encoding-sample/src/test/java/test/functional/TestElementSample.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/encoding-sample/src/test/java/test/functional/TestElementSample.java?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/encoding-sample/src/test/java/test/functional/TestElementSample.java (original)
+++ axis/axis1/java/trunk/samples/encoding-sample/src/test/java/test/functional/TestElementSample.java Fri Feb 10 21:47:07 2012
@@ -17,25 +17,13 @@
package test.functional;
import junit.framework.TestCase;
-import org.apache.axis.client.AdminClient;
-import org.apache.axis.components.logger.LogFactory;
-import org.apache.axis.transport.http.SimpleAxisWorker;
import org.apache.axis.utils.NetworkUtils;
-import org.apache.commons.logging.Log;
import samples.encoding.TestElem;
-
/** Test the ElementService sample code.
*/
public class TestElementSample extends TestCase {
- static Log log =
- LogFactory.getLog(TestElementSample.class.getName());
-
- public TestElementSample(String name) {
- super(name);
- }
-
- public void doTestElement () throws Exception {
+ public void testElement () throws Exception {
String thisHost = NetworkUtils.getLocalHostname();
String thisPort = System.getProperty("test.functional.ServicePort","8080");
@@ -46,32 +34,6 @@ public class TestElementSample extends T
System.out.println("Received: " + res );
assertEquals("TestElementSample.doit(): xml must match", res, xml);
}
-
- public void doTestDeploy () throws Exception {
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/deploy.wsdd" };
- AdminClient.main(args);
- }
-
- public void doTestUndeploy () throws Exception {
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/undeploy.wsdd" };
- AdminClient.main(args);
- }
-
- public static void main(String args[]) throws Exception {
- TestElementSample tester = new TestElementSample("tester");
- tester.testElementService();
- }
-
- public void testElementService () throws Exception {
- log.info("Testing element sample.");
- log.info("Testing deployment...");
- doTestDeploy();
- log.info("Testing service...");
- doTestElement();
- log.info("Testing undeployment...");
- doTestUndeploy();
- log.info("Test complete.");
- }
}
Modified: axis/axis1/java/trunk/samples/faults-sample/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/faults-sample/pom.xml?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/faults-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/faults-sample/pom.xml Fri Feb 10 21:47:07 2012
@@ -67,6 +67,16 @@
<goals>
<goal>start-server</goal>
</goals>
+ <configuration>
+ <wsdds>
+ <wsdd>
+ <directory>src/main/wsdd</directory>
+ <includes>
+ <include>**/*.wsdd</include>
+ </includes>
+ </wsdd>
+ </wsdds>
+ </configuration>
</execution>
<execution>
<id>stop-server</id>
Modified: axis/axis1/java/trunk/samples/faults-sample/src/test/java/test/functional/TestFaultsSample.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/faults-sample/src/test/java/test/functional/TestFaultsSample.java?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/faults-sample/src/test/java/test/functional/TestFaultsSample.java (original)
+++ axis/axis1/java/trunk/samples/faults-sample/src/test/java/test/functional/TestFaultsSample.java Fri Feb 10 21:47:07 2012
@@ -17,34 +17,22 @@
package test.functional;
import junit.framework.TestCase;
-import org.apache.axis.client.AdminClient;
import org.apache.axis.components.logger.LogFactory;
import org.apache.commons.logging.Log;
import samples.faults.EmployeeClient;
-
-
/** Test the faults sample code.
*/
public class TestFaultsSample extends TestCase {
static Log log =
LogFactory.getLog(TestFaultsSample.class.getName());
- public TestFaultsSample(String name) {
- super(name);
- }
-
- public void doTestDeploy () throws Exception {
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/deploy.wsdd" };
- AdminClient.main(args);
- }
-
- public void doTest1 () throws Exception {
+ public void test1 () throws Exception {
String[] args = { "#001" };
EmployeeClient.main(args);
}
- public void doTest2 () throws Exception {
+ public void test2 () throws Exception {
String[] args = { "#002" };
try {
EmployeeClient.main(args);
@@ -53,26 +41,5 @@ public class TestFaultsSample extends Te
}
fail("Should not reach here");
}
-
- public void testFaultsService () throws Exception {
- try {
- log.info("Testing faults sample.");
- log.info("Testing deployment...");
- doTestDeploy();
- log.info("Testing service...");
- doTest1();
- doTest2();
- log.info("Test complete.");
- }
- catch( Exception e ) {
- e.printStackTrace();
- throw new Exception("Fault returned from test: "+e);
- }
- }
-
- public static void main(String[] args) throws Exception {
- TestFaultsSample tester = new TestFaultsSample("test");
- tester.testFaultsService();
- }
}
Modified: axis/axis1/java/trunk/samples/handler-sample/src/test/java/test/functional/TestMimeHeaders.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/handler-sample/src/test/java/test/functional/TestMimeHeaders.java?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/handler-sample/src/test/java/test/functional/TestMimeHeaders.java (original)
+++ axis/axis1/java/trunk/samples/handler-sample/src/test/java/test/functional/TestMimeHeaders.java Fri Feb 10 21:47:07 2012
@@ -12,11 +12,6 @@ import junit.framework.TestCase;
* Test MIME headers.
*/
public class TestMimeHeaders extends TestCase {
-
- public TestMimeHeaders(String s) {
- super(s);
- }
-
public void testTransferMimeHeadersToHttpHeaders() throws Exception {
SOAPConnectionFactory scFactory = SOAPConnectionFactory.newInstance();
SOAPConnection con = scFactory.createConnection();
Modified: axis/axis1/java/trunk/samples/message-sample/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/message-sample/pom.xml?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/message-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/message-sample/pom.xml Fri Feb 10 21:47:07 2012
@@ -67,6 +67,16 @@
<goals>
<goal>start-server</goal>
</goals>
+ <configuration>
+ <wsdds>
+ <wsdd>
+ <directory>src/main/wsdd</directory>
+ <includes>
+ <include>**/*.wsdd</include>
+ </includes>
+ </wsdd>
+ </wsdds>
+ </configuration>
</execution>
<execution>
<id>stop-server</id>
Modified: axis/axis1/java/trunk/samples/message-sample/src/test/java/test/functional/TestMessageSample.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/message-sample/src/test/java/test/functional/TestMessageSample.java?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/message-sample/src/test/java/test/functional/TestMessageSample.java (original)
+++ axis/axis1/java/trunk/samples/message-sample/src/test/java/test/functional/TestMessageSample.java Fri Feb 10 21:47:07 2012
@@ -17,28 +17,12 @@
package test.functional;
import junit.framework.TestCase;
-import org.apache.axis.client.AdminClient;
-import org.apache.axis.components.logger.LogFactory;
-import org.apache.commons.logging.Log;
import samples.message.TestMsg;
-
/** Test the message sample code.
*/
public class TestMessageSample extends TestCase {
- static Log log =
- LogFactory.getLog(TestMessageSample.class.getName());
-
- public TestMessageSample(String name) {
- super(name);
- }
-
- public void doTestDeploy() throws Exception {
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/deploy.wsdd" };
- AdminClient.main(args);
- }
-
- public void doTestMessage() throws Exception {
+ public void testMessage() throws Exception {
String[] args = { };
String res = (new TestMsg()).doit(args);
String expected="Res elem[0]=<ns1:e1 xmlns:ns1=\"urn:foo\">Hello</ns1:e1>"
@@ -50,33 +34,6 @@ public class TestMessageSample extends T
+"</ns3:e3>";
assertEquals("test result elements", expected, res);
}
-
- public void doTestUndeploy () throws Exception {
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/undeploy.wsdd" };
- AdminClient.main(args);
- }
-
- public static void main(String args[]) throws Exception {
- TestMessageSample tester = new TestMessageSample("tester");
- tester.testMessageService();
- }
-
- public void testMessageService () throws Exception {
- try {
- log.info("Testing message sample.");
- log.info("Testing deployment...");
- doTestDeploy();
- log.info("Testing service...");
- doTestMessage();
- doTestUndeploy();
- log.info("Test complete.");
- }
- catch( Exception e ) {
- e.printStackTrace();
- throw new Exception("Fault returned from test: "+e);
- }
- }
-
}
Modified: axis/axis1/java/trunk/samples/misc-sample/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/misc-sample/pom.xml?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/misc-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/misc-sample/pom.xml Fri Feb 10 21:47:07 2012
@@ -67,6 +67,16 @@
<goals>
<goal>start-server</goal>
</goals>
+ <configuration>
+ <wsdds>
+ <wsdd>
+ <directory>src/main/wsdd</directory>
+ <includes>
+ <include>**/*.wsdd</include>
+ </includes>
+ </wsdd>
+ </wsdds>
+ </configuration>
</execution>
<execution>
<id>stop-server</id>
Added: axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/deploy.wsdd
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/deploy.wsdd?rev=1242945&view=auto
==============================================================================
--- axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/deploy.wsdd (added)
+++ axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/deploy.wsdd Fri Feb 10 21:47:07 2012
@@ -0,0 +1,8 @@
+<?xml version="1.0"?>
+<deployment xmlns="http://xml.apache.org/axis/wsdd/"
+ xmlns:java="http://xml.apache.org/axis/wsdd/providers/java">
+ <service name="EchoService" provider="Handler">
+ <parameter name="handlerClass"
+ value="org.apache.axis.handlers.EchoHandler"/>
+ </service>
+</deployment>
\ No newline at end of file
Added: axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/undeploy.wsdd
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/undeploy.wsdd?rev=1242945&view=auto
==============================================================================
--- axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/undeploy.wsdd (added)
+++ axis/axis1/java/trunk/samples/misc-sample/src/main/wsdd/undeploy.wsdd Fri Feb 10 21:47:07 2012
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<undeployment xmlns="http://xml.apache.org/axis/wsdd/">
+ <service name="EchoService"/>
+</undeployment>
Modified: axis/axis1/java/trunk/samples/misc-sample/src/test/java/test/functional/TestMiscSample.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/misc-sample/src/test/java/test/functional/TestMiscSample.java?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/misc-sample/src/test/java/test/functional/TestMiscSample.java (original)
+++ axis/axis1/java/trunk/samples/misc-sample/src/test/java/test/functional/TestMiscSample.java Fri Feb 10 21:47:07 2012
@@ -17,77 +17,14 @@
package test.functional;
import junit.framework.TestCase;
-import org.apache.axis.client.AdminClient;
-import org.apache.axis.components.logger.LogFactory;
-import org.apache.axis.deployment.wsdd.WSDDConstants;
-import org.apache.axis.utils.Options;
-import org.apache.commons.logging.Log;
import samples.misc.TestClient;
-import java.io.ByteArrayInputStream;
-
-
/** Test the stock sample code.
*/
public class TestMiscSample extends TestCase {
- static Log log =
- LogFactory.getLog(TestMiscSample.class.getName());
-
- static final String deployDoc =
- "<deployment xmlns=\"http://xml.apache.org/axis/wsdd/\" " +
- "xmlns:java=\"" + WSDDConstants.URI_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>";
-
- 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 {
+ public void test() throws Exception {
String[] args = { "-d" };
TestClient.main(args);
}
-
- public void testService () throws Exception {
- try {
- log.info("Testing misc sample.");
- doDeploy();
- log.info("Testing service...");
- doTest();
- doUndeploy();
- log.info("Test complete.");
- }
- catch( Exception e ) {
- 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();
- }
}
Modified: axis/axis1/java/trunk/samples/proxy-sample/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/proxy-sample/pom.xml?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/proxy-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/proxy-sample/pom.xml Fri Feb 10 21:47:07 2012
@@ -78,6 +78,16 @@
<goals>
<goal>start-server</goal>
</goals>
+ <configuration>
+ <wsdds>
+ <wsdd>
+ <directory>src/main/wsdd</directory>
+ <includes>
+ <include>**/*.wsdd</include>
+ </includes>
+ </wsdd>
+ </wsdds>
+ </configuration>
</execution>
<execution>
<id>stop-server</id>
Modified: axis/axis1/java/trunk/samples/proxy-sample/src/test/java/test/functional/TestProxySample.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/proxy-sample/src/test/java/test/functional/TestProxySample.java?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/proxy-sample/src/test/java/test/functional/TestProxySample.java (original)
+++ axis/axis1/java/trunk/samples/proxy-sample/src/test/java/test/functional/TestProxySample.java Fri Feb 10 21:47:07 2012
@@ -17,56 +17,14 @@
package test.functional;
import junit.framework.TestCase;
-import org.apache.axis.client.AdminClient;
-import org.apache.axis.components.logger.LogFactory;
-import org.apache.commons.logging.Log;
import samples.misc.TestClient;
-
/** Test the proxy sample code.
*/
public class TestProxySample extends TestCase {
- static Log log =
- LogFactory.getLog(TestProxySample.class.getName());
-
- public TestProxySample(String name) {
- super(name);
- }
-
- public void doTest () throws Exception {
+ public void test() throws Exception {
String[] args = { "-d" };
TestClient.mainWithService(args, "ProxyService");
}
-
- // temp for debugging
- public static void main (String[] args) throws Exception {
- new TestProxySample("foo").doTest();
- }
-
- public void testService () throws Exception {
- try {
- log.info("Testing proxy sample.");
-
- log.info("Testing deployment...");
-
- // deploy the proxy service
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/deploy.wsdd" };
- AdminClient.main(args);
-
- log.info("Testing server-side client deployment...");
-
- // deploy the proxy service
- String[] args2 = { System.getProperty("basedir") + "/src/main/wsdd/client_deploy.wsdd" };
- AdminClient.main(args2);
-
- log.info("Testing service...");
- doTest();
- log.info("Test complete.");
- }
- catch( Exception e ) {
- e.printStackTrace();
- throw new Exception("Fault returned from test: "+e);
- }
- }
}
Modified: axis/axis1/java/trunk/samples/stock-sample/pom.xml
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/stock-sample/pom.xml?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/stock-sample/pom.xml (original)
+++ axis/axis1/java/trunk/samples/stock-sample/pom.xml Fri Feb 10 21:47:07 2012
@@ -76,6 +76,14 @@
<jwsDirs>
<jwsDir>src/main/jws</jwsDir>
</jwsDirs>
+ <wsdds>
+ <wsdd>
+ <directory>src/main/wsdd</directory>
+ <includes>
+ <include>**/*.wsdd</include>
+ </includes>
+ </wsdd>
+ </wsdds>
</configuration>
</execution>
<execution>
Modified: axis/axis1/java/trunk/samples/stock-sample/src/test/java/test/functional/TestStockSample.java
URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/stock-sample/src/test/java/test/functional/TestStockSample.java?rev=1242945&r1=1242944&r2=1242945&view=diff
==============================================================================
--- axis/axis1/java/trunk/samples/stock-sample/src/test/java/test/functional/TestStockSample.java (original)
+++ axis/axis1/java/trunk/samples/stock-sample/src/test/java/test/functional/TestStockSample.java Fri Feb 10 21:47:07 2012
@@ -18,24 +18,13 @@ package test.functional;
import junit.framework.TestCase;
import org.apache.axis.AxisFault;
-import org.apache.axis.client.AdminClient;
-import org.apache.axis.components.logger.LogFactory;
-import org.apache.commons.logging.Log;
import samples.stock.GetQuote;
import samples.stock.GetQuote2;
-
/** Test the stock sample code.
*/
public class TestStockSample extends TestCase {
- static Log log =
- LogFactory.getLog(TestStockSample.class.getName());
-
- public TestStockSample(String name) {
- super(name);
- }
-
- public void doTestStockJWS () throws Exception {
+ public void testStockJWS () throws Exception {
String[] args = { "-uuser1", "-wpass1", "XXX", "-saxis/StockQuoteService.jws" };
float val = new GetQuote().getQuote(args);
assertEquals("TestStockSample.doTestStockJWS(): stock price should be 66.25", val, 66.25, 0.01);
@@ -52,62 +41,23 @@ public class TestStockSample extends Tes
assertNull("-sjws/AltStockQuoteService.jws did not fail as expected.");
}
- public void doTestDeploy () throws Exception {
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/deploy.wsdd" };
- AdminClient.main(args);
- }
-
- public void doTestStockJava() throws Exception {
+ public void testStockJava() throws Exception {
String[] args = { "XXX" };
float val = new GetQuote2().getQuote(args);
assertEquals("Stock price is not the expected 55.25 +/- 0.01", val, 55.25, 0.01);
}
- public void doTestStock () throws Exception {
+ public void testStock () throws Exception {
String[] args = { "-uuser1", "-wpass1", "XXX" };
float val = new GetQuote().getQuote(args);
assertEquals("Stock price is not the expected 55.25 +/- 0.01", val, 55.25, 0.01);
}
- public void doTestStockNoAction () throws Exception {
+ public void testStockNoAction () throws Exception {
String[] args = { "-uuser1", "-wpass1", "XXX_noaction" };
float val = new GetQuote().getQuote(args);
assertEquals("Stock price is not the expected 55.25 +/- 0.01", val, 55.25, 0.01);
}
-
- public void doTestUndeploy () throws Exception {
- String[] args = { System.getProperty("basedir") + "/src/main/wsdd/undeploy.wsdd" };
- AdminClient.main(args);
- }
-
- public static void main(String args[]) throws Exception {
- TestStockSample tester = new TestStockSample("tester");
- tester.testStockService();
- }
-
- public void testStockService () throws Exception {
- try {
- log.info("Testing stock sample.");
- log.info("Testing JWS...");
- doTestStockJWS();
- log.info("Testing Java Binding...");
- doTestStockJava();
- log.info("Testing deployment...");
- doTestDeploy();
- log.info("Testing service...");
- doTestStock();
- log.info("Testing service with SOAPAction: \"\"...");
- doTestStockNoAction();
- log.info("Testing undeployment...");
- doTestUndeploy();
- log.info("Test complete.");
- }
- catch( Exception e ) {
- e.printStackTrace();
- throw new Exception("Fault returned from test: "+e);
- }
- }
-
}