servicemix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ioca...@apache.org
Subject svn commit: r1055035 [1/2] - in /servicemix/components/trunk/bindings/servicemix-http: ./ src/test/java/org/apache/servicemix/http/ src/test/java/org/apache/servicemix/http/addressing/ src/test/java/org/apache/servicemix/http/endpoints/ src/test/java/o...
Date Tue, 04 Jan 2011 13:43:47 GMT
Author: iocanel
Date: Tue Jan  4 13:43:46 2011
New Revision: 1055035

URL: http://svn.apache.org/viewvc?rev=1055035&view=rev
Log:
[SMXCOMP-834] Leveraged maven-build-helper plugin to allocate unused ports for servicemix-http unit tests.

Modified:
    servicemix/components/trunk/bindings/servicemix-http/pom.xml
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ConsumerEndpointTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpConsumerTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpProviderTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSoapTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSpringTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpTxTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpURITest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpWsdlTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/WsdlRoundtripTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/addressing/AddressingConsumerTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshalerTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/HttpProviderExpirationTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/SerializedMarshalerTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/security/HttpSecurityTest.java
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/consumer/http.wsdl
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/security/secure.xml
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring-web.xml
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring.xml
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/test.wsdl
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/wsdlroundtrip.xml
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/person.wsdl
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/provider/http.wsdl
    servicemix/components/trunk/bindings/servicemix-http/src/test/resources/xbean/xbean.xml

Modified: servicemix/components/trunk/bindings/servicemix-http/pom.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/pom.xml?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/pom.xml (original)
+++ servicemix/components/trunk/bindings/servicemix-http/pom.xml Tue Jan  4 13:43:46 2011
@@ -238,6 +238,22 @@
     </dependencies>
 
     <build>
+        <testResources>
+            <testResource>
+                <directory>src/test/resources</directory>
+                <filtering>true</filtering>
+                <excludes>
+                    <exclude>**/*.keystore</exclude>
+                </excludes>
+            </testResource>    
+            <testResource>
+                <directory>src/test/resources</directory>
+                <filtering>false</filtering>
+                <includes>
+                  <include>**/*.keystore</include>   
+                </includes>
+            </testResource>    
+        </testResources>
         <plugins>
             <plugin>
                 <groupId>org.apache.servicemix.tooling</groupId>
@@ -272,10 +288,38 @@
                         <exclude>**/HttpTxTest.*</exclude>
                         <exclude>**/HttpSecurityTest.*</exclude>
                     </excludes>
+                    <argLine>-Dhttp.port1=${port1} -Dhttp.port2=${port2} -Dhttp.port3=${port3} -Dhttp.port4=${port4} -Dhttp.port5=${port5} -Dhttp.port6=${port6} -Dhttp.port7=${port7} -Dhttp.port8=${port8} -Dhttp.port9=${port9}  -Dactivemq.port=${activemq}</argLine>
                 </configuration>
             </plugin>
+            <plugin>
+                <groupId>org.codehaus.mojo</groupId>
+                <artifactId>build-helper-maven-plugin</artifactId>
+                <version>1.4</version>
+                <executions>
+                    <execution>
+                        <id>reserve-network-port</id>
+                        <goals>
+                            <goal>reserve-network-port</goal>
+                        </goals>
+                        <phase>process-resources</phase>
+                        <configuration>
+                            <portNames>
+                                <portName>activemq</portName>
+                                <portName>port1</portName>
+                                <portName>port2</portName>
+                                <portName>port3</portName>
+                                <portName>port4</portName>
+                                <portName>port5</portName>
+                                <portName>port6</portName>
+                                <portName>port7</portName>
+                                <portName>port8</portName>
+                                <portName>port9</portName>
+                            </portNames>
+                        </configuration>
+                    </execution>
+                </executions>
+            </plugin>
         </plugins>
     </build>
-
 </project>
         
\ No newline at end of file

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ConsumerEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ConsumerEndpointTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ConsumerEndpointTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ConsumerEndpointTest.java Tue Jan  4 13:43:46 2011
@@ -80,6 +80,9 @@ import org.mortbay.jetty.HttpHeaders;
 public class ConsumerEndpointTest extends TestCase {
     private static transient Log log = LogFactory.getLog(ConsumerEndpointTest.class);
 
+    String port1 = System.getProperty("http.port1");
+    String port2 = System.getProperty("http.port2");
+    
     protected JBIContainer container;
     protected SourceTransformer transformer = new SourceTransformer();
 
@@ -127,7 +130,7 @@ public class ConsumerEndpointTest extend
         ep.setService(new QName("urn:test", "svc"));
         ep.setEndpoint("ep");
         ep.setTargetService(new QName("urn:test", "recv"));
-        ep.setLocationURI("http://localhost:8192/ep1/");
+        ep.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep.setDefaultMep(MessageExchangeSupport.IN_ONLY);
         http.setEndpoints(new HttpEndpointType[] {ep});
         container.activateComponent(http, "http");
@@ -138,7 +141,7 @@ public class ConsumerEndpointTest extend
 
         container.start();
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep1/");
         post.setRequestEntity(new StringRequestEntity("<hello>world</hello>"));
         new HttpClient().executeMethod(post);
         String res = post.getResponseBodyAsString();
@@ -160,7 +163,7 @@ public class ConsumerEndpointTest extend
         ep.setService(new QName("urn:test", "svc"));
         ep.setEndpoint("ep");
         ep.setTargetService(new QName("urn:test", "echo"));
-        ep.setLocationURI("http://localhost:8192/ep1/");
+        ep.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep.setDefaultMep(MessageExchangeSupport.IN_OUT);
         ep.setTimeout(1000);
         http.setEndpoints(new HttpEndpointType[] {ep});
@@ -185,7 +188,7 @@ public class ConsumerEndpointTest extend
 
         container.start();
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep1/");
         post.setRequestEntity(new StringRequestEntity("<hello>world</hello>"));
         new HttpClient().executeMethod(post);
         String res = post.getResponseBodyAsString();
@@ -207,7 +210,7 @@ public class ConsumerEndpointTest extend
         ep.setService(new QName("urn:test", "svc"));
         ep.setEndpoint("ep");
         ep.setTargetService(new QName("urn:test", "echo"));
-        ep.setLocationURI("http://localhost:8192/ep1/");
+        ep.setLocationURI("http://localhost:"+port1+"/ep1/");
         http.setEndpoints(new HttpEndpointType[] {ep});
         container.activateComponent(http, "http");
 
@@ -218,7 +221,7 @@ public class ConsumerEndpointTest extend
 
         container.start();
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep1/");
         post.setRequestEntity(new StringRequestEntity("<hello>world</hello>"));
         new HttpClient().executeMethod(post);
         String res = post.getResponseBodyAsString();
@@ -241,7 +244,7 @@ public class ConsumerEndpointTest extend
         ep1.setService(new QName("uri:HelloWorld", "HelloService"));
         ep1.setEndpoint("HelloPortSoap11");
         ep1.setTargetService(new QName("urn:test", "echo"));
-        ep1.setLocationURI("http://localhost:8192/ep1/");
+        ep1.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep1.setWsdl(new ClassPathResource("/org/apache/servicemix/http/HelloWorld-DOC.wsdl"));
         ep1.setValidateWsdl(false); // TODO: Soap 1.2 not handled yet
         ep1.setUseJbiWrapper(useJbiWrapper);
@@ -249,7 +252,7 @@ public class ConsumerEndpointTest extend
         ep2.setService(new QName("uri:HelloWorld", "HelloService"));
         ep2.setEndpoint("HelloPortSoap12");
         ep2.setTargetService(new QName("urn:test", "echo"));
-        ep2.setLocationURI("http://localhost:8192/ep2/");
+        ep2.setLocationURI("http://localhost:"+port1+"/ep2/");
         ep2.setWsdl(new ClassPathResource("/org/apache/servicemix/http/HelloWorld-DOC.wsdl"));
         ep2.setValidateWsdl(false); // TODO: Soap 1.2 not handled yet
         ep2.setUseJbiWrapper(useJbiWrapper);
@@ -261,7 +264,7 @@ public class ConsumerEndpointTest extend
     public void testHttpSoap11FaultOnEnvelope() throws Exception {
         initSoapEndpoints(true);
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep1/");
         post.setRequestEntity(new StringRequestEntity("<hello>world</hello>"));
         new HttpClient().executeMethod(post);
         String res = post.getResponseBodyAsString();
@@ -284,7 +287,7 @@ public class ConsumerEndpointTest extend
     public void testHttpSoap12FaultOnEnvelope() throws Exception {
         initSoapEndpoints(true);
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep2/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep2/");
         post.setRequestEntity(new StringRequestEntity("<hello>world</hello>"));
         new HttpClient().executeMethod(post);
         String res = post.getResponseBodyAsString();
@@ -312,7 +315,7 @@ public class ConsumerEndpointTest extend
     public void testHttpSoap11UnkownOp() throws Exception {
         initSoapEndpoints(true);
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep1/");
         post.setRequestEntity(new StringRequestEntity(
                         "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>"
                                         + "<s:Body><hello>world</hello></s:Body>" + "</s:Envelope>"));
@@ -338,7 +341,7 @@ public class ConsumerEndpointTest extend
      * public void testHttpSoapAttachments() throws Exception { initSoapEndpoints(true);
      * 
      * HttpComponent http = new HttpComponent(); HttpEndpoint ep0 = new HttpEndpoint(); ep0.setService(new
-     * QName("urn:test", "s0")); ep0.setEndpoint("ep0"); ep0.setLocationURI("http://localhost:8192/ep1/");
+     * QName("urn:test", "s0")); ep0.setEndpoint("ep0"); ep0.setLocationURI("http://localhost:"+port1+"/ep1/");
      * ep0.setRoleAsString("provider"); ep0.setSoapVersion("1.1"); ep0.setSoap(true); http.setEndpoints(new
      * HttpEndpoint[] { ep0 }); container.activateComponent(http, "http2");
      * 
@@ -373,7 +376,7 @@ public class ConsumerEndpointTest extend
                         + "<jbi:part><HelloResponse xmlns='uri:HelloWorld' /></jbi:part>" + "</jbi:message>");
         container.activateComponent(echo, "echo");
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep1/");
         post.setRequestEntity(new StringRequestEntity(
                         "<s:Envelope xmlns:s='http://schemas.xmlsoap.org/soap/envelope/'>"
                                         + "<s:Header><HelloHeader xmlns='uri:HelloWorld'/></s:Header>"
@@ -420,7 +423,7 @@ public class ConsumerEndpointTest extend
         mock.setEndpoint("endpoint");
         container.activateComponent(mock, "mock");
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep2/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep2/");
         post.setRequestEntity(
                         new StringRequestEntity("<s:Envelope xmlns:s='http://www.w3.org/2003/05/soap-envelope'>"
                                 + "<s:Header><HelloHeader xmlns='uri:HelloWorld'/></s:Header>"
@@ -465,7 +468,7 @@ public class ConsumerEndpointTest extend
         mock.setEndpoint("endpoint");
         container.activateComponent(mock, "mock");
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep2/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep2/");
         post.setRequestEntity(
                         new StringRequestEntity("<s:Envelope xmlns:s='http://www.w3.org/2003/05/soap-envelope'>"
                                 + "<s:Header><HelloHeader xmlns='uri:HelloWorld'/></s:Header>"
@@ -493,7 +496,7 @@ public class ConsumerEndpointTest extend
         ep.setService(new QName("urn:test", "svc"));
         ep.setEndpoint("ep");
         ep.setTargetService(new QName("urn:test", "echo"));
-        ep.setLocationURI("http://localhost:8192/ep1/");
+        ep.setLocationURI("http://localhost:"+port1+"/ep1/");
         http.setEndpoints(new HttpEndpointType[] {ep });
         container.activateComponent(http, "http");
 
@@ -504,7 +507,7 @@ public class ConsumerEndpointTest extend
 
         container.start();
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep1/");
         post.addRequestHeader(HttpHeaders.CONTENT_ENCODING, "gzip");
         post.addRequestHeader(HttpHeaders.ACCEPT_ENCODING, "gzip");
 
@@ -559,7 +562,7 @@ public class ConsumerEndpointTest extend
         mock.setEndpoint("endpoint");
         container.activateComponent(mock, "mock");
 
-        PostMethod post = new PostMethod("http://localhost:8192/ep2/");
+        PostMethod post = new PostMethod("http://localhost:"+port1+"/ep2/");
 
         post.addRequestHeader(HttpHeaders.CONTENT_ENCODING, "gzip");
         post.addRequestHeader(HttpHeaders.ACCEPT_ENCODING, "gzip");
@@ -615,7 +618,7 @@ public class ConsumerEndpointTest extend
         ep.setService(new QName("urn:test", "svc"));
         ep.setEndpoint("ep");
         ep.setTargetService(new QName("urn:test", "echo"));
-        ep.setLocationURI("http://localhost:8192/ep1/");
+        ep.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep.setTimeout(endpointTimeout);
         http.setEndpoints(new HttpEndpointType[] {ep});
         container.activateComponent(http, "http");
@@ -652,7 +655,7 @@ public class ConsumerEndpointTest extend
                     for (int i = 0; i < nbRequests; i++) {
                     	PostMethod post = null;
                         try {
-                            post = new PostMethod("http://localhost:8192/ep1/");
+                            post = new PostMethod("http://localhost:"+port1+"/ep1/");
                             post.setRequestEntity(new StringRequestEntity("<hello>world</hello>"));
                             client.executeMethod(post);
                             if (post.getStatusCode() != 200) {
@@ -702,7 +705,7 @@ public class ConsumerEndpointTest extend
         ep1.setService(new QName("uri:HelloWorld", "HelloService"));
         ep1.setEndpoint("HelloPortSoap11");
         ep1.setTargetService(new QName("http://test", "MyConsumerService"));
-        ep1.setLocationURI("http://localhost:8193/ep1/");
+        ep1.setLocationURI("http://localhost:"+port2+"/ep1/");
         ep1.setValidateWsdl(true);
         http.setEndpoints(new HttpEndpointType[] {ep1});
         container.activateComponent(http, "http");
@@ -710,7 +713,7 @@ public class ConsumerEndpointTest extend
 
         WSDLFactory factory = WSDLFactory.newInstance();
         WSDLReader reader = factory.newWSDLReader();
-        Definition def = reader.readWSDL("http://localhost:8193/ep1/?wsdl");
+        Definition def = reader.readWSDL("http://localhost:"+port2+"/ep1/?wsdl");
         StringWriter writer = new StringWriter();
         factory.newWSDLWriter().writeWSDL(def, writer);
         log.info(writer.toString());

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpAddressingTest.java Tue Jan  4 13:43:46 2011
@@ -41,6 +41,8 @@ import org.springframework.context.suppo
 public class HttpAddressingTest extends SpringTestSupport {
 
     private static transient Log log = LogFactory.getLog(HttpAddressingTest.class);
+    
+    String port1 = System.getProperty("http.port1");
 
     public void testOk() throws Exception {
         DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
@@ -69,7 +71,7 @@ public class HttpAddressingTest extends 
     }
 
     public void testOkFromUrl() throws Exception {
-        URLConnection connection = new URL("http://localhost:8192/Service/").openConnection();
+        URLConnection connection = new URL("http://localhost:"+port1+"/Service/").openConnection();
         connection.setDoOutput(true);
         connection.setDoInput(true);
         OutputStream os = connection.getOutputStream();

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpConsumerTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpConsumerTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpConsumerTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpConsumerTest.java Tue Jan  4 13:43:46 2011
@@ -47,7 +47,9 @@ public class HttpConsumerTest extends Te
     private static Log logger = LogFactory.getLog(HttpConsumerTest.class);
 
     protected JBIContainer container;
-
+    
+    String port1 = System.getProperty("http.port1");
+    
     protected void setUp() throws Exception {
         container = new JBIContainer();
         container.setUseMBeanServer(false);
@@ -77,7 +79,7 @@ public class HttpConsumerTest extends Te
         // Add the http invoker
         HttpInvoker invoker = new HttpInvoker();
         invoker.setDefaultInOut(false);
-        invoker.setUrl("http://localhost:8192/InOnly/");
+        invoker.setUrl("http://localhost:"+port1+"/InOnly/");
         invoker.setMarshaler(new HttpSoapClientMarshaler(true));
         ActivationSpec asInvoker = new ActivationSpec("invoker", invoker);
         asInvoker.setService(new QName("urn:test", "invoker"));
@@ -126,7 +128,7 @@ public class HttpConsumerTest extends Te
         // Add the http invoker
         HttpInvoker invoker = new HttpInvoker();
         invoker.setDefaultInOut(true);
-        invoker.setUrl("http://localhost:8192/InOut/");
+        invoker.setUrl("http://localhost:"+port1+"/InOut/");
         ActivationSpec asInvoker = new ActivationSpec("invoker", invoker);
         asInvoker.setService(new QName("urn:test", "invoker"));
         container.activateComponent(asInvoker);
@@ -143,7 +145,7 @@ public class HttpConsumerTest extends Te
         component.getServiceUnitManager().start("consumer");
 
         // Retrieve WSDL
-        Definition def = WSDLFactory.newInstance().newWSDLReader().readWSDL("http://localhost:8192/InOut/?wsdl");
+        Definition def = WSDLFactory.newInstance().newWSDLReader().readWSDL("http://localhost:"+port1+"/InOut/?wsdl");
         assertNotNull(def);
 
         // Call it

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpProviderTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpProviderTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpProviderTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpProviderTest.java Tue Jan  4 13:43:46 2011
@@ -46,6 +46,7 @@ public class HttpProviderTest extends Te
     private static transient Log log = LogFactory.getLog(HttpProviderTest.class);
 
     protected JBIContainer container;
+    Integer port1 = Integer.parseInt(System.getProperty("http.port1"));
 
     protected void setUp() throws Exception {
         container = new JBIContainer();
@@ -74,7 +75,7 @@ public class HttpProviderTest extends Te
         container.activateComponent(asReceiver);
 
         // Add the http receiver
-        HttpConnector connector = new HttpConnector("localhost", 8192);
+        HttpConnector connector = new HttpConnector("localhost", port1);
         connector.setDefaultInOut(false);
         ActivationSpec asConnector = new ActivationSpec("connector", connector);
         asConnector.setDestinationService(new QName("test", "receiver"));
@@ -113,8 +114,8 @@ public class HttpProviderTest extends Te
     }
 
     /**
-     * The http.wsdl specifies the location URI as localhost:8192. Set a NormalizedMessage property to override this
-     * value. Therefore don't start the HttpConnector on 8192, rather on another port to prove this functionality works.
+     * The http.wsdl specifies the location URI as localhost:"+port1+". Set a NormalizedMessage property to override this
+     * value. Therefore don't start the HttpConnector on "+port1+", rather on another port to prove this functionality works.
      * 
      * @param msg
      * @param streaming
@@ -186,7 +187,7 @@ public class HttpProviderTest extends Te
         container.activateComponent(asReceiver);
 
         // Add the http receiver
-        HttpConnector connector = new HttpConnector("localhost", 8192);
+        HttpConnector connector = new HttpConnector("localhost", port1);
         connector.setDefaultInOut(true);
         ActivationSpec asConnector = new ActivationSpec("connector", connector);
         asConnector.setDestinationService(new QName("test", "echo"));

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSoapTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSoapTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSoapTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSoapTest.java Tue Jan  4 13:43:46 2011
@@ -72,6 +72,10 @@ public class HttpSoapTest extends TestCa
     private static transient Log logger = LogFactory.getLog(HttpSoapTest.class);
 
     protected JBIContainer container;
+    
+    String port1 = System.getProperty("http.port1");
+    String port2 = System.getProperty("http.port2");
+    String port3 = System.getProperty("http.port3");
 
     protected void setUp() throws Exception {
         container = new JBIContainer();
@@ -92,7 +96,7 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep = new HttpEndpoint();
         ep.setService(new QName("urn:test", "echo"));
         ep.setEndpoint("echo");
-        ep.setLocationURI("http://localhost:8192/ep1/");
+        ep.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep.setRoleAsString("consumer");
         ep.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep.setSoap(true);
@@ -100,7 +104,7 @@ public class HttpSoapTest extends TestCa
         container.activateComponent(http, "http");
         container.start();
 
-        PostMethod method = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod method = new PostMethod("http://localhost:"+port1+"/ep1/");
         method.setRequestEntity(new StringRequestEntity("<hello>world</hello>"));
         int state = new HttpClient().executeMethod(method);
         assertEquals(HttpServletResponse.SC_BAD_REQUEST, state);
@@ -121,7 +125,7 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep1 = new HttpEndpoint();
         ep1.setService(new QName("urn:test", "echo"));
         ep1.setEndpoint("echo");
-        ep1.setLocationURI("http://localhost:8192/ep1/");
+        ep1.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep1.setSoap(true);
@@ -129,7 +133,7 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep2 = new HttpEndpoint();
         ep2.setService(new QName("urn:test", "s2"));
         ep2.setEndpoint("ep2");
-        ep2.setLocationURI("http://localhost:8192/ep1/");
+        ep2.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep2.setRoleAsString("provider");
         ep2.setSoap(true);
 
@@ -157,7 +161,7 @@ public class HttpSoapTest extends TestCa
         ep1.setService(new QName("urn:test", "s1"));
         ep1.setEndpoint("ep1");
         ep1.setTargetService(new QName("urn:test", "echo"));
-        ep1.setLocationURI("http://localhost:8192/ep1/");
+        ep1.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep1.setSoap(true);
@@ -165,7 +169,7 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep2 = new HttpEndpoint();
         ep2.setService(new QName("urn:test", "s2"));
         ep2.setEndpoint("ep2");
-        ep2.setLocationURI("http://localhost:8192/ep1/");
+        ep2.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep2.setRoleAsString("provider");
         ep2.setSoap(true);
 
@@ -198,7 +202,7 @@ public class HttpSoapTest extends TestCa
         ep1.setService(new QName("urn:test", "s1"));
         ep1.setEndpoint("ep1");
         ep1.setTargetService(new QName("urn:test", "s2"));
-        ep1.setLocationURI("http://localhost:8192/ep1/");
+        ep1.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep1.setSoap(true);
@@ -206,7 +210,7 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep2 = new HttpEndpoint();
         ep2.setService(new QName("urn:test", "s2"));
         ep2.setEndpoint("ep2");
-        ep2.setLocationURI("http://localhost:8192/ep3/");
+        ep2.setLocationURI("http://localhost:"+port1+"/ep3/");
         ep2.setRoleAsString("provider");
         ep2.setSoap(true);
 
@@ -214,7 +218,7 @@ public class HttpSoapTest extends TestCa
         ep3.setService(new QName("urn:test", "s3"));
         ep3.setEndpoint("ep3");
         ep3.setTargetService(new QName("urn:test", "echo"));
-        ep3.setLocationURI("http://localhost:8192/ep3/");
+        ep3.setLocationURI("http://localhost:"+port1+"/ep3/");
         ep3.setRoleAsString("consumer");
         ep3.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep3.setSoap(true);
@@ -225,7 +229,7 @@ public class HttpSoapTest extends TestCa
 
         container.start();
 
-        PostMethod method = new PostMethod("http://localhost:8192/ep1/");
+        PostMethod method = new PostMethod("http://localhost:"+port1+"/ep1/");
         method.getParams().setParameter(HttpMethodParams.RETRY_HANDLER, new HttpMethodRetryHandler() {
             public boolean retryMethod(HttpMethod method, IOException exception, int executionCount) {
                 return false;
@@ -258,19 +262,19 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep1 = createInOutEndpoint("ep1");
         ep1.setTargetService(new QName("urn:test", "echo"));
         ep1.setTargetEndpoint("echo");
-        ep1.setLocationURI("http://localhost:8193/ep1/");
+        ep1.setLocationURI("http://localhost:"+port2+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setSoap(true);
 
         HttpEndpoint ep2 = createInOutEndpoint("ep2");
         ep2.setTargetService(new QName("urn:test", "http"));
         ep2.setTargetEndpoint("ep3");
-        ep2.setLocationURI("http://localhost:8193/ep2/");
+        ep2.setLocationURI("http://localhost:"+port2+"/ep2/");
         ep2.setRoleAsString("consumer");
         ep2.setSoap(true);
 
         HttpEndpoint ep3 = createInOutEndpoint("ep3");
-        ep3.setLocationURI("http://localhost:8193/ep1/");
+        ep3.setLocationURI("http://localhost:"+port2+"/ep1/");
         ep3.setRoleAsString("provider");
         ep3.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep3.setSoap(true);
@@ -281,7 +285,7 @@ public class HttpSoapTest extends TestCa
 
         container.start();
 
-        PostMethod method = new PostMethod("http://localhost:8193/ep2/");
+        PostMethod method = new PostMethod("http://localhost:"+port2+"/ep2/");
         method.setRequestEntity(new InputStreamRequestEntity(getClass().getResourceAsStream("soap-request-12.xml")));
         int state = new HttpClient().executeMethod(method);
         assertEquals(HttpServletResponse.SC_INTERNAL_SERVER_ERROR, state);
@@ -296,7 +300,7 @@ public class HttpSoapTest extends TestCa
         e = DOMUtil.getFirstChildElement(e);
         assertEquals(new QName(SoapMarshaler.SOAP_12_URI, SoapMarshaler.FAULT), DOMUtil.getQName(e));
 
-        method = new PostMethod("http://localhost:8193/ep2/");
+        method = new PostMethod("http://localhost:"+port2+"/ep2/");
         method.setRequestBody("hello");
         state = new HttpClient().executeMethod(method);
         String str = method.getResponseBodyAsString();
@@ -310,7 +314,7 @@ public class HttpSoapTest extends TestCa
         e = DOMUtil.getFirstChildElement(e);
         assertEquals(new QName(SoapMarshaler.SOAP_12_URI, SoapMarshaler.FAULT), DOMUtil.getQName(e));
 
-        method = new PostMethod("http://localhost:8193/ep2/");
+        method = new PostMethod("http://localhost:"+port2+"/ep2/");
         method.setRequestBody("<hello/>");
         state = new HttpClient().executeMethod(method);
         str = method.getResponseBodyAsString();
@@ -342,7 +346,7 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep1 = createInOutEndpoint("ep1");
         ep1.setTargetService(new QName("urn:test", "echo"));
         ep1.setTargetEndpoint("echo");
-        ep1.setLocationURI("http://localhost:8194/ep1/");
+        ep1.setLocationURI("http://localhost:"+port3+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setSoap(true);
         ep1.setSoapVersion("1.1");
@@ -350,13 +354,13 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep2 = createInOutEndpoint("ep2");
         ep2.setTargetService(new QName("urn:test", "http"));
         ep2.setTargetEndpoint("ep3");
-        ep2.setLocationURI("http://localhost:8194/ep2/");
+        ep2.setLocationURI("http://localhost:"+port3+"/ep2/");
         ep2.setRoleAsString("consumer");
         ep2.setSoap(true);
         ep2.setSoapVersion("1.1");
 
         HttpEndpoint ep3 = createInOutEndpoint("ep3");
-        ep3.setLocationURI("http://localhost:8194/ep1/");
+        ep3.setLocationURI("http://localhost:"+port3+"/ep1/");
         ep3.setRoleAsString("provider");
         ep3.setSoap(true);
         ep3.setSoapVersion("1.1");
@@ -367,7 +371,7 @@ public class HttpSoapTest extends TestCa
 
         container.start();
 
-        PostMethod method = new PostMethod("http://localhost:8194/ep2/");
+        PostMethod method = new PostMethod("http://localhost:"+port3+"/ep2/");
         method.setRequestEntity(new InputStreamRequestEntity(getClass().getResourceAsStream("soap-request.xml")));
         int state = new HttpClient().executeMethod(method);
         String str = method.getResponseBodyAsString();
@@ -383,7 +387,7 @@ public class HttpSoapTest extends TestCa
         e = DOMUtils.getFirstChildElement(e);
         assertEquals(new QName(SoapMarshaler.SOAP_11_URI, SoapMarshaler.FAULT), DOMUtil.getQName(e));
 
-        method = new PostMethod("http://localhost:8194/ep2/");
+        method = new PostMethod("http://localhost:"+port3+"/ep2/");
         method.setRequestBody("hello");
         state = new HttpClient().executeMethod(method);
         str = method.getResponseBodyAsString();
@@ -397,7 +401,7 @@ public class HttpSoapTest extends TestCa
         e = DOMUtils.getFirstChildElement(e);
         assertEquals(new QName(SoapMarshaler.SOAP_11_URI, SoapMarshaler.FAULT), DOMUtil.getQName(e));
 
-        method = new PostMethod("http://localhost:8194/ep2/");
+        method = new PostMethod("http://localhost:"+port3+"/ep2/");
         method.setRequestBody("<hello/>");
         state = new HttpClient().executeMethod(method);
         str = method.getResponseBodyAsString();
@@ -421,19 +425,19 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep1 = createInOnlyEndpoint("ep1");
         ep1.setTargetService(new QName("urn:test", "echo"));
         ep1.setTargetEndpoint("echo");
-        ep1.setLocationURI("http://localhost:8193/ep1/");
+        ep1.setLocationURI("http://localhost:"+port2+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setSoap(false);
 
         HttpEndpoint ep2 = createInOnlyEndpoint("ep2");
         ep2.setTargetService(new QName("urn:test", "http"));
         ep2.setTargetEndpoint("ep3");
-        ep2.setLocationURI("http://localhost:8193/ep2/");
+        ep2.setLocationURI("http://localhost:"+port2+"/ep2/");
         ep2.setRoleAsString("consumer");
         ep2.setSoap(true);
 
         HttpEndpoint ep3 = createInOnlyEndpoint("ep3");
-        ep3.setLocationURI("http://localhost:8193/ep1/");
+        ep3.setLocationURI("http://localhost:"+port2+"/ep1/");
         ep3.setRoleAsString("provider");
         ep3.setSoap(true);
 
@@ -443,7 +447,7 @@ public class HttpSoapTest extends TestCa
 
         container.start();
 
-        PostMethod method = new PostMethod("http://localhost:8193/ep2/");
+        PostMethod method = new PostMethod("http://localhost:"+port2+"/ep2/");
         method.setRequestEntity(new InputStreamRequestEntity(getClass().getResourceAsStream("request.xml")));
         new HttpClient().executeMethod(method);
 
@@ -475,7 +479,7 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep0 = new HttpEndpoint();
         ep0.setService(new QName("urn:test", "s0"));
         ep0.setEndpoint("ep0");
-        ep0.setLocationURI("http://localhost:8192/ep1/");
+        ep0.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep0.setRoleAsString("provider");
         ep0.setSoap(true);
 
@@ -483,7 +487,7 @@ public class HttpSoapTest extends TestCa
         ep1.setService(new QName("urn:test", "s1"));
         ep1.setEndpoint("ep1");
         ep1.setTargetService(new QName("urn:test", "s2"));
-        ep1.setLocationURI("http://localhost:8192/ep1/");
+        ep1.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep1.setSoap(true);
@@ -491,7 +495,7 @@ public class HttpSoapTest extends TestCa
         HttpEndpoint ep2 = new HttpEndpoint();
         ep2.setService(new QName("urn:test", "s2"));
         ep2.setEndpoint("ep2");
-        ep2.setLocationURI("http://localhost:8192/ep3/");
+        ep2.setLocationURI("http://localhost:"+port1+"/ep3/");
         ep2.setRoleAsString("provider");
         ep2.setSoap(true);
 
@@ -499,7 +503,7 @@ public class HttpSoapTest extends TestCa
         ep3.setService(new QName("urn:test", "s3"));
         ep3.setEndpoint("ep3");
         ep3.setTargetService(new QName("urn:test", "echo"));
-        ep3.setLocationURI("http://localhost:8192/ep3/");
+        ep3.setLocationURI("http://localhost:"+port1+"/ep3/");
         ep3.setRoleAsString("consumer");
         ep3.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep3.setSoap(true);

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSpringTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSpringTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSpringTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpSpringTest.java Tue Jan  4 13:43:46 2011
@@ -44,6 +44,8 @@ import org.springframework.context.suppo
 public class HttpSpringTest extends SpringTestSupport {
 
     private static transient Log logger = LogFactory.getLog(HttpSpringTest.class);
+    
+    String port9 = System.getProperty("http.port9");
 
     protected void setUp() throws Exception {
         String str = "Basic " + EncodingUtil.getAsciiString(
@@ -95,7 +97,7 @@ public class HttpSpringTest extends Spri
 
     public void testMimeWithHttpClient() throws Exception {
         File f = new File(getClass().getResource("servicemix.jpg").getFile());
-        PostMethod filePost = new PostMethod("http://localhost:18192/Service/");
+        PostMethod filePost = new PostMethod("http://localhost:"+port9+"/Service/");
         Part[] parts = {new StringPart("request", "<dummy/>"), new FilePart(f.getName(), f)};
         RequestEntity entity = new MultipartRequestEntity(parts, filePost.getParams());
         ByteArrayOutputStream baos = new ByteArrayOutputStream();

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpTxTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpTxTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpTxTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpTxTest.java Tue Jan  4 13:43:46 2011
@@ -39,6 +39,9 @@ import org.jencks.GeronimoPlatformTransa
 
 public class HttpTxTest extends TestCase {
 
+    String activemq = System.getProperty("activemq.port");
+    String port1 = System.getProperty("http.port1");
+    
     private ExchangeCompletedListener listener;
     private JBIContainer jbi;
     private TransactionManager tm;
@@ -48,7 +51,7 @@ public class HttpTxTest extends TestCase
         broker = new BrokerService();
         broker.setUseJmx(false);
         broker.setPersistent(false);
-        broker.addConnector("tcp://localhost:61616");
+        broker.addConnector("tcp://localhost:"+activemq);
         broker.start();
 
         tm = new GeronimoPlatformTransactionManager();
@@ -81,7 +84,7 @@ public class HttpTxTest extends TestCase
         HttpEndpoint ep0 = new HttpEndpoint();
         ep0.setService(new QName("urn:test", "s0"));
         ep0.setEndpoint("ep0");
-        ep0.setLocationURI("http://localhost:8192/ep1/");
+        ep0.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep0.setRoleAsString("provider");
         ep0.setSoap(true);
         
@@ -89,7 +92,7 @@ public class HttpTxTest extends TestCase
         ep1.setService(new QName("urn:test", "s1"));
         ep1.setEndpoint("ep1");
         ep1.setTargetService(new QName("urn:test", "echo"));
-        ep1.setLocationURI("http://localhost:8192/ep1/");
+        ep1.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep1.setSoap(true);
@@ -119,7 +122,7 @@ public class HttpTxTest extends TestCase
         HttpEndpoint ep0 = new HttpEndpoint();
         ep0.setService(new QName("urn:test", "s0"));
         ep0.setEndpoint("ep0");
-        ep0.setLocationURI("http://localhost:8192/ep1/");
+        ep0.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep0.setRoleAsString("provider");
         ep0.setSoap(true);
         
@@ -127,7 +130,7 @@ public class HttpTxTest extends TestCase
         ep1.setService(new QName("urn:test", "s1"));
         ep1.setEndpoint("ep1");
         ep1.setTargetService(new QName("urn:test", "echo"));
-        ep1.setLocationURI("http://localhost:8192/ep1/");
+        ep1.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep1.setRoleAsString("consumer");
         ep1.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         ep1.setSoap(true);

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpURITest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpURITest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpURITest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpURITest.java Tue Jan  4 13:43:46 2011
@@ -42,6 +42,8 @@ import org.apache.servicemix.tck.Receive
 public class HttpURITest extends TestCase {
     private static Log logger = LogFactory.getLog(HttpURITest.class);
 
+    String port1 = System.getProperty("http.port1");
+    
     private JBIContainer jbi;
 
     protected void setUp() throws Exception {
@@ -62,7 +64,7 @@ public class HttpURITest extends TestCas
         ep.setRole(MessageExchange.Role.CONSUMER);
         ep.setService(ReceiverComponent.SERVICE);
         ep.setEndpoint(ReceiverComponent.ENDPOINT);
-        ep.setLocationURI("http://localhost:8192/");
+        ep.setLocationURI("http://localhost:"+port1+"/");
         ep.setDefaultMep(MessageExchangeSupport.IN_ONLY);
         http.setEndpoints(new HttpEndpoint[] {ep});
         jbi.activateComponent(http, "servicemix-http");
@@ -71,7 +73,7 @@ public class HttpURITest extends TestCas
         jbi.activateComponent(receiver, "receiver");
 
         DefaultServiceMixClient client = new DefaultServiceMixClient(jbi);
-        DocumentFragment epr = URIResolver.createWSAEPR("http://localhost:8192/?http.soap=true");
+        DocumentFragment epr = URIResolver.createWSAEPR("http://localhost:"+port1+"/?http.soap=true");
         ServiceEndpoint se = client.getContext().resolveEndpointReference(epr);
         assertNotNull(se);
 

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpWsdlTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpWsdlTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpWsdlTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/HttpWsdlTest.java Tue Jan  4 13:43:46 2011
@@ -62,36 +62,16 @@ import org.springframework.core.io.UrlRe
 
 public class HttpWsdlTest extends TestCase {
     private static transient Log log = LogFactory.getLog(HttpWsdlTest.class);
-    private static int usedPortNumber = 8192;
+      
+    private Integer port4 = Integer.parseInt(System.getProperty("http.port4"));
+    private Integer port5 = Integer.parseInt(System.getProperty("http.port5"));
+    private Integer port6 = Integer.parseInt(System.getProperty("http.port6"));
+    private Integer port7 = Integer.parseInt(System.getProperty("http.port7"));
+    private Integer port8 = Integer.parseInt(System.getProperty("http.port8"));
+    
 
     protected JBIContainer container;
 
-    /**
-     * determines a free port number
-     * @return a free port number
-     */
-    private static int getFreePortNumber() {
-
-        int portNumber = usedPortNumber + 1;
-        boolean inUse = true;
-
-        while (inUse) {
-            try {
-                ServerSocket serverSocket = new ServerSocket();
-                SocketAddress endpoint = new InetSocketAddress(portNumber);
-                serverSocket.bind(endpoint);
-                serverSocket.close();
-                inUse = false;
-                usedPortNumber = portNumber;
-            } catch (IOException e) {
-                inUse = true;
-            }
-        }
-
-        return portNumber;
-
-    }
-
     protected void setUp() throws Exception {
         container = new JBIContainer();
         container.setUseMBeanServer(false);
@@ -208,24 +188,24 @@ public class HttpWsdlTest extends TestCa
     }
 
     public void testWithNonStandaloneWsdlDoc() throws Exception {
-        testWSDL(createDefinition(false), getFreePortNumber());
+        testWSDL(createDefinition(false), port4);
     }
 
     public void testWithNonStandaloneWsdlRpc() throws Exception {
-        testWSDL(createDefinition(true), getFreePortNumber());
+        testWSDL(createDefinition(true), port5);
     }
 
     public void testWithExistingBinding() throws Exception {
         String uri = getClass().getResource("bound-wsdl.wsdl").toString();
         Definition def = WSDLFactory.newInstance().newWSDLReader().readWSDL(uri);
-        testWSDL(def, getFreePortNumber());
+        testWSDL(def, port6);
     }
 
     public void testExternalNonStandaloneWsdl() throws Exception {
 
         //startup-jetty as mirror for 
         //http://www.ws-i.org/SampleApplications/SupplyChainManagement/2002-08/Retailer.wsdl
-        int remoteHttpServerPort = getFreePortNumber();
+        int remoteHttpServerPort = port7;
         Server remoteServer = new Server(remoteHttpServerPort);
         Handler handler = new AbstractHandler() {
 
@@ -252,8 +232,7 @@ public class HttpWsdlTest extends TestCa
         remoteServer.start();
         
         try {
-            int localHttpServerPort = getFreePortNumber();  
-
+            int localHttpServerPort = port8;
             // HTTP Component
             HttpEndpoint ep = new HttpEndpoint();
             ep.setService(new QName("http://servicemix.apache.org/wsn/jaxws", "PullPointService"));

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ProviderEndpointTest.java Tue Jan  4 13:43:46 2011
@@ -54,6 +54,9 @@ import org.mortbay.jetty.nio.SelectChann
 
 public class ProviderEndpointTest extends TestCase {
 
+    Integer port1 = Integer.parseInt(System.getProperty("http.port1"));
+    Integer port2 = Integer.parseInt(System.getProperty("http.port2"));
+    
     protected JBIContainer container;
     protected SourceTransformer transformer = new SourceTransformer();
     protected Server proxy;
@@ -88,12 +91,12 @@ public class ProviderEndpointTest extend
         ep0.setEndpoint("consumer");
         ep0.setTargetService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
         ep0.setTargetEndpoint("service");
-        ep0.setLocationURI("http://localhost:8192/person/");
+        ep0.setLocationURI("http://localhost:"+port1+"/person/");
 
         HttpProviderEndpoint ep1 = new HttpProviderEndpoint();
         ep1.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
         ep1.setEndpoint("provider");
-        ep1.setLocationURI("http://localhost:8192/person/");
+        ep1.setLocationURI("http://localhost:"+port1+"/person/");
 
         http.setEndpoints(new HttpEndpointType[] {ep0, ep1 });
         container.activateComponent(http, "http");
@@ -133,7 +136,7 @@ public class ProviderEndpointTest extend
         ep0.setEndpoint("consumer");
         ep0.setTargetService(new QName("http://servicemix.apache.org/samples/wsdl-first", "EchoService"));
         ep0.setTargetEndpoint("service");
-        ep0.setLocationURI("http://localhost:8192/PersonService/");
+        ep0.setLocationURI("http://localhost:"+port1+"/PersonService/");
         ep0.setMarshaler(new DefaultHttpConsumerMarshaler() {
             public MessageExchange createExchange(HttpServletRequest request, ComponentContext context) throws Exception {
                 soapAction.set(request.getHeader("SOAPAction"));
@@ -224,7 +227,7 @@ public class ProviderEndpointTest extend
             public void run() {
                 ServerSocket ss = null;
                 try {
-                    ss = new ServerSocket(8192);
+                    ss = new ServerSocket(port1);
                     Socket s = ss.accept();
                     Thread.sleep(50);
                     s.close();
@@ -266,7 +269,7 @@ public class ProviderEndpointTest extend
         ep0.setEndpoint("consumer");
         ep0.setTargetService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
         ep0.setTargetEndpoint("service");
-        ep0.setLocationURI("http://localhost:8192/ps/");
+        ep0.setLocationURI("http://localhost:"+port1+"/ps/");
 
         HttpSoapProviderEndpoint ep1 = new HttpSoapProviderEndpoint();
         ep1.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
@@ -312,14 +315,14 @@ public class ProviderEndpointTest extend
         ep0.setEndpoint("consumer");
         ep0.setTargetService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
         ep0.setTargetEndpoint("service");
-        ep0.setLocationURI("http://localhost:8192/person/");
+        ep0.setLocationURI("http://localhost:"+port1+"/person/");
 
         HttpProviderEndpoint ep1 = new HttpProviderEndpoint();
         ep1.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
         ep1.setEndpoint("provider");
-        ep1.setLocationURI("http://localhost:8192/person/");
+        ep1.setLocationURI("http://localhost:"+port1+"/person/");
         ep1.setProxyHost("localhost");
-        ep1.setProxyPort(8193);
+        ep1.setProxyPort(port2);
 
         http.setEndpoints(new HttpEndpointType[] {ep0, ep1 });
         container.activateComponent(http, "http");
@@ -328,7 +331,7 @@ public class ProviderEndpointTest extend
         proxy = new Server();
         SelectChannelConnector connector = new SelectChannelConnector();
         connector.setHost("localhost");
-        connector.setPort(8193);
+        connector.setPort(port2);
         proxy.addConnector(connector);
         ServletHandler handler = new ServletHandler();
         handler.addServletWithMapping(AsyncProxyServlet.class, "/");
@@ -367,12 +370,12 @@ public class ProviderEndpointTest extend
         ep0.setEndpoint("consumer");
         ep0.setTargetService(new QName("http://servicemix.apache.org/samples/wsdl-first", "EchoService"));
         ep0.setTargetEndpoint("service");
-        ep0.setLocationURI("http://localhost:8192/person/");
+        ep0.setLocationURI("http://localhost:"+port1+"/person/");
 
         HttpProviderEndpoint ep1 = new HttpProviderEndpoint();
         ep1.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));
         ep1.setEndpoint("provider");
-        ep1.setLocationURI("http://localhost:8192/person/");
+        ep1.setLocationURI("http://localhost:"+port1+"/person/");
         ep1.setGzipRequest(true);
         ep1.setExpectGzippedResponse(true);
 
@@ -413,7 +416,7 @@ public class ProviderEndpointTest extend
         ep0.setEndpoint("consumer");
         ep0.setTargetService(new QName("http://servicemix.apache.org/samples/wsdl-first", "EchoService"));
         ep0.setTargetEndpoint("service");
-        ep0.setLocationURI("http://localhost:8192/PersonService/");
+        ep0.setLocationURI("http://localhost:"+port1+"/PersonService/");
 
         HttpSoapProviderEndpoint ep1 = new HttpSoapProviderEndpoint();
         ep1.setService(new QName("http://servicemix.apache.org/samples/wsdl-first", "PersonService"));

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/ServerManagerTest.java Tue Jan  4 13:43:46 2011
@@ -36,6 +36,10 @@ import org.mortbay.thread.QueuedThreadPo
 public class ServerManagerTest extends TestCase {
     private static transient Log log = LogFactory.getLog(ServerManagerTest.class);
 
+    String port1 = System.getProperty("http.port1");
+    String port2 = System.getProperty("http.port2");
+    String port3 = System.getProperty("http.port3");
+    
     protected JettyContextManager server;
     protected HttpConfiguration configuration;
 
@@ -56,51 +60,51 @@ public class ServerManagerTest extends T
         server.start();
 
         // Test first context
-        checkFail("http://localhost:8192/Service1/echo", null);
-        Object ctx1 = server.createContext("http://localhost:8192/Service1", new TestHttpProcessor());
-        request("http://localhost:8192/Service1/echo", null);
+        checkFail("http://localhost:"+port1+"/Service1/echo", null);
+        Object ctx1 = server.createContext("http://localhost:"+port1+"/Service1", new TestHttpProcessor());
+        request("http://localhost:"+port1+"/Service1/echo", null);
         server.remove(ctx1);
-        checkFail("http://localhost:8192/Service1/echo", null);
+        checkFail("http://localhost:"+port1+"/Service1/echo", null);
 
         // Test second context on the same host/port
-        checkFail("http://localhost:8192/Service2/echo", null);
-        Object ctx2 = server.createContext("http://localhost:8192/Service2", new TestHttpProcessor());
-        request("http://localhost:8192/Service2/echo", null);
+        checkFail("http://localhost:"+port1+"/Service2/echo", null);
+        Object ctx2 = server.createContext("http://localhost:"+port1+"/Service2", new TestHttpProcessor());
+        request("http://localhost:"+port1+"/Service2/echo", null);
         server.remove(ctx2);
-        checkFail("http://localhost:8192/Service2/echo", null);
+        checkFail("http://localhost:"+port1+"/Service2/echo", null);
 
         // Test third context on another port
-        checkFail("http://localhost:8193/echo", null);
-        Object ctx3 = server.createContext("http://localhost:8193", new TestHttpProcessor());
-        request("http://localhost:8193/echo", null);
+        checkFail("http://localhost:"+port2+"/echo", null);
+        Object ctx3 = server.createContext("http://localhost:"+port2, new TestHttpProcessor());
+        request("http://localhost:"+port2+"/echo", null);
         server.remove(ctx3);
-        checkFail("http://localhost:8193/echo", null);
+        checkFail("http://localhost:"+port2+"/echo", null);
     }
 
     public void testOverlappingPath() throws Exception {
         server.init();
         server.start();
 
-        server.createContext("http://localhost:8192/Service1/test1", new TestHttpProcessor());
+        server.createContext("http://localhost:"+port1+"/Service1/test1", new TestHttpProcessor());
 
-        server.createContext("http://localhost:8192/Service1/test1ex", new TestHttpProcessor());
+        server.createContext("http://localhost:"+port1+"/Service1/test1ex", new TestHttpProcessor());
 
         try {
-            server.createContext("http://localhost:8192/Service1/test1", new TestHttpProcessor());
+            server.createContext("http://localhost:"+port1+"/Service1/test1", new TestHttpProcessor());
             fail("Contexts are overlapping, an exception should have been thrown");
         } catch (Exception e) {
             // ok
         }
 
         try {
-            server.createContext("http://localhost:8192/Service1/test1/test", new TestHttpProcessor());
+            server.createContext("http://localhost:"+port1+"/Service1/test1/test", new TestHttpProcessor());
             fail("Contexts are overlapping, an exception should have been thrown");
         } catch (Exception e) {
             // ok
         }
 
         try {
-            server.createContext("http://localhost:8192/Service1", new TestHttpProcessor());
+            server.createContext("http://localhost:"+port1+"/Service1", new TestHttpProcessor());
             fail("Contexts are overlapping, an exception should have been thrown");
         } catch (Exception e) {
             // ok
@@ -112,7 +116,7 @@ public class ServerManagerTest extends T
         server.init();
         server.start();
 
-        Object contextObj = server.createContext("http://localhost:8192/Service1/test", new TestAltHttpProcessor());
+        Object contextObj = server.createContext("http://localhost:"+port1+"/Service1/test", new TestAltHttpProcessor());
    
         assertNotNull("Context should not be null", contextObj);
         assertTrue("Context should be started", ((ContextHandler)contextObj).isStarted());
@@ -124,7 +128,7 @@ public class ServerManagerTest extends T
         server.start();
  
         try {
-            server.createContext("https://localhost:8143/Service/test", new TestHttpProcessor());
+            server.createContext("https://localhost:"+port3+"/Service/test", new TestHttpProcessor());
             fail("Context for https URL with no SSL Params should not be created");
         } catch (IllegalArgumentException iae) {
             // test passes
@@ -137,7 +141,7 @@ public class ServerManagerTest extends T
         server.start();
  
         try {
-            server.createContext("file://localhost:8192/Service/test", new TestHttpProcessor());
+            server.createContext("file://localhost:"+port1+"/Service/test", new TestHttpProcessor());
             fail("Context for invalid protocol should not be created.");
         } catch (UnsupportedOperationException uoe) {
             // test passes

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/WsdlRoundtripTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/WsdlRoundtripTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/WsdlRoundtripTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/WsdlRoundtripTest.java Tue Jan  4 13:43:46 2011
@@ -42,6 +42,8 @@ import org.springframework.context.suppo
 public class WsdlRoundtripTest extends SpringTestSupport {
     private static transient Log log = LogFactory.getLog(WsdlRoundtripTest.class);
 
+    String port1 = System.getProperty("http.port1");
+    
     protected AbstractXmlApplicationContext createBeanFactory() {
         ClassPathXmlApplicationContext context = new ClassPathXmlApplicationContext(new String[] { "org/apache/servicemix/http/wsdlroundtrip.xml" }, false);
         context.setValidating(false);
@@ -50,7 +52,7 @@ public class WsdlRoundtripTest extends S
     }
 
     public void test() throws Exception {
-        GetMethod get = new GetMethod("http://localhost:8192/Service/?wsdl");
+        GetMethod get = new GetMethod("http://localhost:"+port1+"/Service/?wsdl");
         int state = new HttpClient().executeMethod(get);
         assertEquals(HttpServletResponse.SC_OK, state);
         Document doc = (Document) new SourceTransformer().toDOMNode(new StringSource(get.getResponseBodyAsString()));
@@ -59,7 +61,7 @@ public class WsdlRoundtripTest extends S
         WSDLFactory factory = WSDLFactory.newInstance();
         WSDLReader reader = factory.newWSDLReader();
         Definition def;
-        def = reader.readWSDL("http://localhost:8192/Service/?wsdl", doc);
+        def = reader.readWSDL("http://localhost:"+port1+"/Service/?wsdl", doc);
 
         StringWriter writer = new StringWriter();
         factory.newWSDLWriter().writeWSDL(def, writer);

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/addressing/AddressingConsumerTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/addressing/AddressingConsumerTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/addressing/AddressingConsumerTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/addressing/AddressingConsumerTest.java Tue Jan  4 13:43:46 2011
@@ -30,7 +30,8 @@ import org.springframework.util.xml.DomU
 public class AddressingConsumerTest extends TestCase {
 
     private static transient Log log = LogFactory.getLog(AddressingConsumerTest.class);
-
+    
+    String port1 = System.getProperty("http.port1");
     protected JBIContainer container;
 
     protected void setUp() throws Exception {
@@ -56,7 +57,7 @@ public class AddressingConsumerTest exte
         ep1.setService(new QName("uri:HelloWorld", "HelloService"));
         ep1.setEndpoint("HelloPortSoap11");
         ep1.setTargetService(new QName("urn:test", "echo"));
-        ep1.setLocationURI("http://localhost:8192/ep1/");
+        ep1.setLocationURI("http://localhost:"+port1+"/ep1/");
         ep1.setWsdl(new ClassPathResource("/org/apache/servicemix/http/HelloWorld-DOC-soap12.wsdl"));
         ep1.setValidateWsdl(false); // TODO: Soap 1.2 not handled yet
         ep1.setUseJbiWrapper(useJbiWrapper);
@@ -65,7 +66,7 @@ public class AddressingConsumerTest exte
         ep2.setService(new QName("uri:HelloWorld", "HelloService"));
         ep2.setEndpoint("HelloPortSoap12");
         ep2.setTargetService(new QName("urn:test", "echo"));
-        ep2.setLocationURI("http://localhost:8192/ep2/");
+        ep2.setLocationURI("http://localhost:"+port1+"/ep2/");
         ep2.setWsdl(new ClassPathResource("/org/apache/servicemix/http/HelloWorld-DOC-soap12.wsdl"));
         ep2.setValidateWsdl(false); // TODO: Soap 1.2 not handled yet
         ep2.setUseJbiWrapper(useJbiWrapper);
@@ -92,7 +93,7 @@ public class AddressingConsumerTest exte
         initEchoEndpoint();
         container.start();
 
-        URLConnection connection = new URL("http://localhost:8192/ep2/").openConnection();
+        URLConnection connection = new URL("http://localhost:"+port1+"/ep2/").openConnection();
         connection.setDoOutput(true);
         connection.setDoInput(true);
         OutputStream os = connection.getOutputStream();

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshalerTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshalerTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshalerTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/DefaultHttpProviderMarshalerTest.java Tue Jan  4 13:43:46 2011
@@ -15,6 +15,8 @@ import junit.framework.TestCase;
 
 public class DefaultHttpProviderMarshalerTest extends TestCase {
 
+        String port1 = System.getProperty("http.port1");
+        
 	private DefaultHttpProviderMarshaler defHttpProviderMarshaler;
 	
 	protected void setUp() throws Exception {
@@ -132,7 +134,7 @@ public class DefaultHttpProviderMarshale
 	public void testCreateRequestWithHeaders() throws Exception {
 		MockExchangeFactory mef = new MockExchangeFactory();
         MessageExchange me = mef.createInOnlyExchange();
-        me.setProperty("uri", "http://localhost:8192/Service1/someOperation");
+        me.setProperty("uri", "http://localhost:"+port1+"/Service1/someOperation");
         NormalizedMessage msg = me.createMessage();
         msg.setContent(new StringSource("<input>input message</input>"));
         SmxHttpExchange httpExchange = new SmxHttpExchange();

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/HttpProviderExpirationTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/HttpProviderExpirationTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/HttpProviderExpirationTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/HttpProviderExpirationTest.java Tue Jan  4 13:43:46 2011
@@ -44,6 +44,9 @@ import org.apache.servicemix.jbi.nmr.flo
  */
 public class HttpProviderExpirationTest extends TestCase {
 
+    String activemq = System.getProperty("activemq.port");
+    String port1 = System.getProperty("http.port1");
+    
     private JBIContainer jbi;
     private BrokerService broker;
 
@@ -51,7 +54,7 @@ public class HttpProviderExpirationTest 
         broker = new BrokerService();
         broker.setUseJmx(false);
         broker.setPersistent(false);
-        broker.addConnector("tcp://localhost:61616");
+        broker.addConnector("tcp://localhost:"+activemq);
         broker.start();
 
 
@@ -79,14 +82,14 @@ public class HttpProviderExpirationTest 
         HttpProviderEndpoint provider = new HttpProviderEndpoint();
         provider.setService(new QName("urn:test", "provider"));
         provider.setEndpoint("provider");
-        provider.setLocationURI("http://localhost:8192/expiration/");
+        provider.setLocationURI("http://localhost:"+port1+"/expiration/");
         provider.setProviderExpirationTime(100000);
 
         HttpConsumerEndpoint consumer = new HttpConsumerEndpoint();
         consumer.setService(new QName("urn:test", "consumer"));
         consumer.setEndpoint("consumer");
         consumer.setTargetService(new QName("urn:test", "echo"));
-        consumer.setLocationURI("http://localhost:8192/expiration/");
+        consumer.setLocationURI("http://localhost:"+port1+"/expiration/");
         consumer.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         consumer.setMarshaler(new DefaultHttpConsumerMarshaler() {
 
@@ -122,14 +125,14 @@ public class HttpProviderExpirationTest 
         HttpProviderEndpoint provider = new HttpProviderEndpoint();
         provider.setService(new QName("urn:test", "provider"));
         provider.setEndpoint("provider");
-        provider.setLocationURI("http://localhost:8192/expiration/");
+        provider.setLocationURI("http://localhost:"+port1+"/expiration/");
         provider.setProviderExpirationTime(10);
 
         HttpConsumerEndpoint consumer = new HttpConsumerEndpoint();
         consumer.setService(new QName("urn:test", "consumer"));
         consumer.setEndpoint("consumer");
         consumer.setTargetService(new QName("urn:test", "echo"));
-        consumer.setLocationURI("http://localhost:8192/expiration/");
+        consumer.setLocationURI("http://localhost:"+port1+"/expiration/");
         consumer.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         consumer.setMarshaler(new DefaultHttpConsumerMarshaler() {
 
@@ -167,14 +170,14 @@ public class HttpProviderExpirationTest 
         HttpProviderEndpoint provider = new HttpProviderEndpoint();
         provider.setService(new QName("urn:test", "provider"));
         provider.setEndpoint("provider");
-        provider.setLocationURI("http://localhost:8192/expiration/");
+        provider.setLocationURI("http://localhost:"+port1+"/expiration/");
         provider.setProviderExpirationTime(300000);
 
         HttpConsumerEndpoint consumer = new HttpConsumerEndpoint();
         consumer.setService(new QName("urn:test", "consumer"));
         consumer.setEndpoint("consumer");
         consumer.setTargetService(new QName("urn:test", "echo"));
-        consumer.setLocationURI("http://localhost:8192/expiration/");
+        consumer.setLocationURI("http://localhost:"+port1+"/expiration/");
         consumer.setDefaultMep(URI.create("http://www.w3.org/2004/08/wsdl/in-out"));
         consumer.setMarshaler(new DefaultHttpConsumerMarshaler() {
 

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/SerializedMarshalerTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/SerializedMarshalerTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/SerializedMarshalerTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/endpoints/SerializedMarshalerTest.java Tue Jan  4 13:43:46 2011
@@ -44,6 +44,8 @@ import org.springframework.remoting.supp
 
 public class SerializedMarshalerTest extends TestCase {
 
+    String port1 = System.getProperty("http.port1");
+    
     protected JBIContainer container;
     protected ComponentContext context;
 
@@ -68,7 +70,7 @@ public class SerializedMarshalerTest ext
         HttpConsumerEndpoint ep = new HttpConsumerEndpoint();
         ep.setService(new QName("urn:HttpConsumer", "HttpConsumer"));
         ep.setEndpoint("HttpConsumer");
-        ep.setLocationURI("http://localhost:8192/service/");
+        ep.setLocationURI("http://localhost:"+port1+"/service/");
         ep.setTargetService(new QName("urn:HttpInvoker", "Endpoint"));
 
         // Configure the SerializedMarshaler and specifiy it on the endpoint
@@ -114,7 +116,7 @@ public class SerializedMarshalerTest ext
         // Set up the Spring bean to call into the URL specified for the consumer endpoint
         HttpInvokerProxyFactoryBean pfb = new HttpInvokerProxyFactoryBean();
         pfb.setServiceInterface(Person.class);
-        pfb.setServiceUrl("http://localhost:8192/service/");
+        pfb.setServiceUrl("http://localhost:"+port1+"/service/");
         pfb.setHttpInvokerRequestExecutor(new SimpleHttpInvokerRequestExecutor());
         pfb.afterPropertiesSet();
 

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/security/HttpSecurityTest.java
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/security/HttpSecurityTest.java?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/security/HttpSecurityTest.java (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/java/org/apache/servicemix/http/security/HttpSecurityTest.java Tue Jan  4 13:43:46 2011
@@ -40,6 +40,8 @@ import org.springframework.context.suppo
 
 public class HttpSecurityTest extends SpringTestSupport {
     private static transient Log log =  LogFactory.getLog(HttpSecurityTest.class);
+    
+    String port1 = System.getProperty("http.port1");
 
     static {
         String path = System.getProperty("java.security.auth.login.config");
@@ -89,7 +91,7 @@ public class HttpSecurityTest extends Sp
             new AuthScope(AuthScope.ANY),
             new UsernamePasswordCredentials(username, password));
         
-        PostMethod method = new PostMethod("http://localhost:8192/Service/");
+        PostMethod method = new PostMethod("http://localhost:"+port1+"/Service/");
         try {
             method.setDoAuthentication(true);
             method.setRequestEntity(new StringRequestEntity("<hello>world</hello>"));
@@ -108,7 +110,7 @@ public class HttpSecurityTest extends Sp
         FileUtil.copyInputStream(getClass().getResourceAsStream("request.xml"), out);
         String request = out.toString();
         HttpClient client = new HttpClient();
-        PostMethod method = new PostMethod("http://localhost:8192/WSSec/");
+        PostMethod method = new PostMethod("http://localhost:"+port1+"/WSSec/");
         try {
             method.setDoAuthentication(true);
             method.setRequestEntity(new StringRequestEntity(request));
@@ -129,7 +131,7 @@ public class HttpSecurityTest extends Sp
         FileUtil.copyInputStream(getClass().getResourceAsStream("request-bc.xml"), out);
         String request = out.toString();
         HttpClient client = new HttpClient();
-        PostMethod method = new PostMethod("http://localhost:8192/WSSec/");
+        PostMethod method = new PostMethod("http://localhost:"+port1+"/WSSec/");
         try {
             method.setDoAuthentication(true);
             method.setRequestEntity(new StringRequestEntity(request));
@@ -153,7 +155,7 @@ public class HttpSecurityTest extends Sp
         FileUtil.copyInputStream(getClass().getResourceAsStream("request-uu.xml"), out);
         String request = out.toString();
         HttpClient client = new HttpClient();
-        PostMethod method = new PostMethod("http://localhost:8192/WSSec/");
+        PostMethod method = new PostMethod("http://localhost:"+port1+"/WSSec/");
         try {
             method.setDoAuthentication(true);
             method.setRequestEntity(new StringRequestEntity(request));

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/resources/consumer/http.wsdl
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/resources/consumer/http.wsdl?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/resources/consumer/http.wsdl (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/resources/consumer/http.wsdl Tue Jan  4 13:43:46 2011
@@ -39,14 +39,14 @@
 
     <service name='ConsumerInOnly'>
         <port name='TestEndpoint' binding='tns:ConsumerSoapBinding'>
-            <soap:address location="http://localhost:8192/InOnly"/>
+            <soap:address location="http://localhost:${port1}/InOnly"/>
             <jbi:endpoint role="consumer" defaultMep='in-only'/>
         </port>
     </service>
 
     <service name='ConsumerInOut'>
         <port name='TestEndpoint' binding='tns:ConsumerHttpBinding'>
-            <http:address location="http://localhost:8192/InOut"/>
+            <http:address location="http://localhost:${port1}/InOut"/>
             <jbi:endpoint role="consumer" defaultMep='in-out'/>
         </port>
     </service>

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/addressing.xml Tue Jan  4 13:43:46 2011
@@ -34,13 +34,13 @@
                              endpoint="dummy"
                              role="consumer" 
                              soap="true"
-                             locationURI="http://localhost:8192/Service/"
+                             locationURI="http://localhost:${port1}/Service/"
                              defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
 
               <http:endpoint service="test:MyProviderService"
                              endpoint="myProvider"
                              role="provider" 
-                             locationURI="http://localhost:8192/Service/" />
+                             locationURI="http://localhost:${port1}/Service/" />
             </http:endpoints>
           </http:component>
         </sm:component>

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/security/secure.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/security/secure.xml?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/security/secure.xml (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/security/secure.xml Tue Jan  4 13:43:46 2011
@@ -47,7 +47,7 @@
 	                         endpoint="http"
 	                         targetService="ex:receiver"
 	                         role="consumer"
-	                         locationURI="http://localhost:8192/Service/"
+	                         locationURI="http://localhost:"${port1}"/Service/"
 	          				 authMethod="basic" 
 	          				 defaultMep="http://www.w3.org/2004/08/wsdl/in-only">
               </http:endpoint>
@@ -55,7 +55,7 @@
                              endpoint="http-wssec"
                              targetService="ex:receiver"
                              role="consumer"
-                             locationURI="http://localhost:8192/WSSec/"
+                             locationURI="http://localhost:"${port1}"/WSSec/"
                              defaultMep="http://www.w3.org/2004/08/wsdl/in-only"
                              soap="true">
                  <http:policies>

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring-web.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring-web.xml?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring-web.xml (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring-web.xml Tue Jan  4 13:43:46 2011
@@ -35,7 +35,7 @@
         	  <http:endpoint service="test:Hello"
         	                 endpoint="testService"
         	                 role="consumer" 
-        	                 locationURI="http://localhost:8193/Service/"
+        	                 locationURI="http://localhost:${port2}/Service/"
                              defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
                              wsdlResource="classpath:org/apache/servicemix/http/test.wsdl"
                              soap="true" />

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring.xml?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring.xml (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/spring.xml Tue Jan  4 13:43:46 2011
@@ -35,19 +35,19 @@
             	  <http:endpoint service="test:MyConsumerService"
             	    endpoint="myConsumer"
             	    role="consumer" 
-            	    locationURI="http://localhost:18192/Service/"
+            	    locationURI="http://localhost:${port9}/Service/"
             	    defaultMep="http://www.w3.org/2004/08/wsdl/in-out" />
             	  
             	  <http:endpoint service="test:MyProviderService"
             	    endpoint="myProvider"
             	    role="provider" 
-            	    locationURI="http://localhost:18192/Service/" />
+            	    locationURI="http://localhost:${port9}/Service/" />
             	  
                   <!-- START SNIPPET: ssl -->
             	  <http:endpoint service="testSsl:MyConsumerService"
             	    endpoint="myConsumer"
             	    role="consumer" 
-            	    locationURI="https://localhost:8193/Service/"
+            	    locationURI="https://localhost:${port2}/Service/"
             	    defaultMep="http://www.w3.org/2004/08/wsdl/in-out">
             	    <http:ssl>
             	      <http:sslParameters keyStore="classpath:org/apache/servicemix/http/server.keystore"
@@ -58,7 +58,7 @@
             	  <http:endpoint service="testSsl:MyProviderService"
             	    endpoint="myProvider"
             	    role="provider" 
-            	    locationURI="https://localhost:8193/Service/">
+            	    locationURI="https://localhost:${port2}/Service/">
             	    <http:ssl>
             	      <http:sslParameters keyStore="classpath:org/apache/servicemix/http/server.keystore"
             	        keyStorePassword="password"

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/test.wsdl
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/test.wsdl?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/test.wsdl (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/test.wsdl Tue Jan  4 13:43:46 2011
@@ -62,7 +62,7 @@
   </wsdl:binding>
   <wsdl:service name="Hello">
     <wsdl:port name="testService" binding="tns:testServiceBinding">
-      <wsdlsoap:address location="http://localhost:8194/Service/"/>
+      <wsdlsoap:address location="http://localhost:${port3}/Service/"/>
     </wsdl:port>
   </wsdl:service>
 </wsdl:definitions>

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/wsdlroundtrip.xml
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/wsdlroundtrip.xml?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/wsdlroundtrip.xml (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/resources/org/apache/servicemix/http/wsdlroundtrip.xml Tue Jan  4 13:43:46 2011
@@ -32,7 +32,7 @@
 								service="test:Hello"
 								endpoint="testService" 
 								role="consumer"
-								locationURI="http://localhost:8192/Service"
+								locationURI="http://localhost:${port1}/Service"
 								wsdlResource="classpath:org/apache/servicemix/http/test.wsdl"
 								defaultMep="http://www.w3.org/2004/08/wsdl/in-out"
 								soapVersion="1.1" 

Modified: servicemix/components/trunk/bindings/servicemix-http/src/test/resources/person.wsdl
URL: http://svn.apache.org/viewvc/servicemix/components/trunk/bindings/servicemix-http/src/test/resources/person.wsdl?rev=1055035&r1=1055034&r2=1055035&view=diff
==============================================================================
--- servicemix/components/trunk/bindings/servicemix-http/src/test/resources/person.wsdl (original)
+++ servicemix/components/trunk/bindings/servicemix-http/src/test/resources/person.wsdl Tue Jan  4 13:43:46 2011
@@ -92,7 +92,7 @@
 
 	<wsdl:service name="PersonService">
     	<wsdl:port binding="tns:PersonSOAPBinding" name="soap">
-           <soap:address location="http://localhost:8192/PersonService/" />
+           <soap:address location="http://localhost:${port1}/PersonService/" />
        </wsdl:port>
    </wsdl:service>
 



Mime
View raw message