You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by dk...@apache.org on 2010/06/04 22:13:20 UTC

svn commit: r951551 [2/3] - in /cxf/trunk: rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/resources/ systests/transports/src/te...

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java Fri Jun  4 20:13:17 2010
@@ -45,10 +45,13 @@ import messaging.AsyncMessaging;
 import messaging.AsyncMessagingService;
 
 public class WSDLAddrPolicyAttachmentJaxwsMMProviderTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String DECOUPLED = allocatePort("decoupled");
 
     private static final Logger LOG = LogUtils.getLogger(WSDLAddrPolicyAttachmentJaxwsMMProviderTest.class);
 
-    private static final String ADDRESS = "http://localhost:9000/AsyncMessagingServiceProvider";
+    private static final String ADDRESS = "http://localhost:" 
+            + PORT + "/AsyncMessagingServiceProvider";
     private static final String WSDL_ADDRESS = ADDRESS + "?wsdl";
     private static final QName ENDPOINT_NAME = new QName("http://messaging/", "AsyncMessagingService");
 

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java Fri Jun  4 20:13:17 2010
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.systest.ws.addressing;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
@@ -38,7 +39,8 @@ import org.junit.Test;
 public class DecoupledJMSTest extends MAPTestBase {
     private static final String ADDRESS = "jms:jndi:dynamicQueues/testqueue0001?"
         + "jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
-        + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:61500";
+        + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:" 
+        + EmbeddedJMSBrokerLauncher.PORT;
     
     
     private static final String CONFIG =
@@ -47,7 +49,9 @@ public class DecoupledJMSTest extends MA
     public String getConfigFileName() {
         return CONFIG;
     }
-    
+    protected void updateAddressPort(Object o, int port) throws MalformedURLException {
+    }
+
     @Test
     @Override
     public void testImplicitMAPs() throws Exception {

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java Fri Jun  4 20:13:17 2010
@@ -33,7 +33,7 @@ import org.junit.Test;
  * Tests the addition of WS-Addressing Message Addressing Properties.
  */
 public class MAPTest extends MAPTestBase {
-    static final String ADDRESS = "http://localhost:9008/SoapContext/SoapPort";
+    static final String ADDRESS = "http://localhost:" + PORT + "/SoapContext/SoapPort";
 
     private static final String CONFIG;
     static {

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java Fri Jun  4 20:13:17 2010
@@ -64,7 +64,9 @@ import static org.apache.cxf.ws.addressi
  * Tests the addition of WS-Addressing Message Addressing Properties.
  */
 public abstract class MAPTestBase extends AbstractClientServerTestBase implements VerificationCache {
-
+    protected static final String PORT = allocatePort(MAPTestBase.class);
+    protected static final String DECOUPLE_PORT = allocatePort(MAPTestBase.class, 1);
+    
     protected static Bus staticBus;
 
     static final String INBOUND_KEY = "inbound";
@@ -142,10 +144,12 @@ public abstract class MAPTestBase extend
     public URL getWSDLURL() {
         return getClass().getResource("/wsdl/hello_world.wsdl");
     }
-    public Greeter createGreeter(EndpointReferenceType target) {
+    public Greeter createGreeter(EndpointReferenceType target) throws Exception {
         ServiceImpl serviceImpl = 
             ServiceDelegateAccessor.get(new SOAPService(getWSDLURL(), SERVICE_NAME));
-        return serviceImpl.getPort(target, Greeter.class);        
+        Greeter g = serviceImpl.getPort(target, Greeter.class);
+        updateAddressPort(g, PORT);
+        return g;
     }
     
     @After

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java Fri Jun  4 20:13:17 2010
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.systest.ws.addressing;
 
+import java.net.MalformedURLException;
 import java.net.URL;
 import java.util.HashMap;
 import java.util.Map;
@@ -38,7 +39,8 @@ import org.junit.Test;
 public class NonDecoupledJMSTest extends MAPTestBase {
     private static final String ADDRESS = "jms:jndi:dynamicQueues/testqueue0001?"
         + "jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
-        + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:61500";
+        + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:" 
+        + EmbeddedJMSBrokerLauncher.PORT;
     
     
     private static final String CONFIG =
@@ -61,7 +63,8 @@ public class NonDecoupledJMSTest extends
     public URL getWSDLURL() {
         return null;
     }
-
+    protected void updateAddressPort(Object o, int port) throws MalformedURLException {
+    }
     @BeforeClass
     public static void startServers() throws Exception {
         

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java Fri Jun  4 20:13:17 2010
@@ -30,7 +30,7 @@ import org.junit.Test;
  * in the non-decoupled case.
  */
 public class NonDecoupledTest extends MAPTestBase {
-    static final String ADDRESS = "http://localhost:9008/SoapContext/SoapPort";
+    static final String ADDRESS = "http://localhost:" + PORT + "/SoapContext/SoapPort";
 
     private static final String CONFIG =
         "org/apache/cxf/systest/ws/addressing/wsa_interceptors.xml";

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf-hpux.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf-hpux.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf-hpux.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf-hpux.xml Fri Jun  4 20:13:17 2010
@@ -23,9 +23,11 @@
        xsi:schemaLocation="
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
   
     <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
-      <http:client Connection="Keep-Alive" DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+      <http:client Connection="Keep-Alive" 
+      	DecoupledEndpoint="http://localhost:${testutil.ports.MAPTestBase.1}/decoupled_endpoint"/>
     </http:conduit>
     
     <import resource="wsa_interceptors.xml"/>

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf.xml Fri Jun  4 20:13:17 2010
@@ -23,9 +23,10 @@
        xsi:schemaLocation="
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
   
     <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
-      <http:client DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+      <http:client DecoupledEndpoint="http://localhost:${testutil.ports.MAPTestBase.1}/decoupled_endpoint"/>
     </http:conduit>
     
     <import resource="wsa_interceptors.xml"/>

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/jms_decoupled.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/jms_decoupled.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/jms_decoupled.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/jms_decoupled.xml Fri Jun  4 20:13:17 2010
@@ -24,12 +24,14 @@
        xsi:schemaLocation="
 http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
   
     <import resource="wsa_interceptors.xml"/>
     <jaxws:client name="{http://apache.org/hello_world_soap_http}GreeterPort"
         createdFromAPI="true">
         <jaxws:properties>
-            <entry key="org.apache.cxf.ws.addressing.replyto" value="jms:jndi:dynamicQueues/testreplyto?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:61500" />
+            <entry key="org.apache.cxf.ws.addressing.replyto" 
+            	value="jms:jndi:dynamicQueues/testreplyto?jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory&amp;jndiConnectionFactoryName=ConnectionFactory&amp;jndiURL=tcp://localhost:${testutil.ports.EmbeddedJMSBrokerLauncher}" />
         </jaxws:properties>
     </jaxws:client>
 </beans>

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java Fri Jun  4 20:13:17 2010
@@ -29,6 +29,7 @@ import org.apache.cxf.jaxws.JaxWsProxyFa
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.test.AbstractCXFTest;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.ws.addressing.MAPAggregator;
 import org.apache.cxf.ws.addressing.WSAddressingFeature;
 import org.apache.cxf.ws.addressing.soap.MAPCodec;
@@ -37,12 +38,13 @@ import org.apache.hello_world_soap_http.
 import org.junit.Test;
 
 public class WSAFeatureTest extends AbstractCXFTest {
+    static final String PORT = TestUtil.getPortNumber(WSAFeatureTest.class);
     @Test
     public void testServerFactory() {
         JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
         sf.getFeatures().add(new WSAddressingFeature());
         sf.setServiceBean(new GreeterImpl());
-        sf.setAddress("http://localhost:9000/test");
+        sf.setAddress("http://localhost:" + PORT + "/test");
         sf.setStart(false);
         sf.setBus(getBus());
         
@@ -56,7 +58,7 @@ public class WSAFeatureTest extends Abst
     @Test
     public void testClientProxyFactory() {
         JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean(); 
-        cf.setAddress("http://localhost:9000/test");
+        cf.setAddress("http://localhost:" + PORT + "/test");
         cf.getFeatures().add(new WSAddressingFeature());
         cf.setServiceClass(Greeter.class);
         Greeter greeter = (Greeter) cf.create();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java Fri Jun  4 20:13:17 2010
@@ -33,6 +33,7 @@ import org.apache.cxf.jaxws.JaxWsProxyFa
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 import org.apache.cxf.message.Message;
 import org.apache.cxf.test.AbstractCXFTest;
+import org.apache.cxf.testutil.common.TestUtil;
 import org.apache.cxf.ws.addressing.MAPAggregator;
 import org.apache.cxf.ws.addressing.soap.MAPCodec;
 import org.apache.hello_world_soap_http.Greeter;
@@ -40,7 +41,8 @@ import org.apache.hello_world_soap_http.
 import org.junit.Test;
 
 public class WSAFeatureXmlTest extends AbstractCXFTest {
-    
+    static final String PORT = TestUtil.getPortNumber(WSAFeatureXmlTest.class);
+
     @Override
     protected Bus createBus() throws BusException {
         return new SpringBusFactory().createBus("/org/apache/cxf/systest/ws/addressing/spring/spring.xml");
@@ -52,7 +54,7 @@ public class WSAFeatureXmlTest extends A
      
         assert bus != null;
         sf.setServiceBean(new GreeterImpl());
-        sf.setAddress("http://localhost:9000/test");
+        sf.setAddress("http://localhost:" + PORT + "/test");
         sf.setStart(false);
         
         Configurer c = getBus().getExtension(Configurer.class);
@@ -68,7 +70,7 @@ public class WSAFeatureXmlTest extends A
     public void testClientProxyFactory() {
       
         JaxWsProxyFactoryBean cf = new JaxWsProxyFactoryBean(); 
-        cf.setAddress("http://localhost:9000/test");        
+        cf.setAddress("http://localhost:" + PORT + "/test");        
         cf.setServiceClass(Greeter.class);
         cf.setBus(getBus());
         Configurer c = getBus().getExtension(Configurer.class);

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingAnonymousPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingAnonymousPolicyTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingAnonymousPolicyTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingAnonymousPolicyTest.java Fri Jun  4 20:13:17 2010
@@ -30,6 +30,7 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.greeter_control.BasicGreeterService;
 import org.apache.cxf.greeter_control.Greeter;
 import org.apache.cxf.greeter_control.PingMeFault;
+import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.systest.ws.util.ConnectionHelper;
@@ -44,12 +45,21 @@ import org.junit.Test;
  * WS-RM in response to Policies defined for the endpoint via an external policy attachment.
  */
 public class AddressingAnonymousPolicyTest extends AbstractBusClientServerTestBase {
-
+    public static final String PORT = allocatePort(Server.class);
+    public static final String TEMPDIR = FileUtils.getDefaultTempDir().toURI().toString(); 
+    
     private static final Logger LOG = LogUtils.getLogger(AddressingAnonymousPolicyTest.class);
 
     public static class Server extends AbstractBusTestServerBase {
-    
-        protected void run()  {            
+        String tmpDir = TEMPDIR;
+        public Server() {
+        }
+        public Server(String dir) {
+            tmpDir = dir;
+        }
+        protected void run()  {
+            
+            System.setProperty("server.temp.location", tmpDir);
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr-anon-server.xml");
             BusFactory.setDefaultBus(bus);
@@ -61,7 +71,7 @@ public class AddressingAnonymousPolicyTe
             bus.getOutFaultInterceptors().add(out);
             
             GreeterImpl implementor = new GreeterImpl();
-            String address = "http://localhost:9020/SoapContext/GreeterPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
             Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");            
         }
@@ -69,7 +79,7 @@ public class AddressingAnonymousPolicyTe
 
         public static void main(String[] args) {
             try { 
-                Server s = new Server(); 
+                Server s = new Server(args[0]); 
                 s.start();
             } catch (Exception ex) {
                 ex.printStackTrace();
@@ -82,7 +92,11 @@ public class AddressingAnonymousPolicyTe
 
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(Server.class));
+        PolicyTestHelper.updatePolicyRef("addr-external-anonymous-client.xml", ":9020", ":" + PORT);
+        PolicyTestHelper.updatePolicyRef("addr-external-anonymous-server.xml", ":9020", ":" + PORT);
+        System.setProperty("client.temp.location", TEMPDIR);
+        assertTrue("server did not launch correctly", launchServer(Server.class, null,
+                                                                   new String[] {TEMPDIR}));
     }
          
     @Test
@@ -99,6 +113,7 @@ public class AddressingAnonymousPolicyTe
         
         BasicGreeterService gs = new BasicGreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");     
         ConnectionHelper.setKeepAliveConnection(greeter, true);
 

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java Fri Jun  4 20:13:17 2010
@@ -47,6 +47,8 @@ import org.junit.Test;
  * WS-RM in response to Policies defined for the endpoint via an inline policy in addr-inline-policy.xml.
  */
 public class AddressingInlinePolicyTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String DECOUPLED = allocatePort("decoupled");
 
     private static final Logger LOG = LogUtils.getLogger(AddressingInlinePolicyTest.class);
 
@@ -57,7 +59,7 @@ public class AddressingInlinePolicyTest 
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr-inline-policy.xml");
             
             GreeterImpl implementor = new GreeterImpl();
-            String address = "http://localhost:9020/SoapContext/GreeterPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
             Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");            
             testInterceptors(bus);
@@ -93,6 +95,7 @@ public class AddressingInlinePolicyTest 
         
         BasicGreeterService gs = new BasicGreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");
 
         ConnectionHelper.setKeepAliveConnection(greeter, true);

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java Fri Jun  4 20:13:17 2010
@@ -30,6 +30,7 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.greeter_control.BasicGreeterService;
 import org.apache.cxf.greeter_control.Greeter;
 import org.apache.cxf.greeter_control.PingMeFault;
+import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.systest.ws.util.ConnectionHelper;
@@ -50,12 +51,22 @@ import org.junit.Test;
  * WS-RM in response to Policies defined for the endpoint via an external policy attachment.
  */
 public class AddressingOptionalPolicyTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String DECOUPLED = allocatePort("decoupled");
+    public static final String TEMPDIR = FileUtils.getDefaultTempDir().toURI().toString(); 
 
     private static final Logger LOG = LogUtils.getLogger(AddressingOptionalPolicyTest.class);
 
     public static class Server extends AbstractBusTestServerBase {
-    
-        protected void run()  {            
+        String tmpDir = TEMPDIR;
+        public Server() {
+        }
+        public Server(String dir) {
+            tmpDir = dir;
+        }
+        protected void run()  {       
+            System.setProperty("temp.location", tmpDir);
+
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr-optional.xml");
             BusFactory.setDefaultBus(bus);
@@ -67,7 +78,7 @@ public class AddressingOptionalPolicyTes
             bus.getOutFaultInterceptors().add(out);
             
             GreeterImpl implementor = new GreeterImpl();
-            String address = "http://localhost:9020/SoapContext/GreeterPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
             Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");            
         }
@@ -75,7 +86,7 @@ public class AddressingOptionalPolicyTes
 
         public static void main(String[] args) {
             try { 
-                Server s = new Server(); 
+                Server s = new Server(args[0]); 
                 s.start();
             } catch (Exception ex) {
                 ex.printStackTrace();
@@ -88,7 +99,10 @@ public class AddressingOptionalPolicyTes
 
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(Server.class));
+        PolicyTestHelper.updatePolicyRef("addr-optional-external.xml", ":9020", ":" + PORT);
+        System.setProperty("temp.location", TEMPDIR);
+        assertTrue("server did not launch correctly", launchServer(Server.class, null,
+                                                                   new String[] {TEMPDIR}));
     }
     
     
@@ -105,6 +119,7 @@ public class AddressingOptionalPolicyTes
         
         BasicGreeterService gs = new BasicGreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");
 
         ConnectionHelper.setKeepAliveConnection(greeter, true);
@@ -154,6 +169,7 @@ public class AddressingOptionalPolicyTes
                 
         BasicGreeterService gs = new BasicGreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");
 
         ConnectionHelper.setKeepAliveConnection(greeter, true);

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java Fri Jun  4 20:13:17 2010
@@ -30,6 +30,7 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.greeter_control.BasicGreeterService;
 import org.apache.cxf.greeter_control.Greeter;
 import org.apache.cxf.greeter_control.PingMeFault;
+import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.systest.ws.util.ConnectionHelper;
@@ -44,12 +45,22 @@ import org.junit.Test;
  * WS-RM in response to Policies defined for the endpoint via an external policy attachment.
  */
 public class AddressingPolicyTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String TEMPDIR = FileUtils.getDefaultTempDir().toURI().toString(); 
+    public static final String DECOUPLED = allocatePort("decoupled");
 
     private static final Logger LOG = LogUtils.getLogger(AddressingPolicyTest.class);
 
     public static class Server extends AbstractBusTestServerBase {
-    
-        protected void run()  {            
+        String tmpDir = TEMPDIR;
+        public Server() {
+        }
+        public Server(String dir) {
+            tmpDir = dir;
+        }
+        protected void run()  {
+            
+            System.setProperty("temp.location", tmpDir);
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr.xml");
             BusFactory.setDefaultBus(bus);
@@ -61,7 +72,7 @@ public class AddressingPolicyTest extend
             bus.getOutFaultInterceptors().add(out);
             
             GreeterImpl implementor = new GreeterImpl();
-            String address = "http://localhost:9020/SoapContext/GreeterPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
             Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");            
         }
@@ -69,7 +80,7 @@ public class AddressingPolicyTest extend
 
         public static void main(String[] args) {
             try { 
-                Server s = new Server(); 
+                Server s = new Server(args[0]); 
                 s.start();
             } catch (Exception ex) {
                 ex.printStackTrace();
@@ -82,7 +93,11 @@ public class AddressingPolicyTest extend
 
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(Server.class));
+        PolicyTestHelper.updatePolicyRef("addr-external.xml", ":9020", ":" + PORT);
+        System.setProperty("temp.location", TEMPDIR);
+
+        assertTrue("server did not launch correctly", launchServer(Server.class, null,
+                                                                   new String[] {TEMPDIR}));
     }
          
     @Test
@@ -99,6 +114,7 @@ public class AddressingPolicyTest extend
         
         BasicGreeterService gs = new BasicGreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");     
         ConnectionHelper.setKeepAliveConnection(greeter, true);
 

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java Fri Jun  4 20:13:17 2010
@@ -56,6 +56,7 @@ import org.junit.Test;
  * the use of multiple compatible or incompatible assertions.
  */
 public class HTTPClientPolicyTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
 
     private static final Logger LOG = LogUtils.getLogger(HTTPClientPolicyTest.class);
     private static final String POLICY_ENGINE_ENABLED_CFG =
@@ -80,7 +81,7 @@ public class HTTPClientPolicyTest extend
             
             HttpGreeterImpl implementor = new HttpGreeterImpl();
             implementor.setThrowAlways(true);
-            String address = "http://localhost:9020/SoapContext/GreeterPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
             Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");            
         }
@@ -123,6 +124,7 @@ public class HTTPClientPolicyTest extend
         
         BasicGreeterService gs = new BasicGreeterService(url, GREETER_QNAME);
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");
         
         // sayHi - this operation has message policies that are incompatible with
@@ -180,6 +182,8 @@ public class HTTPClientPolicyTest extend
         BasicGreeterService gs = new BasicGreeterService(url, GREETER_QNAME);
         final Greeter greeter = gs.getGreeterPort();
         LOG.fine("Created greeter client.");
+        updateAddressPort(greeter, PORT);
+
         
         greeter.greetMeOneWay("CXF");
         
@@ -189,7 +193,7 @@ public class HTTPClientPolicyTest extend
         assertNotNull("expected DecoupledEndpoint", 
                       c.getClient().getDecoupledEndpoint());
         assertEquals("unexpected DecoupledEndpoint", 
-                     "http://localhost:9990/decoupled_endpoint",
+                     "http://localhost:9909/decoupled_endpoint",
                      c.getClient().getDecoupledEndpoint());
     }
 }

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPServerPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPServerPolicyTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPServerPolicyTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPServerPolicyTest.java Fri Jun  4 20:13:17 2010
@@ -50,6 +50,7 @@ import org.junit.Test;
  * the use of multiple compatible or incompatible assertions.
  */
 public class HTTPServerPolicyTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
 
     private static final Logger LOG = LogUtils.getLogger(HTTPServerPolicyTest.class);
 
@@ -61,7 +62,7 @@ public class HTTPServerPolicyTest extend
             
             GreeterImpl implementor = new GreeterImpl();
             implementor.setThrowAlways(true);
-            Endpoint.publish("http://localhost:9020/SoapContext/GreeterPort", implementor);
+            Endpoint.publish("http://localhost:" + PORT + "/SoapContext/GreeterPort", implementor);
 
             LOG.info("Published greeter endpoint."); 
             
@@ -102,6 +103,8 @@ public class HTTPServerPolicyTest extend
         
         BasicGreeterService gs = new BasicGreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        
+        updateAddressPort(greeter, PORT);
         LoggingInInterceptor in = new LoggingInInterceptor();
         LoggingOutInterceptor out = new LoggingOutInterceptor();
         

Copied: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/PolicyTestHelper.java (from r951549, cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/Server.java)
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/PolicyTestHelper.java?p2=cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/PolicyTestHelper.java&p1=cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/Server.java&r1=951549&r2=951551&rev=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/PolicyTestHelper.java Fri Jun  4 20:13:17 2010
@@ -17,33 +17,34 @@
  * under the License.
  */
 
-package org.apache.cxf.systest.ws.security;
+package org.apache.cxf.systest.ws.policy;
 
-import org.apache.cxf.Bus;
-import org.apache.cxf.BusFactory;
-import org.apache.cxf.bus.spring.SpringBusFactory;
-import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
+import java.io.File;
+import java.io.FileWriter;
+import java.io.IOException;
+import java.io.InputStream;
 
-public class Server extends AbstractBusTestServerBase {
+import org.apache.cxf.helpers.FileUtils;
+import org.apache.cxf.helpers.IOUtils;
 
-    protected void run()  {
-        SpringBusFactory factory = new SpringBusFactory();
-        Bus bus = factory.createBus(
-            "org/apache/cxf/systest/ws/security/server.xml"
-        );
-        BusFactory.setDefaultBus(bus);
-        setBus(bus);
-    }
+/**
+ * 
+ */
+public final class PolicyTestHelper {
+    private PolicyTestHelper() {
         
-    public static void main(String[] args) {
-        try { 
-            Server s = new Server(); 
-            s.start();
-        } catch (Exception ex) {
-            ex.printStackTrace();
-            System.exit(-1);
-        } finally { 
-            System.out.println("done!");
-        }
+    }
+    
+    
+    public static void updatePolicyRef(String file, String oldData,
+                                       String newData) throws IOException {
+        File f = FileUtils.getDefaultTempDir();
+        InputStream in = PolicyTestHelper.class.getResourceAsStream(file);
+        String s = IOUtils.readStringFromStream(in);
+        s = s.replaceAll(oldData, newData);
+        File newFile = new File(f, file);
+        FileWriter fw = new FileWriter(newFile);
+        fw.write(s);
+        fw.close();
     }
 }

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java Fri Jun  4 20:13:17 2010
@@ -30,6 +30,7 @@ import org.apache.cxf.common.logging.Log
 import org.apache.cxf.greeter_control.BasicGreeterService;
 import org.apache.cxf.greeter_control.Greeter;
 import org.apache.cxf.greeter_control.PingMeFault;
+import org.apache.cxf.helpers.FileUtils;
 import org.apache.cxf.interceptor.LoggingInInterceptor;
 import org.apache.cxf.interceptor.LoggingOutInterceptor;
 import org.apache.cxf.systest.ws.util.ConnectionHelper;
@@ -50,6 +51,9 @@ import org.junit.Test;
  * in response to Policies defined for the endpoint via an external policy attachment.
  */
 public class RMPolicyTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String TEMPDIR = FileUtils.getDefaultTempDir().toURI().toString(); 
+    public static final String DECOUPLED = allocatePort("decoupled");
 
     private static final Logger LOG = LogUtils.getLogger(RMPolicyTest.class);
     private static final String GREETMEONEWAY_ACTION 
@@ -65,8 +69,14 @@ public class RMPolicyTest extends Abstra
         = "http://cxf.apache.org/greeter_control/Greeter/pingMe/Fault/faultDetail";
 
     public static class Server extends AbstractBusTestServerBase {
-    
-        protected void run()  {            
+        String tmpDir = TEMPDIR;
+        public Server() {
+        }
+        public Server(String dir) {
+            tmpDir = dir;
+        }
+        protected void run()  {
+            System.setProperty("temp.location", tmpDir);
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/rm.xml");
             BusFactory.setDefaultBus(bus);
@@ -77,7 +87,7 @@ public class RMPolicyTest extends Abstra
             bus.getOutFaultInterceptors().add(out);
             
             GreeterImpl implementor = new GreeterImpl();
-            String address = "http://localhost:9020/SoapContext/GreeterPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
             Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");
         }
@@ -85,7 +95,7 @@ public class RMPolicyTest extends Abstra
 
         public static void main(String[] args) {
             try { 
-                Server s = new Server(); 
+                Server s = new Server(args[0]); 
                 s.start();
             } catch (Exception ex) {
                 ex.printStackTrace();
@@ -98,7 +108,11 @@ public class RMPolicyTest extends Abstra
 
     @BeforeClass
     public static void startServers() throws Exception {
-        assertTrue("server did not launch correctly", launchServer(Server.class));
+        PolicyTestHelper.updatePolicyRef("rm-external.xml", ":9020", ":" + PORT);
+        System.setProperty("temp.location", TEMPDIR);
+
+        assertTrue("server did not launch correctly", launchServer(Server.class, null,
+                                                                   new String[] {TEMPDIR}));
     }
          
     @Test
@@ -113,6 +127,7 @@ public class RMPolicyTest extends Abstra
         
         BasicGreeterService gs = new BasicGreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");
 
         ConnectionHelper.setKeepAliveConnection(greeter, true);

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java Fri Jun  4 20:13:17 2010
@@ -53,6 +53,8 @@ import org.junit.Test;
  * in response to Policies defined for the endpoint via an direct attachment to the wsdl.
  */
 public class RMPolicyWsdlTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String DECOUPLED = allocatePort("decoupled");
 
     private static final Logger LOG = LogUtils.getLogger(RMPolicyWsdlTest.class);
     private static final String GREETMEONEWAY_ACTION 
@@ -115,7 +117,7 @@ public class RMPolicyWsdlTest extends Ab
     
     @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
@@ -130,6 +132,7 @@ public class RMPolicyWsdlTest extends Ab
         
         ReliableGreeterService gs = new ReliableGreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         LOG.fine("Created greeter client.");
 
         ConnectionHelper.setKeepAliveConnection(greeter, true);

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-client.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-client.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-client.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-client.xml Fri Jun  4 20:13:17 2010
@@ -27,13 +27,14 @@ http://cxf.apache.org/transports/http/co
 http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
 http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+	
     <cxf:bus>
         <cxf:features>
             <p:policies/>
         </cxf:features>
     </cxf:bus>
 
-    <p:externalAttachment location="org/apache/cxf/systest/ws/policy/addr-external-anonymous-client.xml"/>
+    <p:externalAttachment location="${client.temp.location}/addr-external-anonymous-client.xml"/>
 
 </beans>
\ No newline at end of file

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-server.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-server.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-server.xml Fri Jun  4 20:13:17 2010
@@ -27,13 +27,15 @@ http://cxf.apache.org/transports/http/co
 http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
 http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
-
+	
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+	
     <cxf:bus>
         <cxf:features>
             <p:policies/>
         </cxf:features>
     </cxf:bus>
 
-    <p:externalAttachment location="org/apache/cxf/systest/ws/policy/addr-external-anonymous-server.xml"/>
+    <p:externalAttachment location="${server.temp.location}/addr-external-anonymous-server.xml"/>
 
 </beans>
\ No newline at end of file

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml Fri Jun  4 20:13:17 2010
@@ -32,11 +32,12 @@ http://cxf.apache.org/jaxws http://cxf.a
 http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
 	<http:conduit
 		name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit">
 		<http:client
-			DecoupledEndpoint="http://localhost:9999/decoupled_endpoint" />
+			DecoupledEndpoint="http://localhost:${testutil.ports.decoupled}/decoupled_endpoint" />
 	</http:conduit>
 
 	<jaxws:endpoint name="{http://cxf.apache.org/greeter_control}GreeterPort" createdFromAPI="true">

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml Fri Jun  4 20:13:17 2010
@@ -32,11 +32,12 @@ http://cxf.apache.org/jaxws http://cxf.a
 http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
 	<http:conduit
 		name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit">
 		<http:client
-			DecoupledEndpoint="http://localhost:9999/decoupled_endpoint" />
+			DecoupledEndpoint="http://localhost:${testutil.ports.decoupled}/decoupled_endpoint" />
 	</http:conduit>
 
 	<jaxws:endpoint name="{http://cxf.apache.org/greeter_control}GreeterPort" createdFromAPI="true">

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-optional.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-optional.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-optional.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-optional.xml Fri Jun  4 20:13:17 2010
@@ -27,9 +27,10 @@ http://cxf.apache.org/transports/http/co
 http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
 http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
     <http:conduit name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit">
-      <http:client DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+      <http:client DecoupledEndpoint="http://localhost:${testutil.ports.decoupled}/decoupled_endpoint"/>
     </http:conduit>
 
     <cxf:bus>
@@ -43,7 +44,7 @@ http://www.springframework.org/schema/be
         </cxf:features>
     </cxf:bus>
 
-    <p:externalAttachment location="org/apache/cxf/systest/ws/policy/addr-optional-external.xml"/>
+    <p:externalAttachment location="${temp.location}/addr-optional-external.xml"/>
     
 
 </beans>
\ No newline at end of file

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr.xml Fri Jun  4 20:13:17 2010
@@ -27,9 +27,10 @@ http://cxf.apache.org/transports/http/co
 http://cxf.apache.org/core http://cxf.apache.org/schemas/core.xsd
 http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
     <http:conduit name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit">
-      <http:client DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+      <http:client DecoupledEndpoint="http://localhost:${testutil.ports.decoupled}/decoupled_endpoint"/>
     </http:conduit>
 
     <cxf:bus>
@@ -38,6 +39,6 @@ http://www.springframework.org/schema/be
         </cxf:features>
     </cxf:bus>
 
-    <p:externalAttachment location="org/apache/cxf/systest/ws/policy/addr-external.xml"/>
+    <p:externalAttachment location="${temp.location}/addr-external.xml"/>
 
 </beans>
\ No newline at end of file

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_client_policy_feature.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_client_policy_feature.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_client_policy_feature.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_client_policy_feature.xml Fri Jun  4 20:13:17 2010
@@ -32,6 +32,7 @@ http://cxf.apache.org/policy http://cxf.
 http://cxf.apache.org/jaxws http://cxf.apache.org/schemas/jaxws.xsd
 http://www.w3.org/ns/ws-policy http://www.w3.org/2007/02/ws-policy.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+   <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
    <jaxws:client name="{http://cxf.apache.org/greeter_control}GreeterPort"
                  createdFromAPI="true">
@@ -44,7 +45,7 @@ http://www.springframework.org/schema/be
     
     <wsp:Policy wsu:Id="DecoupledPolicy">
         <wsp:ExactlyOne>
-            <http:client DecoupledEndpoint="http://localhost:9990/decoupled_endpoint"/>
+            <http:client DecoupledEndpoint="http://localhost:9909/decoupled_endpoint"/>
         </wsp:ExactlyOne>
     </wsp:Policy>
 

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rm.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rm.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rm.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rm.xml Fri Jun  4 20:13:17 2010
@@ -24,9 +24,10 @@
        xsi:schemaLocation="
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
     <http:conduit name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit">
-      <http:client DecoupledEndpoint="http://localhost:9999/decoupled_endpoint"/>
+      <http:client DecoupledEndpoint="http://localhost:${testutil.ports.decoupled}/decoupled_endpoint"/>
     </http:conduit>
 
     <bean id="org.apache.cxf.ws.policy.PolicyEngine" class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">
@@ -36,7 +37,7 @@ http://www.springframework.org/schema/be
 
     <bean class="org.apache.cxf.ws.policy.attachment.external.ExternalAttachmentProvider">
         <constructor-arg ref="cxf"/>
-        <property name="location" value="org/apache/cxf/systest/ws/policy/rm-external.xml"/>
+        <property name="location" value="${temp.location}/rm-external.xml"/>
     </bean>
 
 </beans>
\ No newline at end of file

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl.xml Fri Jun  4 20:13:17 2010
@@ -24,9 +24,10 @@
        xsi:schemaLocation="
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
     <http:conduit name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit">
-      <http:client DecoupledEndpoint="http://localhost:9998/decoupled_endpoint"/>
+      <http:client DecoupledEndpoint="http://localhost:${testutil.ports.decoupled}/decoupled_endpoint"/>
     </http:conduit>
 
     <bean id="org.apache.cxf.ws.policy.PolicyEngine" class="org.apache.cxf.ws.policy.spring.InitializingPolicyEngine">

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml Fri Jun  4 20:13:17 2010
@@ -32,9 +32,10 @@ http://cxf.apache.org/jaxws http://cxf.a
 http://cxf.apache.org/policy http://cxf.apache.org/schemas/policy.xsd
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+	<bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
     <http:conduit name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit">
-      <http:client DecoupledEndpoint="http://localhost:9998/decoupled_endpoint"/>
+      <http:client DecoupledEndpoint="http://localhost:${testutil.ports.decoupled}/decoupled_endpoint"/>
     </http:conduit>
 
     
@@ -47,7 +48,8 @@ http://www.springframework.org/schema/be
         implementor="org.apache.cxf.systest.ws.policy.ReliableGreeterImpl"
         xmlns:ns="http://cxf.apache.org/greeter_control"
         serviceName="ns:ReliableGreeterService"
-        endpointName="ns:GreeterPort">
+        endpointName="ns:GreeterPort"
+        address="http://localhost:${testutil.ports.Server}/SoapContext/GreeterPort">
 		<jaxws:features>
 			<bean class="org.apache.cxf.feature.LoggingFeature"/>
             <p:policies>
@@ -60,7 +62,8 @@ http://www.springframework.org/schema/be
         implementor="org.apache.cxf.systest.ws.policy.ReliableGreeterImpl2"
         xmlns:ns="http://cxf.apache.org/greeter_control"
         serviceName="ns:ReliableGreeterService"
-        endpointName="ns:GreeterPort2">
+        endpointName="ns:GreeterPort2"
+        address="http://localhost:${testutil.ports.Server}/SoapContext/GreeterPort2">
 		<jaxws:features>
 			<bean class="org.apache.cxf.feature.LoggingFeature"/>
             <p:policies>

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java Fri Jun  4 20:13:17 2010
@@ -62,7 +62,7 @@ import org.junit.Test;
  * exchange of WS-RM protocol messages.
  */
 public class ClientPersistenceTest extends AbstractBusClientServerTestBase {
-
+    public static final String PORT = allocatePort(Server.class); 
     public static final String GREETMEONEWAY_ACTION 
         = "http://cxf.apache.org/greeter_control/Greeter/greetMeOneWayRequest";
     public static final String GREETME_ACTION
@@ -90,7 +90,7 @@ public class ClientPersistenceTest exten
                 .setMilliseconds(new BigInteger("60000"));
             
             GreeterImpl implementor = new GreeterImpl();
-            String address = "http://localhost:9020/SoapContext/GreeterPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
             Endpoint ep = Endpoint.create(implementor);
             Map<String, Object> properties = new HashMap<String, Object>();
             properties.put("schema-validation-enabled", Boolean.TRUE);
@@ -150,7 +150,7 @@ public class ClientPersistenceTest exten
         verifyRecovery();
     }
     
-    void startClient() {
+    void startClient() throws Exception {
         LOG.fine("Creating greeter client");
         SpringBusFactory bf = new SpringBusFactory();
         bus = bf.createBus("/org/apache/cxf/systest/ws/rm/persistent.xml");
@@ -158,6 +158,7 @@ public class ClientPersistenceTest exten
 
         GreeterService gs = new GreeterService();
         greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         ((BindingProvider)greeter).getRequestContext().put("schema-validation-enabled", Boolean.TRUE);
 
         out = new OutMessageRecorder();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledBareTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledBareTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledBareTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledBareTest.java Fri Jun  4 20:13:17 2010
@@ -47,7 +47,9 @@ import org.junit.Test;
  * exchange of WS-RM protocol messages.
  */
 public class DecoupledBareTest extends AbstractBusClientServerTestBase {
-
+    public static final String PORT = allocatePort(Server.class);
+    public static final String DECOUPLE_PORT = allocatePort("decoupled.port");
+    
     private static final Logger LOG = LogUtils.getLogger(DecoupledBareTest.class);
 
     public static class Server extends AbstractBusTestServerBase {
@@ -58,7 +60,7 @@ public class DecoupledBareTest extends A
             BusFactory.setDefaultBus(bus);
             
             Object implementor = new DocLitBareGreeterImpl();
-            String address = "http://localhost:7600/SoapContext/SoapPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
             Endpoint ep = Endpoint.create(implementor);
             Map<String, Object> properties = new HashMap<String, Object>();
             properties.put("schema-validation-enabled", Boolean.TRUE);
@@ -96,6 +98,7 @@ public class DecoupledBareTest extends A
         assertNotNull(service);
 
         DocLitBare greeter = service.getSoapPort();
+        updateAddressPort(greeter, PORT);
         ((BindingProvider)greeter).getRequestContext().put("schema-validation-enabled", Boolean.TRUE);
 
         ConnectionHelper.setKeepAliveConnection(greeter, true);

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java Fri Jun  4 20:13:17 2010
@@ -46,6 +46,8 @@ import org.junit.Test;
  * exchange of WS-RM protocol messages.
  */
 public class DecoupledClientServerTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String DECOUPLE_PORT = allocatePort("decoupled.port");
 
     private static final Logger LOG = LogUtils.getLogger(DecoupledClientServerTest.class);
     private Bus bus;
@@ -66,7 +68,7 @@ public class DecoupledClientServerTest e
             GreeterImpl implementor = new GreeterImpl();
             implementor.useLastOnewayArg(true);
             implementor.setDelay(5000);
-            String address = "http://localhost:9020/SoapContext/GreeterPort";
+            String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
             
             Endpoint ep = Endpoint.create(implementor);
             Map<String, Object> properties = new HashMap<String, Object>();
@@ -122,6 +124,7 @@ public class DecoupledClientServerTest e
         
         GreeterService gs = new GreeterService();
         final Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         ((BindingProvider)greeter).getRequestContext().put("schema-validation-enabled", 
                                                            shouldValidate());
         LOG.fine("Created greeter client.");

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java Fri Jun  4 20:13:17 2010
@@ -90,6 +90,7 @@ import org.junit.Test;
  * exchange of WS-RM protocol messages.
  */
 public class SequenceTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = Server.PORT;
 
     private static final Logger LOG = LogUtils.getLogger(SequenceTest.class);
     private static final QName GREETMEONEWAY_NAME 
@@ -103,9 +104,8 @@ public class SequenceTest extends Abstra
     private static final String GREETME_RESPONSE_ACTION
         = "http://cxf.apache.org/greeter_control/Greeter/greetMeResponse";
 
-    private static int decoupledEndpointPort = 10000;
     private static String decoupledEndpoint;
-
+    private static int decoupledCount = 1;
     private Bus controlBus;
     private Control control;
     private Bus greeterBus;
@@ -1309,6 +1309,11 @@ public class SequenceTest extends Abstra
 
         ControlService cs = new ControlService();
         control = cs.getControlPort();
+        try {
+            updateAddressPort(control, PORT);
+        } catch (Exception ex) {
+            //ignore
+        }
         
         assertTrue("Failed to start greeter", control.startGreeter(cfgResource));        
     }
@@ -1338,6 +1343,11 @@ public class SequenceTest extends Abstra
         dispatch = gs.createDispatch(GreeterService.GreeterPort,
                                      DOMSource.class, 
                                      Service.Mode.MESSAGE);
+        try {
+            updateAddressPort(dispatch, PORT);
+        } catch (Exception e) {
+            //ignore
+        }
         dispatch.getRequestContext().put(
                                      BindingProvider.SOAPACTION_USE_PROPERTY, 
                                      false);
@@ -1355,6 +1365,11 @@ public class SequenceTest extends Abstra
         }
    
         greeter = gs.getGreeterPort();
+        try {
+            updateAddressPort(greeter, PORT);
+        } catch (Exception e) {
+            //ignore
+        }
         LOG.fine("Created greeter client.");
 
         ConnectionHelper.setKeepAliveConnection(greeter, true);
@@ -1367,9 +1382,8 @@ public class SequenceTest extends Abstra
     private void initDecoupledEndpoint(Client c) {
         // programatically configure decoupled endpoint that is guaranteed to
         // be unique across all test cases
-        
-        decoupledEndpointPort--;
-        decoupledEndpoint = "http://localhost:" + decoupledEndpointPort + "/decoupled_endpoint";
+        decoupledEndpoint = "http://localhost:" 
+            + allocatePort("decoupled-" + decoupledCount++) + "/decoupled_endpoint";
 
         HTTPConduit hc = (HTTPConduit)(c.getConduit());
         HTTPClientPolicy cp = hc.getClient();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/Server.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/Server.java Fri Jun  4 20:13:17 2010
@@ -28,8 +28,10 @@ import org.apache.cxf.bus.spring.SpringB
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
-   
-    private static final String ADDRESS = "http://localhost:9001/SoapContext/ControlPort";
+    public static final String PORT = allocatePort(Server.class);
+    private static final String ADDRESS = "http://localhost:" + PORT + "/SoapContext/ControlPort";
+    private static final String GREETER_ADDRESS 
+        = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
  
     protected void run()  {
 
@@ -40,6 +42,7 @@ public class Server extends AbstractBusT
 
         System.out.println("Created control bus " + bus);
         ControlImpl implementor = new ControlImpl();
+        implementor.setAddress(GREETER_ADDRESS);
         GreeterImpl greeterImplementor = new GreeterImpl();
         implementor.setImplementor(greeterImplementor);
         Endpoint.publish(ADDRESS, implementor);

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java Fri Jun  4 20:13:17 2010
@@ -54,6 +54,8 @@ import org.junit.Test;
  * exchange of WS-RM protocol messages.
  */
 public class ServerPersistenceTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = Server.PORT;
+    public static final String DECOUPLE_PORT = allocatePort("decoupled.port");
 
     public static final String GREETMEONEWAY_ACTION 
         = "http://cxf.apache.org/greeter_control/Greeter/greetMeOneWayRequest";
@@ -88,10 +90,6 @@ public class ServerPersistenceTest exten
                 System.clearProperty("derby.system.home");
             }
         }
-        
-        // run server in process to avoid a problem with UUID generation
-        // during asynchronous invocations
-
         assertTrue("server did not launch correctly", launchServer(Server.class));  
     }
     
@@ -103,7 +101,8 @@ public class ServerPersistenceTest exten
         LOG.fine("Created bus " + bus + " with default cfg");
         ControlService cs = new ControlService();
         Control control = cs.getControlPort();
-
+        updateAddressPort(control, PORT);
+        
         assertTrue("Failed to start greeter", control.startGreeter(SERVER_LOSS_CFG)); 
         LOG.fine("Started greeter server.");
         
@@ -116,6 +115,7 @@ public class ServerPersistenceTest exten
             .setMilliseconds(new BigInteger("60000"));
         GreeterService gs = new GreeterService();
         Greeter greeter = gs.getGreeterPort();
+        updateAddressPort(greeter, PORT);
         
         LOG.fine("Created greeter client.");
  
@@ -124,7 +124,7 @@ public class ServerPersistenceTest exten
         Client c = ClientProxy.getClient(greeter);
         HTTPConduit hc = (HTTPConduit)(c.getConduit());
         HTTPClientPolicy cp = hc.getClient();
-        cp.setDecoupledEndpoint("http://localhost:9994/decoupled_endpoint");
+        cp.setDecoupledEndpoint("http://localhost:" + DECOUPLE_PORT + "/decoupled_endpoint");
 
         out = new OutMessageRecorder();
         in = new InMessageRecorder();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled.xml Fri Jun  4 20:13:17 2010
@@ -23,9 +23,10 @@
        xsi:schemaLocation="
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
   
     <http:conduit name="{http://cxf.apache.org/greeter_control}GreeterPort.http-conduit">
-      <http:client DecoupledEndpoint="http://localhost:9995/decoupled_endpoint"/>
+      <http:client DecoupledEndpoint="http://localhost:${testutil.ports.decoupled.port}/decoupled_endpoint"/>
     </http:conduit>
     
     <bean id="mapAggregator" class="org.apache.cxf.ws.addressing.MAPAggregator"/>

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled_bare.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled_bare.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled_bare.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled_bare.xml Fri Jun  4 20:13:17 2010
@@ -23,9 +23,10 @@
        xsi:schemaLocation="
 http://cxf.apache.org/transports/http/configuration http://cxf.apache.org/schemas/configuration/http-conf.xsd
 http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
   
     <http:conduit name="{http://apache.org/hello_world_soap_http}SoapPort.http-conduit">
-      <http:client DecoupledEndpoint="http://localhost:9995/decoupled_endpoint"/>
+      <http:client DecoupledEndpoint="http://localhost:${testutil.ports.decoupled.port}/decoupled_endpoint"/>
     </http:conduit>
     
     <bean id="mapAggregator" class="org.apache.cxf.ws.addressing.MAPAggregator"/>

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/SecurityPolicyTest.java Fri Jun  4 20:13:17 2010
@@ -59,15 +59,20 @@ import org.junit.Test;
 
 
 public class SecurityPolicyTest extends AbstractBusClientServerTestBase  {
-    public static final String POLICY_ADDRESS = "http://localhost:9010/SecPolTest";
-    public static final String POLICY_HTTPS_ADDRESS = "https://localhost:9009/SecPolTest";
-    public static final String POLICY_ENCSIGN_ADDRESS = "http://localhost:9010/SecPolTestEncryptThenSign";
-    public static final String POLICY_SIGNENC_ADDRESS = "http://localhost:9010/SecPolTestSignThenEncrypt";
+    public static final String PORT = allocatePort(SecurityPolicyTest.class);
+    public static final String SSL_PORT = allocatePort(SecurityPolicyTest.class, 1);
+
+    public static final String POLICY_ADDRESS = "http://localhost:" + PORT + "/SecPolTest";
+    public static final String POLICY_HTTPS_ADDRESS = "https://localhost:" + SSL_PORT + "/SecPolTest";
+    public static final String POLICY_ENCSIGN_ADDRESS = "http://localhost:" 
+            + PORT + "/SecPolTestEncryptThenSign";
+    public static final String POLICY_SIGNENC_ADDRESS = "http://localhost:" 
+            + PORT + "/SecPolTestSignThenEncrypt";
     public static final String POLICY_SIGNENC_PROVIDER_ADDRESS 
-        = "http://localhost:9010/SecPolTestSignThenEncryptProvider";
-    public static final String POLICY_SIGN_ADDRESS = "http://localhost:9010/SecPolTestSign";
-    public static final String POLICY_XPATH_ADDRESS = "http://localhost:9010/SecPolTestXPath";
-    public static final String POLICY_SIGNONLY_ADDRESS = "http://localhost:9010/SecPolTestSignedOnly";
+        = "http://localhost:" + PORT + "/SecPolTestSignThenEncryptProvider";
+    public static final String POLICY_SIGN_ADDRESS = "http://localhost:" + PORT + "/SecPolTestSign";
+    public static final String POLICY_XPATH_ADDRESS = "http://localhost:" + PORT + "/SecPolTestXPath";
+    public static final String POLICY_SIGNONLY_ADDRESS = "http://localhost:" + PORT + "/SecPolTestSignedOnly";
 
     
     public static class ServerPasswordCallback implements CallbackHandler {
@@ -162,6 +167,7 @@ public class SecurityPolicyTest extends 
         DoubleItPortType pt;
 
         pt = service.getDoubleItPortXPath();
+        updateAddressPort(pt, PORT);
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, 
                                                       new KeystorePasswordCallback());
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
@@ -172,6 +178,7 @@ public class SecurityPolicyTest extends 
         
         
         pt = service.getDoubleItPortEncryptThenSign();
+        updateAddressPort(pt, PORT);
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, 
                                                       new KeystorePasswordCallback());
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
@@ -181,6 +188,7 @@ public class SecurityPolicyTest extends 
         pt.doubleIt(BigInteger.valueOf(5));
         
         pt = service.getDoubleItPortSign();
+        updateAddressPort(pt, PORT);
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, 
                                                       new KeystorePasswordCallback());
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
@@ -191,6 +199,7 @@ public class SecurityPolicyTest extends 
 
         
         pt = service.getDoubleItPortSignThenEncrypt();
+        updateAddressPort(pt, PORT);
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, 
                                                       new KeystorePasswordCallback());
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
@@ -205,6 +214,7 @@ public class SecurityPolicyTest extends 
         assertEquals(10, x);
         
         pt = service.getDoubleItPortHttps();
+        updateAddressPort(pt, SSL_PORT);
         try {
             pt.doubleIt(BigInteger.valueOf(25));
         } catch (Exception ex) {
@@ -220,6 +230,7 @@ public class SecurityPolicyTest extends 
         
         try {
             pt = service.getDoubleItPortHttp();
+            updateAddressPort(pt, PORT);
             pt.doubleIt(BigInteger.valueOf(25));
             fail("https policy should have triggered");
         } catch (Exception ex) {
@@ -239,6 +250,7 @@ public class SecurityPolicyTest extends 
         DoubleItPortType pt;
 
         pt = service.getDoubleItPortSignedOnly();
+        updateAddressPort(pt, PORT);
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.CALLBACK_HANDLER, 
                                                       new KeystorePasswordCallback());
         ((BindingProvider)pt).getRequestContext().put(SecurityConstants.SIGNATURE_PROPERTIES,
@@ -276,6 +288,7 @@ public class SecurityPolicyTest extends 
                                      getClass().getResource("alice.properties"));
         disp.getRequestContext().put(SecurityConstants.ENCRYPT_PROPERTIES, 
                                      getClass().getResource("bob.properties"));
+        updateAddressPort(disp, PORT);
 
         String req = "<ns2:DoubleIt xmlns:ns2=\"http://cxf.apache.org/policytest/DoubleIt\">"
             + "<numberToDouble>25</numberToDouble></ns2:DoubleIt>";

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/Server.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/Server.java Fri Jun  4 20:13:17 2010
@@ -25,6 +25,7 @@ import org.apache.cxf.bus.spring.SpringB
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase {
+    public static final String PORT = allocatePort(Server.class);
 
     protected void run()  {
         SpringBusFactory factory = new SpringBusFactory();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/WSSecurityClientTest.java Fri Jun  4 20:13:17 2010
@@ -59,6 +59,8 @@ import org.junit.Test;
  *
  */
 public class WSSecurityClientTest extends AbstractBusClientServerTestBase {
+    public static final String PORT = allocatePort(Server.class);
+    public static final String DEC_PORT = allocatePort(WSSecurityClientTest.class);
 
     private static final java.net.URL WSDL_LOC;
     static {
@@ -102,10 +104,11 @@ public class WSSecurityClientTest extend
     }
     
     @Test
-    public void testUsernameToken() {
+    public void testUsernameToken() throws Exception {
         final javax.xml.ws.Service svc 
             = javax.xml.ws.Service.create(WSDL_LOC, GREETER_SERVICE_QNAME);
         final Greeter greeter = svc.getPort(USERNAME_TOKEN_PORT_QNAME, Greeter.class);
+        updateAddressPort(greeter, PORT);
         
         Client client = ClientProxy.getClient(greeter);
         Map<String, Object> props = new HashMap<String, Object>();
@@ -137,7 +140,7 @@ public class WSSecurityClientTest extend
     }
 
     @Test
-    public void testTimestampSignEncrypt() {
+    public void testTimestampSignEncrypt() throws Exception {
         BusFactory.setDefaultBus(
             new SpringBusFactory().createBus(
                 "org/apache/cxf/systest/ws/security/client.xml"
@@ -151,6 +154,7 @@ public class WSSecurityClientTest extend
             TIMESTAMP_SIGN_ENCRYPT_PORT_QNAME,
             Greeter.class
         );
+        updateAddressPort(greeter, PORT);
 
         // Add a No-Op JAX-WS SoapHandler to the dispatch chain to
         // verify that the SoapHandlerInterceptor can peacefully co-exist
@@ -268,7 +272,7 @@ public class WSSecurityClientTest extend
         service.addPort(
             USERNAME_TOKEN_PORT_QNAME,
             decoupled ? SOAPBinding.SOAP11HTTP_BINDING : HTTPBinding.HTTP_BINDING, 
-            "http://localhost:9000/GreeterService/UsernameTokenPort"
+            "http://localhost:" + PORT + "/GreeterService/UsernameTokenPort"
         );
         final Dispatch<Source> dispatcher = service.createDispatch(
             USERNAME_TOKEN_PORT_QNAME,
@@ -284,7 +288,7 @@ public class WSSecurityClientTest extend
         );
         if (decoupled) {
             HTTPConduit cond = (HTTPConduit)((DispatchImpl)dispatcher).getClient().getConduit();
-            cond.getClient().setDecoupledEndpoint("http://localhost:9001/decoupled");
+            cond.getClient().setDecoupledEndpoint("http://localhost:" + DEC_PORT + "/decoupled");
         }
         return dispatcher;
     }

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/https_config.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/https_config.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/https_config.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/https_config.xml Fri Jun  4 20:13:17 2010
@@ -30,6 +30,7 @@ under the License.
         http://cxf.apache.org/transports/http-jetty/configuration   http://cxf.apache.org/schemas/configuration/http-jetty.xsd
         http://cxf.apache.org/configuration/security                http://cxf.apache.org/schemas/configuration/security.xsd
         ">
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
 
     <!-- -->
     <!-- This Spring config file is designed to represent a minimal -->
@@ -47,7 +48,7 @@ under the License.
     <!-- TLS Port configuration parameters for port 9009 -->
     <!-- -->
     <httpj:engine-factory id="port-9009-tls-config">
-        <httpj:engine port="9009">
+        <httpj:engine port="${testutil.ports.SecurityPolicyTest.1}">
             <httpj:tlsServerParameters>
                <sec:keyManagers keyPassword="password">
                    <sec:keyStore type="JKS" password="password" 

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/server.xml?rev=951551&r1=951550&r2=951551&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/server.xml (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/security/server.xml Fri Jun  4 20:13:17 2010
@@ -31,6 +31,8 @@
         http://www.springframework.org/schema/beans/spring-beans.xsd
         http://cxf.apache.org/jaxws                                     
         http://cxf.apache.org/schemas/jaxws.xsd">
+  
+   <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
     
     <!--    
          Enable logging at all endpoints    
@@ -49,7 +51,7 @@
     <jaxws:endpoint
         id="UsernameTokenEndpoint"
         implementor="org.apache.cxf.systest.ws.security.GreeterImpl"
-        address="http://localhost:9000/GreeterService/UsernameTokenPort"
+        address="http://localhost:${testutil.ports.Server}/GreeterService/UsernameTokenPort"
         serviceName="test:GreeterService"
         endpointName="test:UsernameTokenPort"
         >
@@ -86,7 +88,7 @@
     <jaxws:endpoint 
         id="TimestampSignEncryptEndpoint"
         implementor="org.apache.cxf.systest.ws.security.GreeterImpl"
-        address="http://localhost:9000/GreeterService/TimestampSignEncryptPort"
+        address="http://localhost:${testutil.ports.Server}/GreeterService/TimestampSignEncryptPort"
         serviceName="test:GreeterService"
         endpointName="test:TimestampSignEncryptPort"
         >