Author: veithen Date: Sun Feb 12 14:59:10 2012 New Revision: 1243259 URL: http://svn.apache.org/viewvc?rev=1243259&view=rev Log: Use random HTTP ports for the integration tests of the samples.
Modified: axis/axis1/java/trunk/pom.xml axis/axis1/java/trunk/samples/attachments-sample/pom.xml axis/axis1/java/trunk/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java 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/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/pom.xml 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/pom.xml URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/pom.xml?rev=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/pom.xml (original) +++ axis/axis1/java/trunk/pom.xml Sun Feb 12 14:59:10 2012 @@ -132,6 +132,11 @@ <artifactId>maven-dependency-plugin</artifactId> <version>2.4</version> </plugin> + <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <version>1.7</version> + </plugin> </plugins> </pluginManagement> </build> Modified: axis/axis1/java/trunk/samples/attachments-sample/pom.xml URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/attachments-sample/pom.xml?rev=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/attachments-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/attachments-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -58,6 +58,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -68,6 +86,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <wsdds> <wsdd> <directory>src/main/wsdd</directory> @@ -98,6 +117,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> Modified: axis/axis1/java/trunk/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java?rev=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java (original) +++ axis/axis1/java/trunk/samples/attachments-sample/src/test/java/test/functional/TestAttachmentsSample.java Sun Feb 12 14:59:10 2012 @@ -24,38 +24,38 @@ import samples.attachments.TestRef; /** Test the attachments sample code. */ public class TestAttachmentsSample extends TestCase { + private Options opts; + + protected void setUp() throws Exception { + opts = new Options(new String[] { "-p", System.getProperty("test.functional.ServicePort", "8080") }); + } + public void testAttachments1() throws Exception { - Options opts = new Options( new String[]{}); boolean res = new EchoAttachment(opts).echo(false, System.getProperty("basedir") + "/pom.xml"); assertEquals("Didn't process attachment correctly", res, true) ; } public void testAttachmentsD1() throws Exception { - Options opts = new Options( new String[]{}); boolean res = new EchoAttachment(opts).echo(true, System.getProperty("basedir") + "/pom.xml"); assertEquals("Didn't process attachment correctly", res, true) ; } public void testAttachmentsDimeLeaveEmpty() throws Exception { - Options opts = new Options( new String[]{}); boolean res = new EchoAttachment(opts).echo(true, System.getProperty("basedir") + "/src/test/files/leaveempty.txt"); assertEquals("Didn't process attachment correctly", res, true) ; } public void testAttachments2() throws Exception { - Options opts = new Options( new String[]{}); boolean res = new EchoAttachment(opts).echoDir(false, System.getProperty("basedir") + "/src/main/java/samples/attachments"); assertEquals("Didn't process attachments correctly", res, true); } public void testAttachmentsD2() throws Exception { - Options opts = new Options( new String[]{}); boolean res = new EchoAttachment(opts).echoDir(true, System.getProperty("basedir") + "/src/main/java/samples/attachments"); assertEquals("Didn't process attachments correctly", res, true); } public void testAttachmentsTestRef() throws Exception { - Options opts = new Options( new String[]{}); boolean res = new TestRef(opts).testit(); assertEquals("Didn't process attachments correctly", res, true); } 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=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/bidbuy-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/bidbuy-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -58,6 +58,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -68,6 +86,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <wsdds> <wsdd> <directory>src/main/wsdd</directory> @@ -98,6 +117,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> 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=1243259&r1=1243258&r2=1243259&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 Sun Feb 12 14:59:10 2012 @@ -23,7 +23,7 @@ import samples.bidbuy.TestClient; */ public class TestBidBuySample extends TestCase { public void test () throws Exception { - String[] args = { "http://localhost:8080" }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080") }; TestClient.main(args); } } 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=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/encoding-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/encoding-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -58,6 +58,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -68,6 +86,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <wsdds> <wsdd> <directory>src/main/wsdd</directory> @@ -98,6 +117,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> 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=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/faults-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/faults-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -58,6 +58,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -68,6 +86,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <wsdds> <wsdd> <directory>src/main/wsdd</directory> @@ -98,6 +117,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> 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=1243259&r1=1243258&r2=1243259&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 Sun Feb 12 14:59:10 2012 @@ -28,12 +28,12 @@ public class TestFaultsSample extends Te LogFactory.getLog(TestFaultsSample.class.getName()); public void test1 () throws Exception { - String[] args = { "#001" }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080"), "#001" }; EmployeeClient.main(args); } public void test2 () throws Exception { - String[] args = { "#002" }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080"), "#002" }; try { EmployeeClient.main(args); } catch (samples.faults.NoSuchEmployeeFault nsef) { Modified: axis/axis1/java/trunk/samples/handler-sample/pom.xml URL: http://svn.apache.org/viewvc/axis/axis1/java/trunk/samples/handler-sample/pom.xml?rev=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/handler-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/handler-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -58,6 +58,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -68,6 +86,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <wsdds> <wsdd> <directory>src/main/wsdd</directory> @@ -98,6 +117,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> 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=1243259&r1=1243258&r2=1243259&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 Sun Feb 12 14:59:10 2012 @@ -22,7 +22,9 @@ public class TestMimeHeaders extends Tes String headerValue = "bar"; message.getMimeHeaders().addHeader(headerName, headerValue); - URLEndpoint endpoint = new URLEndpoint("http://localhost:8080/axis/services/TestMimeHeaderService"); + URLEndpoint endpoint = new URLEndpoint("http://localhost:" + + System.getProperty("test.functional.ServicePort", "8080") + + "/axis/services/TestMimeHeaderService"); SOAPMessage response = con.call(message, endpoint); String[] responseHeader = response.getMimeHeaders().getHeader(headerName); assertTrue("Response header was null", responseHeader != null); 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=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/message-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/message-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -58,6 +58,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -68,6 +86,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <wsdds> <wsdd> <directory>src/main/wsdd</directory> @@ -98,6 +117,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> 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=1243259&r1=1243258&r2=1243259&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 Sun Feb 12 14:59:10 2012 @@ -23,7 +23,7 @@ import samples.message.TestMsg; */ public class TestMessageSample extends TestCase { public void testMessage() throws Exception { - String[] args = { }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080") }; String res = (new TestMsg()).doit(args); String expected="Res elem[0]=<ns1:e1 xmlns:ns1=\"urn:foo\">Hello</ns1:e1>" +"Res elem[1]=<ns2:e1 xmlns:ns2=\"urn:foo\">World</ns2:e1>" 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=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/misc-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/misc-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -58,6 +58,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -68,6 +86,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <wsdds> <wsdd> <directory>src/main/wsdd</directory> @@ -98,6 +117,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> 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=1243259&r1=1243258&r2=1243259&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 Sun Feb 12 14:59:10 2012 @@ -23,7 +23,7 @@ import samples.misc.TestClient; */ public class TestMiscSample extends TestCase { public void test() throws Exception { - String[] args = { "-d" }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080"), "-d" }; TestClient.main(args); } } 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=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/proxy-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/proxy-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -69,6 +69,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -79,6 +97,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <wsdds> <wsdd> <directory>src/main/wsdd</directory> @@ -109,6 +128,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> 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=1243259&r1=1243258&r2=1243259&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 Sun Feb 12 14:59:10 2012 @@ -23,7 +23,7 @@ import samples.misc.TestClient; */ public class TestProxySample extends TestCase { public void test() throws Exception { - String[] args = { "-d" }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080"), "-d" }; TestClient.mainWithService(args, "ProxyService"); } } 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=1243259&r1=1243258&r2=1243259&view=diff ============================================================================== --- axis/axis1/java/trunk/samples/stock-sample/pom.xml (original) +++ axis/axis1/java/trunk/samples/stock-sample/pom.xml Sun Feb 12 14:59:10 2012 @@ -58,6 +58,24 @@ </executions> </plugin> <plugin> + <groupId>org.codehaus.mojo</groupId> + <artifactId>build-helper-maven-plugin</artifactId> + <executions> + <execution> + <id>reserve-network-port</id> + <goals> + <goal>reserve-network-port</goal> + </goals> + <phase>pre-integration-test</phase> + <configuration> + <portNames> + <portName>test.functional.ServicePort</portName> + </portNames> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>${project.groupId}</groupId> <artifactId>maven-axis-server-plugin</artifactId> <version>${project.version}</version> @@ -68,6 +86,7 @@ <goal>start-server</goal> </goals> <configuration> + <port>${test.functional.ServicePort}</port> <configs> <config> <directory>src/main/config</directory> @@ -106,6 +125,9 @@ <includes> <include>**/Test*.java</include> </includes> + <systemPropertyVariables> + <test.functional.ServicePort>${test.functional.ServicePort}</test.functional.ServicePort> + </systemPropertyVariables> </configuration> </execution> </executions> 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=1243259&r1=1243258&r2=1243259&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 Sun Feb 12 14:59:10 2012 @@ -25,12 +25,13 @@ import samples.stock.GetQuote2; */ public class TestStockSample extends TestCase { public void testStockJWS () throws Exception { - String[] args = { "-uuser1", "-wpass1", "XXX", "-saxis/StockQuoteService.jws" }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080"), + "-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); // This should FAIL - args[3] = "-sjws/AltStockQuoteService.jws"; + args[5] = "-sjws/AltStockQuoteService.jws"; try { val = new GetQuote().getQuote(args); } catch (AxisFault e) { @@ -48,13 +49,15 @@ public class TestStockSample extends Tes } public void testStock () throws Exception { - String[] args = { "-uuser1", "-wpass1", "XXX" }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080"), + "-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 testStockNoAction () throws Exception { - String[] args = { "-uuser1", "-wpass1", "XXX_noaction" }; + String[] args = { "-p", System.getProperty("test.functional.ServicePort", "8080"), + "-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); }