cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From lmo...@apache.org
Subject svn commit: r979862 [15/19] - in /cxf/sandbox/oauth_1.0a: ./ api/ api/src/main/java/org/apache/cxf/ api/src/main/java/org/apache/cxf/endpoint/ api/src/main/java/org/apache/cxf/phase/ api/src/main/java/org/apache/cxf/ws/addressing/ api/src/main/java/org...
Date Tue, 27 Jul 2010 20:47:12 GMT
Modified: cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml (original)
+++ cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/continuations/jms_test_config.xml Tue Jul 27 20:46:55 2010
@@ -28,19 +28,20 @@
 http://cxf.apache.org/transports/jms http://cxf.apache.org/schemas/configuration/jms.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
     
     <jms:conduit name="{http://cxf.apache.org/systest/jaxws}HelloContinuationPort.jms-conduit">
       <jms:clientConfig clientReceiveTimeout="500000" messageTimeToLive="500000"/>
       <jms:address jndiConnectionFactoryName="ConnectionFactory" 
                    jndiDestinationName="dynamicQueues/test.jmstransport.text">
                    <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
-                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:${testutil.ports.EmbeddedJMSBrokerLauncher}"/>
                </jms:address>
       <jms:jmsConfig-ref>jmsConf1</jms:jmsConfig-ref>
     </jms:conduit>
     
    <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
-  	p:brokerURL="tcp://localhost:61500"/>
+  	p:brokerURL="tcp://localhost:${testutil.ports.EmbeddedJMSBrokerLauncher}"/>
   
   <bean id="singleConnectionFactory"
     class="org.springframework.jms.connection.SingleConnectionFactory" destroy-method="destroy">
@@ -56,7 +57,7 @@ http://www.springframework.org/schema/be
       <jms:address jndiConnectionFactoryName="ConnectionFactory" 
                    jndiDestinationName="dynamicQueues/test.jmstransport.text">
                    <jms:JMSNamingProperty name="java.naming.factory.initial" value="org.apache.activemq.jndi.ActiveMQInitialContextFactory"/>
-                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:61500"/>
+                   <jms:JMSNamingProperty name="java.naming.provider.url" value="tcp://localhost:${testutil.ports.EmbeddedJMSBrokerLauncher}"/>
                </jms:address>
       <jms:jmsConfig-ref>jmsConf2</jms:jmsConfig-ref>  
   </jms:destination>

Modified: cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/tx/JMSTransactionClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/tx/JMSTransactionClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/tx/JMSTransactionClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/tx/JMSTransactionClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -38,8 +38,9 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class JMSTransactionClientServerTest extends AbstractBusClientServerTestBase {
-    
     protected static boolean serversStarted;
+    static final String JMS_PORT = EmbeddedJMSBrokerLauncher.PORT;
+
 
     @Before
     public void startServers() throws Exception {
@@ -78,7 +79,8 @@ public class JMSTransactionClientServerT
         QName portName = getPortName(new QName("http://apache.org/hello_world_doc_lit", "SoapPort2"));
         URL wsdl = getWSDLURL("/wsdl/hello_world_doc_lit.wsdl");
         assertNotNull(wsdl);
-
+        EmbeddedJMSBrokerLauncher.updateWsdlExtensors(getBus(), wsdl.toString());
+        
         SOAPService2 service = new SOAPService2(wsdl, serviceName);
         assertNotNull(service);
 
@@ -93,7 +95,7 @@ public class JMSTransactionClientServerT
 
         JMSConfiguration jmsConfig = new JMSConfiguration();
         ConnectionFactory connectionFactory
-            = new org.apache.activemq.ActiveMQConnectionFactory("tcp://localhost:61500");
+            = new org.apache.activemq.ActiveMQConnectionFactory("tcp://localhost:" + JMS_PORT);
         jmsConfig.setConnectionFactory(connectionFactory);
         jmsConfig.setTargetDestination("greeter.queue.noaop");
         jmsConfig.setPubSubDomain(false);

Modified: cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/tx/jms_server_config.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/tx/jms_server_config.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/tx/jms_server_config.xml (original)
+++ cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/jms/tx/jms_server_config.xml Tue Jul 27 20:46:55 2010
@@ -34,6 +34,8 @@ http://cxf.apache.org/jaxws http://cxf.a
  <import resource="classpath:META-INF/cxf/cxf-extension-soap.xml" /> 
  <import resource="classpath:META-INF/cxf/cxf-extension-jms.xml" />
  
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+ 
  <jaxws:endpoint implementor="#transactionalImplementor" 
  	implementorClass="org.apache.hello_world_doc_lit.Greeter"
  	wsdlLocation="testutils/hello_world_doc_lit.wsdl"
@@ -47,7 +49,7 @@ http://cxf.apache.org/jaxws http://cxf.a
     
   
   <bean id="jmsConnectionFactory" class="org.apache.activemq.ActiveMQConnectionFactory"
-  	p:brokerURL="tcp://localhost:61500"
+  	p:brokerURL="tcp://localhost:${testutil.ports.EmbeddedJMSBrokerLauncher}"
   />
   
   <bean id="singleConnectionFactory"

Modified: cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/multitransport/MultiTransportClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/multitransport/MultiTransportClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/multitransport/MultiTransportClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/multitransport/MultiTransportClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -41,6 +41,8 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class MultiTransportClientServerTest extends AbstractBusClientServerTestBase {
+    static final String JMS_PORT = EmbeddedJMSBrokerLauncher.PORT;
+    static final String PORT = allocatePort(MyServer.class);
     static final Logger LOG = LogUtils.getLogger(MultiTransportClientServerTest.class);
     private final QName serviceName = new QName(
                                       "http://apache.org/hello_world_doc_lit",
@@ -50,8 +52,9 @@ public class MultiTransportClientServerT
 
         protected void run() {
             Object implementor = new HTTPGreeterImpl();
-            String address = "http://localhost:9001/SOAPDocLitService/SoapPort";
+            String address = "http://localhost:" + PORT + "/SOAPDocLitService/SoapPort";
             Endpoint.publish(address, implementor);
+            EmbeddedJMSBrokerLauncher.updateWsdlExtensors(getBus(), "testutils/hello_world_doc_lit.wsdl");
             implementor = new JMSGreeterImpl();
             Endpoint.publish(null, implementor);
         }
@@ -94,6 +97,7 @@ public class MultiTransportClientServerT
         QName portName2 = new QName("http://apache.org/hello_world_doc_lit", "JMSPort");
         URL wsdl = getClass().getResource("/wsdl/hello_world_doc_lit.wsdl");
         assertNotNull(wsdl);
+        EmbeddedJMSBrokerLauncher.updateWsdlExtensors(getBus(), wsdl.toString());
 
         MultiTransportService service = new MultiTransportService(wsdl, serviceName);
         assertNotNull(service);
@@ -102,6 +106,7 @@ public class MultiTransportClientServerT
         String response2 = new String("Bonjour");
         try {
             Greeter greeter = service.getPort(portName1, Greeter.class);
+            updateAddressPort(greeter, PORT);
             for (int idx = 0; idx < 5; idx++) {
                 String greeting = greeter.greetMe("Milestone-" + idx);
                 assertNotNull("no response received from service", greeting);

Modified: cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletClientTest.java Tue Jul 27 20:46:55 2010
@@ -36,8 +36,10 @@ import org.junit.Test;
 
 
 public class NoSpringServletClientTest extends AbstractBusClientServerTestBase {
+    private static final String PORT = NoSpringServletServer.PORT;
+    
     private final QName portName = new QName("http://apache.org/hello_world_soap_http", "SoapPort");
-    private final String serviceURL = "http://localhost:9000/soap/";
+    private final String serviceURL = "http://localhost:" + PORT + "/soap/";
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", launchServer(NoSpringServletServer.class));

Modified: cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/transports/src/test/java/org/apache/cxf/systest/servlet/NoSpringServletServer.java Tue Jul 27 20:46:55 2010
@@ -25,12 +25,15 @@ import org.apache.cxf.BusFactory;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.apache.cxf.transport.servlet.CXFNonSpringServlet;
 import org.apache.hello_world_soap_http.GreeterImpl;
-import org.mortbay.jetty.Server;
-import org.mortbay.jetty.handler.ContextHandlerCollection;
-import org.mortbay.jetty.servlet.Context;
-import org.mortbay.jetty.servlet.ServletHolder;
+import org.eclipse.jetty.server.Server;
+import org.eclipse.jetty.server.handler.ContextHandlerCollection;
+import org.eclipse.jetty.servlet.ServletContextHandler;
+import org.eclipse.jetty.servlet.ServletHolder;
 
 public class NoSpringServletServer extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(NoSpringServletServer.class);
+
+    
     Server httpServer;
     @Override
     protected void run() {
@@ -38,11 +41,12 @@ public class NoSpringServletServer exten
         String busFactory = System.getProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME);
         System.setProperty(BusFactory.BUS_FACTORY_PROPERTY_NAME, "org.apache.cxf.bus.CXFBusFactory");
         try {
-            httpServer = new Server(9000);
+            httpServer = new Server(Integer.parseInt(PORT));
             ContextHandlerCollection contexts = new ContextHandlerCollection();
             httpServer.setHandler(contexts);
 
-            Context root = new Context(contexts, "/", Context.SESSIONS);
+            ServletContextHandler root = new ServletContextHandler(contexts, "/",
+                                                                   ServletContextHandler.SESSIONS);
 
             CXFNonSpringServlet cxf = new CXFNonSpringServlet();
             ServletHolder servlet = new ServletHolder(cxf);

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/pom.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/pom.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/pom.xml (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/pom.xml Tue Jul 27 20:46:55 2010
@@ -112,8 +112,8 @@
     </profiles>
     <dependencies>
         <dependency>
-            <groupId>org.apache.geronimo.specs</groupId>
-            <artifactId>geronimo-servlet_2.5_spec</artifactId>
+            <groupId>${servlet-api.group}</groupId>
+            <artifactId>${servlet-api.artifact}</artifactId>
         </dependency>
         <dependency>
             <groupId>org.apache.cxf</groupId>
@@ -388,7 +388,7 @@
             <artifactId>geronimo-j2ee-connector_1.5_spec</artifactId>
         </dependency>
         <dependency>
-            <groupId>ant</groupId>
+            <groupId>org.apache.ant</groupId>
             <artifactId>ant</artifactId>
             <scope>test</scope>
         </dependency>

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/basicDOCBare/DOCBareClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -38,7 +38,8 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class DOCBareClientServerTest extends AbstractBusClientServerTestBase {    
-
+    public static final String PORT = Server.PORT;
+    
     private final QName serviceName = new QName("http://apache.org/hello_world_doc_lit_bare",
                                                 "SOAPService");
     private final QName portName = new QName("http://apache.org/hello_world_doc_lit_bare", "SoapPort");
@@ -60,6 +61,7 @@ public class DOCBareClientServerTest ext
 
         PutLastTradedPricePortType putLastTradedPrice = service.getPort(portName,
                                                                         PutLastTradedPricePortType.class);
+        updateAddressPort(putLastTradedPrice, PORT);
         String response = putLastTradedPrice.bareNoParam();
         assertEquals("testResponse", response);
         
@@ -109,6 +111,7 @@ public class DOCBareClientServerTest ext
 
         PutLastTradedPricePortType port = service.getPort(portName,
                                                           PutLastTradedPricePortType.class);
+        updateAddressPort(port, PORT);
         String result = port.nillableParameter(null);
         assertNull(result);
     } 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/basicDOCBare/Server.java Tue Jul 27 20:46:55 2010
@@ -30,12 +30,12 @@ import javax.xml.ws.Endpoint;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
-
+    public static final String PORT = allocatePort(Server.class);
 
     protected void run()  {
         System.setProperty("org.apache.cxf.bus.factory", "org.apache.cxf.bus.CXFBusFactory");  
         Object implementor = new PutLastTradedPriceImpl();
-        String address = "http://localhost:9107/SOAPDocLitBareService/SoapPort";      
+        String address = "http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPort";      
         Endpoint ep = Endpoint.create(implementor);
         Map<String, Object> props = new HashMap<String, Object>(2);
         props.put(Endpoint.WSDL_SERVICE, new QName("http://apache.org/hello_world_doc_lit_bare", 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusShutdownTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusShutdownTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusShutdownTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/bus/BusShutdownTest.java Tue Jul 27 20:46:55 2010
@@ -29,6 +29,7 @@ import javax.xml.ws.Endpoint;
 import org.apache.cxf.Bus;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.hello_world_soap_http.Greeter;
 import org.apache.hello_world_soap_http.GreeterImpl;
 import org.apache.hello_world_soap_http.SOAPService;
@@ -40,6 +41,9 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class BusShutdownTest extends Assert {
+    public static final String PORT = TestUtil.getPortNumber(BusShutdownTest.class);
+
+    
     @BeforeClass
     public static void setKeepAliveProperty() {
         TestUtilities.setKeepAliveSystemProperty(false);
@@ -59,7 +63,7 @@ public class BusShutdownTest extends Ass
         URL wsdlUrl = getClass().getResource("/wsdl/hello_world.wsdl");
         assertNotNull("wsdl resource was not found", wsdlUrl); 
         // Since this test always fails in linux box, try to use other port
-        String serverAddr = "http://localhost:40000/greeter/port";
+        String serverAddr = "http://localhost:" + PORT + "/greeter/port";
         makeTwoWayCallOnNewBus(wsdlUrl, serverAddr);
         
         

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/CallbackClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/CallbackClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/CallbackClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/CallbackClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -22,37 +22,30 @@ package org.apache.cxf.systest.callback;
 import java.net.URL;
 
 import javax.xml.namespace.QName;
-import javax.xml.transform.Source;
 import javax.xml.ws.Endpoint;
+import javax.xml.ws.EndpointReference;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
 
 import org.apache.callback.SOAPService;
 import org.apache.callback.ServerPortType;
 import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
-import org.apache.cxf.ws.addressing.EndpointReferenceType;
-import org.apache.cxf.wsdl.EndpointReferenceUtils;
 import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class CallbackClientServerTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = Server.PORT;
+    public static final String CB_PORT = allocatePort(CallbackClientServerTest.class);
+    
     private static final QName SERVICE_NAME 
         = new QName("http://apache.org/callback", "SOAPService");
-    private static final QName SERVICE_NAME_CALLBACK 
-        = new QName("http://apache.org/callback", "CallbackService");
 
     private static final QName PORT_NAME 
         = new QName("http://apache.org/callback", "SOAPPort");
-
-    private static final QName PORT_NAME_CALLBACK 
-        = new QName("http://apache.org/callback", "CallbackPort");
-    
-    private static final QName PORT_TYPE_CALLBACK
-        = new QName("http://apache.org/callback", "CallbackPortType");
     
     
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(Server.class));
+        assertTrue("server did not launch correctly", launchServer(Server.class, true));
     }
 
     @Test
@@ -60,28 +53,18 @@ public class CallbackClientServerTest ex
 
                     
         Object implementor = new CallbackImpl();
-        String address = "http://localhost:9005/CallbackContext/CallbackPort";
-        Endpoint.publish(address, implementor);
+        String address = "http://localhost:" + CB_PORT + "/CallbackContext/CallbackPort";
+        Endpoint ep = Endpoint.publish(address, implementor);
     
         URL wsdlURL = getClass().getResource("/wsdl/basic_callback_test.wsdl");
     
         SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
         ServerPortType port = ss.getPort(PORT_NAME, ServerPortType.class);
+        updateAddressPort(port, PORT);
    
-        EndpointReferenceType ref = null;
-        try {
-            ref = EndpointReferenceUtils.getEndpointReference(wsdlURL, 
-                                                              SERVICE_NAME_CALLBACK, 
-                                                              PORT_NAME_CALLBACK.getLocalPart());
-            EndpointReferenceUtils.setInterfaceName(ref, PORT_TYPE_CALLBACK);
-        } catch (Exception e) {
-            e.printStackTrace();
-        }
-        
-       
-        Source source = EndpointReferenceUtils.convertToXML(ref);
-        W3CEndpointReference  w3cEpr = new W3CEndpointReference(source);              
-        String resp = port.registerCallback(w3cEpr);
+
+        EndpointReference w3cEpr = ep.getEndpointReference();              
+        String resp = port.registerCallback((W3CEndpointReference)w3cEpr);
         assertEquals("registerCallback called", resp);
             
     }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/Server.java Tue Jul 27 20:46:55 2010
@@ -25,10 +25,11 @@ import javax.xml.ws.Endpoint;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(Server.class);
 
     protected void run() {
         Object implementor = new ServerImpl();
-        String address = "http://localhost:9007/SoapContext/SoapPort";
+        String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
         Endpoint.publish(address, implementor);
         
     }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/ServerImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/ServerImpl.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/ServerImpl.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/callback/ServerImpl.java Tue Jul 27 20:46:55 2010
@@ -20,11 +20,10 @@
 
 package org.apache.cxf.systest.callback;
 
-import java.net.URL;
-
 import javax.annotation.Resource;
 import javax.xml.namespace.QName;
 import javax.xml.ws.Service;
+import javax.xml.ws.soap.SOAPBinding;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
 
 import org.apache.callback.CallbackPortType;
@@ -62,9 +61,8 @@ public class ServerImpl implements Serve
             EndpointReferenceType callback = VersionTransformer.convertToInternal(w3cRef);
         
             QName interfaceName = EndpointReferenceUtils.getInterfaceName(callback, bus);
-            String wsdlLocation = EndpointReferenceUtils.getWSDLLocation(callback);
             QName serviceName = EndpointReferenceUtils.getServiceName(callback, bus);
-
+            String address = EndpointReferenceUtils.getAddress(callback);
             
             String portString = EndpointReferenceUtils.getPortName(callback);
             
@@ -83,9 +81,8 @@ public class ServerImpl implements Serve
                 ex.printStackTrace();
             }
             
-            URL wsdlURL = new URL(wsdlLocation);            
-            Service service = Service.create(wsdlURL, serviceName);
-            
+            Service service = Service.create(null, serviceName);
+            service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING, address);
             CallbackPortType port =  (CallbackPortType)service.getPort(portName, sei);
 
             port.serverSayHi("Sean");

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java Tue Jul 27 20:46:55 2010
@@ -22,6 +22,7 @@ package org.apache.cxf.systest.coloc;
 import java.net.URL;
 
 import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
 import javax.xml.ws.Endpoint;
 import javax.xml.ws.Service;
 
@@ -30,12 +31,15 @@ import org.apache.cxf.Bus;
 import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.testutil.common.TestUtil;
 
 import org.junit.After;
 import org.junit.Assert;
 import org.junit.Before;
 
 public abstract class AbstractColocTest extends Assert {
+    public static final String PORT = TestUtil.getPortNumber(AbstractColocTest.class);
+    
     /**
      * Cxf Bus
      */
@@ -103,7 +107,10 @@ public abstract class AbstractColocTest 
         Service srv = Service.create(
                          AbstractColocTest.class.getResource(wsdlLocation),
                          serviceName);
-        return srv.getPort(portName, cls);
+        T t = srv.getPort(portName, cls);
+        ((BindingProvider)t).getRequestContext()
+            .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, getTransportURI());
+        return t;
     }
     /**
      * @return the greeter impl object

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java Tue Jul 27 20:46:55 2010
@@ -53,11 +53,10 @@ public abstract class AbstractWrappedDoc
     @Before
     public void setUp() throws Exception {
         super.setUp();
-        port = getPort(
-                         getServiceQname(),
-                         getPortQName(),
-                         getWsdlLocation(),
-                         Greeter.class);
+        port = getPort(getServiceQname(),
+                       getPortQName(),
+                       getWsdlLocation(),
+                       Greeter.class);
     }
 
     @Test

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java Tue Jul 27 20:46:55 2010
@@ -26,7 +26,7 @@ import org.junit.Test;
 
 
 public class ColocHeaderDocLitTest extends AbstractHeaderServiceDocLitTest {
-    static final String TRANSPORT_URI = "http://localhost:9111/headers";
+    static final String TRANSPORT_URI = "http://localhost:" + PORT + "/headers";
 
     private Log logger = LogFactory.getLog(ColocHeaderDocLitTest.class);
 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java Tue Jul 27 20:46:55 2010
@@ -25,7 +25,7 @@ import org.junit.Test;
 
 
 public class ColocHeaderRpcLitTest extends AbstractHeaderServiceRpcLitTest {
-    static final String TRANSPORT_URI = "http://localhost:9222/headers";
+    static final String TRANSPORT_URI = "http://localhost:" + PORT + "/headers";
 
     private Log logger = LogFactory.getLog(ColocHeaderRpcLitTest.class);
 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java Tue Jul 27 20:46:55 2010
@@ -26,7 +26,7 @@ import org.junit.Test;
 
 
 public class ColocWrappedDocLitTest extends AbstractWrappedDocLitTest {
-    static final String TRANSPORT_URI = "http://localhost:9000/SoapContext/SoapPort";
+    static final String TRANSPORT_URI = "http://localhost:" + PORT + "/SoapContext/SoapPort";
 
     private Log logger = LogFactory.getLog(ColocWrappedDocLitTest.class);
 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java Tue Jul 27 20:46:55 2010
@@ -26,11 +26,12 @@ import org.apache.cxf.testutil.common.Ab
 
 
 public class Server extends AbstractBusTestServerBase {
+    public static final String PERSIST_PORT = allocatePort(Server.class);
     
     protected void run()  {
         System.out.println("Starting Server");
         System.setProperty("com.sun.CORBA.POA.ORBServerId", "1");
-        System.setProperty("com.sun.CORBA.POA.ORBPersistentServerPort", "40000");
+        System.setProperty("com.sun.CORBA.POA.ORBPersistentServerPort", PERSIST_PORT);
         new SpringBusFactory().createBus("org/apache/cxf/systest/corba/hello_world_server.xml");
         Object implementor = new BaseGreeterImpl();
         String address = "file:./HelloWorld.ref";

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java Tue Jul 27 20:46:55 2010
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.systest.cxf993;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 import javax.xml.namespace.QName;
 
@@ -30,7 +31,7 @@ import testnotification.NotificationServ
 import testnotification.SendNotification;
 
 public class Cxf993Test extends AbstractBusClientServerTestBase {
-
+    public static final String PORT = Server.PORT;
     private final QName serviceName = new QName("urn://testnotification", "NotificationService");
 
     @BeforeClass
@@ -43,13 +44,16 @@ public class Cxf993Test extends Abstract
         assertEquals("dummy", getPort().sendNotification(new SendNotification()));
     }
 
-    private NotificationServicePort getPort() {
+    private NotificationServicePort getPort() 
+        throws NumberFormatException, MalformedURLException {
         URL wsdl = getClass().getResource("/wsdl_systest/cxf-993.wsdl");
         assertNotNull("WSDL is null", wsdl);
 
         NotificationService service = new NotificationService(wsdl, serviceName);
         assertNotNull("Service is null ", service);
 
-        return service.getNotificationServicePort();
+        NotificationServicePort port =  service.getNotificationServicePort();
+        updateAddressPort(port, PORT);
+        return port;
     }
 }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java Tue Jul 27 20:46:55 2010
@@ -24,10 +24,11 @@ import javax.xml.ws.Endpoint;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(Server.class);
 
     protected void run()  {
         Object implementor = new Cxf993Impl();
-        String address = "http://localhost:9018/notification";
+        String address = "http://localhost:" + PORT + "/notification";
         Endpoint.publish(address, implementor);
     }
 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/HttpNumberFactoryImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/HttpNumberFactoryImpl.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/HttpNumberFactoryImpl.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/HttpNumberFactoryImpl.java Tue Jul 27 20:46:55 2010
@@ -63,7 +63,7 @@ public class HttpNumberFactoryImpl exten
         EndpointImpl ep = 
             new EndpointImpl(BusFactory.getDefaultBus(), servant, bindingId, wsdlLocation);
         ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPort"));
-        ep.publish();
+        ep.publish(NUMBER_SERVANT_ADDRESS_ROOT);
         templateEpr = ep.getServer().getDestination().getAddress();        
     }
 }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/ManualHttpMulitplexClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -47,6 +47,7 @@ import org.junit.Test;
 
 
 public class ManualHttpMulitplexClientServerTest extends AbstractBusClientServerTestBase {
+    static final String FACTORY_ADDRESS = NumberFactoryImpl.FACTORY_ADDRESS;
     
     public static class Server extends AbstractBusTestServerBase {        
 
@@ -80,6 +81,7 @@ public class ManualHttpMulitplexClientSe
     
         NumberFactoryService service = new NumberFactoryService();
         NumberFactory nfact = service.getNumberFactoryPort();
+        updateAddressPort(nfact, NumberFactoryImpl.PORT);
         
         W3CEndpointReference w3cEpr = nfact.create("2");        
         assertNotNull("reference", w3cEpr);
@@ -121,7 +123,8 @@ public class ManualHttpMulitplexClientSe
         
         NumberFactoryService service = new NumberFactoryService();
         NumberFactory factory = service.getNumberFactoryPort();
-         
+        updateAddressPort(factory, NumberFactoryImpl.PORT);
+
         
         W3CEndpointReference w3cEpr = factory.create("20");
         EndpointReferenceType numberTwoRef = VersionTransformer.convertToInternal(w3cEpr); 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/ManualNumberFactoryImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/ManualNumberFactoryImpl.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/ManualNumberFactoryImpl.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/ManualNumberFactoryImpl.java Tue Jul 27 20:46:55 2010
@@ -53,7 +53,7 @@ public class ManualNumberFactoryImpl ext
         EndpointImpl ep = 
             new EndpointImpl(BusFactory.getDefaultBus(), servant, bindingId, wsdlLocation);
         ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPort"));
-        ep.publish();
+        ep.publish(NUMBER_SERVANT_ADDRESS_ROOT);
         templateEpr = ep.getServer().getDestination().getAddress();
     }
 }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/MultiplexClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/MultiplexClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/MultiplexClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/MultiplexClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -26,6 +26,7 @@ import java.util.Map;
 import javax.xml.ws.Endpoint;
 import javax.xml.ws.wsaddressing.W3CEndpointReference;
 
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.factory_pattern.Number;
 import org.apache.cxf.factory_pattern.NumberFactory;
 import org.apache.cxf.factory_pattern.NumberFactoryService;
@@ -42,6 +43,8 @@ import org.junit.Test;
 
 
 public class MultiplexClientServerTest extends AbstractBusClientServerTestBase {
+    static final String PORT = NumberFactoryImpl.PORT;
+    static final String JMS_PORT = EmbeddedJMSBrokerLauncher.PORT;
     
     public static class Server extends AbstractBusTestServerBase {        
 
@@ -74,11 +77,11 @@ public class MultiplexClientServerTest e
         props.put("java.util.logging.config.file", 
                   System.getProperty("java.util.logging.config.file"));
         assertTrue("server did not launch correctly", 
-                   launchServer(EmbeddedJMSBrokerLauncher.class, props, null));
+                   launchServer(EmbeddedJMSBrokerLauncher.class, props, null, true));
         
         props.put("cxf.config.file", defaultConfigFileName);
         assertTrue("server did not launch correctly",
-                   launchServer(Server.class, props, null));
+                   launchServer(Server.class, props, null, true));
     }
 
     
@@ -87,6 +90,7 @@ public class MultiplexClientServerTest e
         
         NumberFactoryService service = new NumberFactoryService();
         NumberFactory factory = service.getNumberFactoryPort();
+        updateAddressPort(factory, PORT);
         
         NumberService numService = new NumberService();
         ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);
@@ -107,13 +111,17 @@ public class MultiplexClientServerTest e
         
         NumberFactoryService service = new NumberFactoryService();
         NumberFactory factory = service.getNumberFactoryPort();
+        updateAddressPort(factory, PORT);
         
-        NumberService numService = new NumberService();
 
         // use values >= 30 to create JMS eprs - see NumberFactoryImpl.create
         
         // verify it is JMS, 999 for JMS will throw a fault
         W3CEndpointReference ref = factory.create("999");
+        EmbeddedJMSBrokerLauncher.updateWsdlExtensors(BusFactory.getDefaultBus(),
+                                                      NumberService.WSDL_LOCATION.toString());        
+        NumberService numService = new NumberService();
+
         assertNotNull("reference", ref);
         ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);    
         Number num =  (Number)serviceImpl.getPort(ref, Number.class); 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/MultiplexHttpAddressClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/MultiplexHttpAddressClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/MultiplexHttpAddressClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/MultiplexHttpAddressClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -51,6 +51,7 @@ import org.junit.Test;
  * exercise with multiplexWithAddress config rather than ws-a headers
  */
 public class MultiplexHttpAddressClientServerTest extends AbstractBusClientServerTestBase {
+    static final String FACTORY_ADDRESS = NumberFactoryImpl.FACTORY_ADDRESS;
     
     public static class Server extends AbstractBusTestServerBase {        
 
@@ -87,6 +88,7 @@ public class MultiplexHttpAddressClientS
         
         NumberFactoryService service = new NumberFactoryService();
         NumberFactory factory = service.getNumberFactoryPort();
+        updateAddressPort(factory, NumberFactoryImpl.PORT);
         
         NumberService numService = new NumberService();
         ServiceImpl serviceImpl = ServiceDelegateAccessor.get(numService);

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/NumberFactoryImpl.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/NumberFactoryImpl.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/NumberFactoryImpl.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/factory_pattern/NumberFactoryImpl.java Tue Jul 27 20:46:55 2010
@@ -29,6 +29,8 @@ import org.apache.cxf.factory_pattern.Nu
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.jaxws.EndpointImpl;
+import org.apache.cxf.testutil.common.EmbeddedJMSBrokerLauncher;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.ws.addressing.EndpointReferenceType;
 import org.apache.cxf.wsdl.EndpointReferenceUtils;
 
@@ -37,11 +39,13 @@ import org.apache.cxf.wsdl.EndpointRefer
             endpointInterface = "org.apache.cxf.factory_pattern.NumberFactory", 
             targetNamespace = "http://cxf.apache.org/factory_pattern")
 public class NumberFactoryImpl implements NumberFactory {
-
+    public static final String PORT = TestUtil.getPortNumber(NumberFactoryImpl.class);
+    
+    
     public static final String FACTORY_ADDRESS = 
-        "http://localhost:9006/NumberFactoryService/NumberFactoryPort";
+        "http://localhost:" + PORT + "/NumberFactoryService/NumberFactoryPort";
     public static final String NUMBER_SERVANT_ADDRESS_ROOT = 
-        "http://localhost:9006/NumberService/NumberPort/";
+        "http://localhost:" + PORT + "/NumberService/NumberPort/";
     public static final String FACTORY_NS = "http://cxf.apache.org/factory_pattern";
     public static final String NUMBER_SERVICE_NAME = "NumberService";
     public static final String NUMBER_PORT_NAME = "NumberPort";
@@ -90,14 +94,16 @@ public class NumberFactoryImpl implement
         EndpointImpl ep = new EndpointImpl(BusFactory.getDefaultBus(), 
                                            servant, bindingId, wsdlLocation);
         ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPort"));
-        ep.publish();
+        ep.publish(NUMBER_SERVANT_ADDRESS_ROOT);
         templateEpr = ep.getServer().getDestination().getAddress();
 
         // jms port
+        EmbeddedJMSBrokerLauncher.updateWsdlExtensors(BusFactory.getDefaultBus(), wsdlLocation);        
         ep = new EndpointImpl(BusFactory.getDefaultBus(), servant, bindingId, wsdlLocation);
         ep.setEndpointName(new QName(NUMBER_SERVICE_QNAME.getNamespaceURI(), "NumberPortJMS"));
         ep.publish();
         ep.getServer().getEndpoint().getInInterceptors().add(new LoggingInInterceptor());
         ep.getServer().getEndpoint().getOutInterceptors().add(new LoggingOutInterceptor());
     }
+    
 }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -31,7 +31,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class IntFaultClientServerTest extends AbstractBusClientServerTestBase {    
-
+    public static final String PORT = Server.PORT;
     private final QName serviceName = new QName("http://apache.org/intfault",
                                                 "SOAPService");
     @BeforeClass
@@ -48,6 +48,7 @@ public class IntFaultClientServerTest ex
         assertNotNull("Service is null", service);
 
         Greeter greeter = service.getSoapPort();
+        updateAddressPort(greeter, PORT);
         try {
             greeter.testDocLitFault("fault");
         } catch (BadRecordLitFault e) {

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java Tue Jul 27 20:46:55 2010
@@ -24,10 +24,12 @@ import javax.xml.ws.Endpoint;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(Server.class);
+
     protected void run() {
 
         GreeterImpl implementor = new GreeterImpl();
-        String address = "http://localhost:9000/SoapContext/SoapPort";
+        String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
         Endpoint.publish(address, implementor);
 
     }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java Tue Jul 27 20:46:55 2010
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.systest.interceptor;
 
+import java.net.MalformedURLException;
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.Iterator;
@@ -62,6 +63,8 @@ import org.junit.Test;
  * 
  */
 public class InterceptorFaultTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    
     private static final Logger LOG = LogUtils.getLogger(InterceptorFaultTest.class);
 
     private static final QName SOAP_FAULT_CODE = new QName("http://schemas.xmlsoap.org/soap/envelope/",
@@ -69,9 +72,9 @@ public class InterceptorFaultTest extend
     private static final String FAULT_MESSAGE = "Could not send Message.";
     
     private static final String CONTROL_PORT_ADDRESS = 
-        "http://localhost:9001/SoapContext/ControlPort";
+        "http://localhost:" + PORT + "/SoapContext/ControlPort";
     
-    private static int decoupledEndpointPort = 10000;
+    private static int decoupledEndpointPort = 1;
     private static String decoupledEndpoint;
     
 
@@ -93,6 +96,7 @@ public class InterceptorFaultTest extend
             setBus(bus);
 
             ControlImpl implementor = new ControlImpl();
+            implementor.setAddress("http://localhost:" + PORT + "/SoapContext/GreeterPort");
             GreeterImpl greeterImplementor = new GreeterImpl();
             greeterImplementor.setThrowAlways(true);
             implementor.setImplementor(greeterImplementor);
@@ -286,7 +290,8 @@ public class InterceptorFaultTest extend
    
     
     
-    private void setupGreeter(String cfgResource, boolean useDecoupledEndpoint) {
+    private void setupGreeter(String cfgResource, boolean useDecoupledEndpoint) 
+        throws NumberFormatException, MalformedURLException {
         
         SpringBusFactory bf = new SpringBusFactory();
         
@@ -295,6 +300,7 @@ public class InterceptorFaultTest extend
 
         ControlService cs = new ControlService();
         control = cs.getControlPort();
+        updateAddressPort(control, PORT);
         
         assertTrue("Failed to start greeter", control.startGreeter(cfgResource));
         
@@ -317,6 +323,7 @@ public class InterceptorFaultTest extend
         GreeterService gs = new GreeterService();
 
         greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");
        
         if (!useDecoupledEndpoint) {
@@ -325,9 +332,10 @@ public class InterceptorFaultTest extend
 
         // programatically configure decoupled endpoint that is guaranteed to
         // be unique across all test cases
-        
-        decoupledEndpointPort--;
-        decoupledEndpoint = "http://localhost:" + decoupledEndpointPort + "/decoupled_endpoint";
+        decoupledEndpointPort++;
+        decoupledEndpoint = "http://localhost:" 
+            + allocatePort("decoupled-" + decoupledEndpointPort)
+            + "/decoupled_endpoint";
 
         Client c = ClientProxy.getClient(greeter);
         HTTPConduit hc = (HTTPConduit)(c.getConduit());

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java Tue Jul 27 20:46:55 2010
@@ -40,6 +40,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class OutBoundConnectionTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = Server.PORT;
     private final QName serviceName = new QName("http://apache.org/hello_world_soap_http",
                                                 "SOAPService");
     
@@ -47,10 +48,10 @@ public class OutBoundConnectionTest exte
                                              "SoapPort");
 
     public static class Server extends AbstractBusTestServerBase {        
-        
+        public static final String PORT = allocatePort(Server.class);
         protected void run() {
             Object implementor = new GreeterImpl();
-            String address = "http://localhost:9000/SoapContext/SoapPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
             Endpoint.publish(address, implementor);
             
         }
@@ -85,6 +86,7 @@ public class OutBoundConnectionTest exte
                                            wsdl,
                                            service.getServiceName(),
                                            portName);
+        cri.setAddress("http://localhost:" + PORT + "/SoapContext/SoapPort");
         ManagedConnectionFactory managedFactory = new ManagedConnectionFactoryImpl();
         Subject subject = new Subject();
         ManagedConnection mc = managedFactory.createManagedConnection(subject, cri);        
@@ -106,7 +108,7 @@ public class OutBoundConnectionTest exte
     public void testGetConnectionFromSEI() throws Exception {
         CXFConnectionRequestInfo requestInfo = new CXFConnectionRequestInfo();
         requestInfo.setInterface(Greeter.class);
-        requestInfo.setAddress("http://localhost:9000/SoapContext/SoapPort");
+        requestInfo.setAddress("http://localhost:" + PORT + "/SoapContext/SoapPort");
         
         ManagedConnectionFactory factory = new ManagedConnectionFactoryImpl();
         ManagedConnection mc = factory.createManagedConnection(null, requestInfo);

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -34,7 +34,10 @@ import org.junit.Test;
 
 
 public class JSClientServerTest extends AbstractBusClientServerTestBase {
-
+    
+    public static final String JS_PORT = Server.JS_PORT;
+    public static final String JSX_PORT = Server.JSX_PORT;
+    
     private static final String NS = "http://apache.org/hello_world_soap_http";
     
     @BeforeClass
@@ -57,6 +60,7 @@ public class JSClientServerTest extends 
         String response2 = new String("TestSayHiResponse");
         try {
             Greeter greeter = service.getPort(portName, Greeter.class);
+            updateAddressPort(greeter, JS_PORT);
             String greeting = greeter.greetMe("TestGreetMeRequest");
             assertNotNull("no response received from service", greeting);
             assertEquals(response1, greeting);
@@ -85,6 +89,7 @@ public class JSClientServerTest extends 
         String response2 = new String("TestSayHiResponse");
         try {
             Greeter greeter = service.getPort(portName, Greeter.class);
+            updateAddressPort(greeter, JSX_PORT);
             String greeting = greeter.greetMe("TestGreetMeRequest");
             assertNotNull("no response received from service", greeting);
             assertEquals(response1, greeting);

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java Tue Jul 27 20:46:55 2010
@@ -26,17 +26,19 @@ import org.apache.cxf.js.rhino.ProviderF
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
-
+    public static final String JS_PORT = allocatePort(Server.class);
+    public static final String JSX_PORT = allocatePort(Server.class, 1);
     protected void run()  {
         
         try {            
             ProviderFactory pf = new ProviderFactory();            
             String f = getClass().getResource("resources/hello_world.js").toURI().getPath();
             f = URLDecoder.decode(f, "UTF-8");
-            pf.createAndPublish(new File(f), "http://localhost:9000/SoapContext/SoapPort", false);
+            pf.createAndPublish(new File(f), "http://localhost:" + JS_PORT 
+                                + "/SoapContext/SoapPort", false);
             f = getClass().getResource("resources/hello_world.jsx").toURI().getPath();
             f = URLDecoder.decode(f, "UTF-8");
-            pf.createAndPublish(new File(f), "http://localhost:9100", false);
+            pf.createAndPublish(new File(f), "http://localhost:" + JSX_PORT, false);
         } catch (Exception ex) {
             ex.printStackTrace();
         }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java Tue Jul 27 20:46:55 2010
@@ -34,6 +34,7 @@ import org.apache.cxf.endpoint.ServerLif
 import org.apache.cxf.endpoint.ServerLifeCycleManager;
 import org.apache.cxf.feature.AbstractFeature;
 import org.apache.cxf.greeter_control.ControlImpl;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.ws.addressing.WSAddressingFeature;
 
 import org.junit.After;
@@ -42,12 +43,17 @@ import org.junit.Before;
 import org.junit.Test;
 
 public class LifeCycleTest extends Assert {
+    public static final String PORT1 = TestUtil.getPortNumber(LifeCycleTest.class, 1);
+    public static final String PORT2 = TestUtil.getPortNumber(LifeCycleTest.class, 2);
+    public static final String PORT3 = TestUtil.getPortNumber(LifeCycleTest.class, 3);
+    public static final String PORT4 = TestUtil.getPortNumber(LifeCycleTest.class, 4);
+    
     private static final int RECURSIVE_LIMIT = 3;
     private static final String[] ADDRESSES = 
-    {"http://localhost:9056/SoapContext/SoapPort",
-     "http://localhost:9057/SoapContext/SoapPort",
-     "http://localhost:9058/SoapContext/SoapPort",
-     "http://localhost:9059/SoapContext/SoapPort"};
+    {"http://localhost:" + PORT1 + "/SoapContext/SoapPort",
+     "http://localhost:" + PORT2 + "/SoapContext/SoapPort",
+     "http://localhost:" + PORT3 + "/SoapContext/SoapPort",
+     "http://localhost:" + PORT4 + "/SoapContext/SoapPort"};
     private static final String CONFIG =
         "org/apache/cxf/systest/lifecycle/cxf.xml";
 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -46,7 +46,9 @@ import org.junit.Test;
 
 
 public class CountersClientServerTest extends AbstractBusClientServerTestBase {
-    
+    public static final String PORT = allocatePort(Server.class);
+    public static final String JMX_PORT = allocatePort(Server.class, 1);
+
     private final QName portName = 
         new QName("http://apache.org/hello_world_soap_http",
                   "SoapPort"); 
@@ -58,7 +60,7 @@ public class CountersClientServerTest ex
             Bus bus = bf.createBus("org/apache/cxf/systest/management/counter-spring.xml", true);
             BusFactory.setDefaultBus(bus);
             Object implementor = new GreeterImpl();
-            Endpoint.publish("http://localhost:9000/SoapContext/SoapPort", implementor);
+            Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort", implementor);
         }
 
         public static void main(String[] args) {
@@ -105,6 +107,7 @@ public class CountersClientServerTest ex
         assertNotNull(service);        
         
         Greeter greeter = service.getPort(portName, Greeter.class);
+        updateAddressPort(greeter, PORT);
         
         String response = new String("Bonjour");
         String reply = greeter.sayHi();

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java Tue Jul 27 20:46:55 2010
@@ -31,11 +31,14 @@ import org.apache.cxf.helpers.CastUtils;
 import org.apache.cxf.management.InstrumentationManager;
 import org.apache.cxf.management.ManagementConstants;
 import org.apache.cxf.management.jmx.InstrumentationManagerImpl;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.workqueue.WorkQueueManager;
 import org.junit.Assert;
 import org.junit.Test;
 
 public class ManagedBusTest extends Assert {
+    public static final String JMX_PORT1 = TestUtil.getPortNumber("Server.1");
+    public static final String JMX_PORT2 = TestUtil.getPortNumber(ManagedBusTest.class, 3);
 
     @Test
     public void testManagedSpringBus() throws Exception {
@@ -45,7 +48,8 @@ public class ManagedBusTest extends Asse
         assertNotNull(im);
                 
         InstrumentationManagerImpl imi = (InstrumentationManagerImpl)im;
-        assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi", imi.getJMXServiceURL());
+        assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi", 
+                     imi.getJMXServiceURL());
         assertTrue(!imi.isEnabled());
         assertNull(imi.getMBeanServer());
         
@@ -59,14 +63,14 @@ public class ManagedBusTest extends Asse
     public void testManagedBusWithTransientId() throws Exception {
         SpringBusFactory factory = new SpringBusFactory();
         Bus bus = factory.createBus("org/apache/cxf/systest/management/managed-spring.xml", true);
-        doManagedBusTest(bus, bus.getId(), "cxf_managed_bus_test", 9916);
+        doManagedBusTest(bus, bus.getId(), "cxf_managed_bus_test", Integer.parseInt(JMX_PORT1));
     }
     
     @Test
     public void testManagedBusWithPersistentId() throws Exception {
         SpringBusFactory factory = new SpringBusFactory();
         Bus bus = factory.createBus("org/apache/cxf/systest/management/persistent-id.xml", true);
-        doManagedBusTest(bus, "cxf_managed_bus_test", bus.getId(), 9917);
+        doManagedBusTest(bus, "cxf_managed_bus_test", bus.getId(), Integer.parseInt(JMX_PORT2));
     }
     
     private void doManagedBusTest(Bus bus, String expect, String reject, int port) throws Exception {

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -44,7 +44,10 @@ import org.junit.Test;
 
 
 public class ManagedClientServerTest extends AbstractBusClientServerTestBase {
-
+    public static final String PORT = allocatePort(Server.class);
+    public static final String JMX_PORT = allocatePort(Server.class, 1);
+    
+    
     private final QName portName =
         new QName("http://apache.org/hello_world_soap_http",
                   "SoapPort");
@@ -56,7 +59,8 @@ public class ManagedClientServerTest ext
             Bus bus = bf.createBus("org/apache/cxf/systest/management/managed-spring.xml", true);
             BusFactory.setDefaultBus(bus);
             Object implementor = new GreeterImpl();
-            Endpoint.publish(null, implementor);
+            Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort",
+                implementor);
         }
 
         public static void main(String[] args) {
@@ -105,7 +109,7 @@ public class ManagedClientServerTest ext
         assertNotNull(service);
 
         Greeter greeter = service.getPort(portName, Greeter.class);
-
+        updateAddressPort(greeter, PORT);
         String response = new String("Bonjour");
         String reply = greeter.sayHi();
         assertNotNull("no response received from service", reply);

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml Tue Jul 27 20:46:55 2010
@@ -21,11 +21,12 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
   
     <bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
         <property name="bus" ref="cxf" />
         <property name="enabled" value="true" />
-        <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9915/jmxrmi" />
+        <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:${testutil.ports.Server.1}/jmxrmi" />
     </bean>
     
     <bean id="org.apache.cxf.management.counters.CounterRepository" class="org.apache.cxf.management.counters.CounterRepository">

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml Tue Jul 27 20:46:55 2010
@@ -21,12 +21,14 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+  	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
   
     <bean id="org.apache.cxf.management.InstrumentationManager"
         class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
         <property name="bus" ref="cxf" />
         <property name="enabled" value="true" />
-        <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9916/jmxrmi" />
+        <property name="JMXServiceURL" 
+        	value="service:jmx:rmi:///jndi/rmi://localhost:${testutil.ports.Server.1}/jmxrmi" />
     </bean> 
  
     <bean id="wq" class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml Tue Jul 27 20:46:55 2010
@@ -21,12 +21,13 @@
        xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
        xsi:schemaLocation="
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
   
     <bean id="org.apache.cxf.management.InstrumentationManager"
         class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
         <property name="bus" ref="cxf" />
         <property name="enabled" value="true" />
-        <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9917/jmxrmi" />
+        <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:${testutil.ports.ManagedBusTest.3}/jmxrmi" />
         <property name="persistentBusId" value="cxf:managed,bus=test" />
     </bean> 
  

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java Tue Jul 27 20:46:55 2010
@@ -56,7 +56,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class ClientMtomXopTest extends AbstractBusClientServerTestBase {
-
+    public static final String PORT = Server.PORT;
     public static final QName MTOM_PORT = new QName("http://cxf.apache.org/mime", "TestMtomPort");
     public static final QName MTOM_SERVICE = new QName("http://cxf.apache.org/mime", "TestMtomService");
 
@@ -182,7 +182,7 @@ public class ClientMtomXopTest extends A
         assertNotNull(r);
     }
 
-    private static <T> T createPort(QName serviceName, QName portName, Class<T> serviceEndpointInterface,
+    private <T> T createPort(QName serviceName, QName portName, Class<T> serviceEndpointInterface,
                                     boolean enableMTOM, boolean installInterceptors) throws Exception {
         Bus bus = BusFactory.getDefaultBus();
         ReflectionServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
@@ -209,6 +209,7 @@ public class ClientMtomXopTest extends A
         Object obj = Proxy
             .newProxyInstance(serviceEndpointInterface.getClassLoader(),
                               new Class[] {serviceEndpointInterface, BindingProvider.class}, ih);
+        updateAddressPort(obj, PORT);
         return serviceEndpointInterface.cast(obj);
     }
 }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java Tue Jul 27 20:46:55 2010
@@ -44,6 +44,7 @@ import org.apache.cxf.message.MessageImp
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.test.AbstractCXFTest;
 import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.ConduitInitiatorManager;
@@ -55,8 +56,8 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class MtomPolicyTest extends AbstractCXFTest {
-    
-    String address = "http://localhost:9036/EchoService";
+    public static final String PORT = TestUtil.getPortNumber(MtomPolicyTest.class);
+    String address = "http://localhost:" + PORT + "/EchoService";
     
     @BeforeClass
     public static void setKeepAliveProperty() {

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java Tue Jul 27 20:46:55 2010
@@ -41,6 +41,7 @@ import org.apache.cxf.message.MessageImp
 import org.apache.cxf.service.model.EndpointInfo;
 import org.apache.cxf.test.AbstractCXFTest;
 import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.transport.Conduit;
 import org.apache.cxf.transport.ConduitInitiator;
 import org.apache.cxf.transport.ConduitInitiatorManager;
@@ -53,7 +54,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class MtomServerTest extends AbstractCXFTest {
-
+    public static final String PORT = TestUtil.getPortNumber(MtomServerTest.class);
 
     private static final String HTTP_ID = "http://schemas.xmlsoap.org/wsdl/http/";
 
@@ -72,7 +73,7 @@ public class MtomServerTest extends Abst
         JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
         sf.setServiceBean(new EchoService());
         sf.setBus(getBus());
-        String address = "http://localhost:9036/EchoService";
+        String address = "http://localhost:" + PORT + "/EchoService";
         sf.setAddress(address);
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Message.MTOM_ENABLED, "true");
@@ -134,7 +135,7 @@ public class MtomServerTest extends Abst
         JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
         sf.setServiceBean(new EchoService());
         sf.setBus(getBus());
-        String address = "http://localhost:9036/EchoService";
+        String address = "http://localhost:" + PORT + "/EchoService";
         sf.setAddress(address);
         Map<String, Object> props = new HashMap<String, Object>();
         props.put(Message.MTOM_ENABLED, "true");
@@ -143,7 +144,7 @@ public class MtomServerTest extends Abst
         server.getEndpoint().getService().getDataBinding().setMtomThreshold(0);
 
         servStatic(getClass().getResource("mtom-policy.xml"),
-                   "http://localhost:9036/policy.xsd");
+                   "http://localhost:" + PORT + "/policy.xsd");
 
         EndpointInfo ei = new EndpointInfo(null, HTTP_ID);
         ei.setAddress(address);
@@ -169,9 +170,12 @@ public class MtomServerTest extends Abst
         if (is == null) {
             throw new RuntimeException("Could not find resource " + "request");
         }
+        ByteArrayOutputStream bout = new ByteArrayOutputStream();
+        IOUtils.copy(is, bout);
+        String s = bout.toString("UTF-8");
+        s = s.replaceAll(":9036/", ":" + PORT + "/");
 
-        IOUtils.copy(is, os);
-
+        os.write(s.getBytes("UTF-8"));
         os.flush();
         is.close();
         os.close();
@@ -195,7 +199,7 @@ public class MtomServerTest extends Abst
         assertTrue("Wrong size: " + out.size()
                    + "\n" + out.toString(),
                    out.size() > 970 && out.size() < 1020);
-        unregisterServStatic("http://localhost:9036/policy.xsd");
+        unregisterServStatic("http://localhost:" + PORT + "/policy.xsd");
 
     }
 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java Tue Jul 27 20:46:55 2010
@@ -27,10 +27,11 @@ import org.apache.cxf.mtom_xop.TestMtomI
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(Server.class);
 
     protected void run() {
         Object implementor = new TestMtomImpl();
-        String address = "http://localhost:9036/mime-test";
+        String address = "http://localhost:" + PORT + "/mime-test";
         try {
             EndpointImpl jaxep = (EndpointImpl) javax.xml.ws.Endpoint.publish(address, implementor);
             Endpoint ep = jaxep.getServer().getEndpoint();

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java Tue Jul 27 20:46:55 2010
@@ -40,6 +40,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class MTOMBindingTypeTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = Server.PORT;
 
     private final QName serviceName = new QName("http://apache.org/cxf/systest/mtom_feature",
                                                 "HelloService");
@@ -129,6 +130,14 @@ public class MTOMBindingTypeTest extends
 
         HelloService service = new HelloService(wsdl, serviceName);
         assertNotNull("Service is null ", service);
-        return service.getHelloPort();
+        Hello hello = service.getHelloPort();
+        try {
+            updateAddressPort(hello, PORT);
+        } catch (Exception ex) {
+            //ignore
+        }
+        
+        return hello;
+        
     }
 }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java Tue Jul 27 20:46:55 2010
@@ -24,10 +24,11 @@ import javax.xml.ws.Endpoint;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(Server.class);
 
     protected void run()  {    
         Object implementor = new HelloImpl();
-        String address = "http://localhost:9091/jaxws-mtom/hello";
+        String address = "http://localhost:" + PORT + "/jaxws-mtom/hello";
         Endpoint.publish(address, implementor);
     }
 

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java Tue Jul 27 20:46:55 2010
@@ -35,7 +35,7 @@ import org.junit.BeforeClass;
 import org.junit.Test;
 
 public class MtomFeatureClientServerTest extends AbstractBusClientServerTestBase {
-
+    public static final String PORT = Server.PORT;
     private final QName serviceName = new QName("http://apache.org/cxf/systest/mtom_feature",
                                                 "HelloService");
     private Hello port = getPort();
@@ -124,6 +124,12 @@ public class MtomFeatureClientServerTest
         HelloService service = new HelloService(wsdl, serviceName);
         assertNotNull("Service is null ", service);
         //return service.getHelloPort();        
-        return service.getHelloPort(new MTOMFeature());
+        Hello hello = service.getHelloPort(new MTOMFeature());
+        try {
+            updateAddressPort(hello, PORT);
+        } catch (Exception e) {
+            //ignore
+        }
+        return hello;
     }
 }

Modified: cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java
URL: http://svn.apache.org/viewvc/cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java?rev=979862&r1=979861&r2=979862&view=diff
==============================================================================
--- cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java (original)
+++ cxf/sandbox/oauth_1.0a/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java Tue Jul 27 20:46:55 2010
@@ -24,10 +24,11 @@ import javax.xml.ws.Endpoint;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(Server.class);
 
     protected void run()  {    
         Object implementor = new HelloImpl();
-        String address = "http://localhost:9091/jaxws-mtom/hello";
+        String address = "http://localhost:" + PORT + "/jaxws-mtom/hello";
         Endpoint.publish(address, implementor);
     }
 



Mime
View raw message