cxf-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dk...@apache.org
Subject svn commit: r953806 [2/3] - in /cxf/branches/2.2.x-fixes: ./ rt/transports/jms/src/main/java/org/apache/cxf/transport/jms/ rt/ws/addr/src/main/java/org/apache/cxf/ws/addressing/ systests/jaxrs/src/test/java/org/apache/cxf/systest/jaxrs/ systests/jaxrs/...
Date Fri, 11 Jun 2010 18:28:59 GMT
Added: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/AbstractGreeterImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/AbstractGreeterImpl.java?rev=953806&view=auto
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/AbstractGreeterImpl.java (added)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/AbstractGreeterImpl.java Fri Jun 11 18:28:57 2010
@@ -0,0 +1,203 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package org.apache.cxf.systest.ws.addressing;
+
+import java.util.Date;
+import java.util.concurrent.Future;
+
+import javax.annotation.Resource;
+import javax.xml.ws.AsyncHandler;
+import javax.xml.ws.Response;
+import javax.xml.ws.WebServiceContext;
+
+import org.apache.cxf.ws.addressing.AddressingProperties;
+import org.apache.hello_world_soap_http.BadRecordLitFault;
+import org.apache.hello_world_soap_http.Greeter;
+import org.apache.hello_world_soap_http.NoSuchCodeLitFault;
+import org.apache.hello_world_soap_http.types.BareDocumentResponse;
+import org.apache.hello_world_soap_http.types.ErrorCode;
+import org.apache.hello_world_soap_http.types.GreetMeLaterResponse;
+import org.apache.hello_world_soap_http.types.GreetMeResponse;
+import org.apache.hello_world_soap_http.types.GreetMeSometimeResponse;
+import org.apache.hello_world_soap_http.types.NoSuchCodeLit;
+import org.apache.hello_world_soap_http.types.SayHiResponse;
+import org.apache.hello_world_soap_http.types.TestDocLitFaultResponse;
+import org.apache.hello_world_soap_http.types.TestNillableResponse;
+
+import static org.apache.cxf.ws.addressing.JAXWSAConstants.SERVER_ADDRESSING_PROPERTIES_INBOUND;
+
+public abstract class AbstractGreeterImpl implements Greeter {
+    VerificationCache verificationCache;
+    
+    /**
+     * Injectable context.
+     */
+    @Resource
+    private WebServiceContext context;
+
+    
+    public AbstractGreeterImpl() {
+    }
+
+
+    public String greetMe(String me) {
+        System.out.println("\n\n*** GreetMe called with: " + me + "***\n\n");
+        verifyMAPs();
+        return "Hello " + me;
+    }
+
+    public String greetMeLater(long delay) {
+        System.out.println("\n\n*** GreetMeLater called with: " + delay
+                           + " at: " + new Date().toString()
+                           + "***\n\n");
+        if (delay > 0) {
+            try {
+                Thread.sleep(delay);
+            } catch (InterruptedException ex) {
+                // ignore
+            }
+        }
+        verifyMAPs();
+        return "Hello, finally";
+    }
+
+    public void greetMeOneWay(String requestType) {   
+        System.out.println("\n\n*** GreetMeOneWay called with: " + requestType + "***\n\n");
+        verifyMAPs();
+    }
+
+    public String sayHi() {
+        verifyMAPs();
+        return "Bonjour";
+    }
+    
+    public void testDocLitFault(String faultType) throws BadRecordLitFault, NoSuchCodeLitFault {
+        verifyMAPs();
+        if (faultType.equals(BadRecordLitFault.class.getSimpleName())) {
+            throw new BadRecordLitFault("TestBadRecordLit", "BadRecordLitFault");
+        }
+        if (faultType.equals(NoSuchCodeLitFault.class.getSimpleName())) {
+            ErrorCode ec = new ErrorCode();
+            ec.setMajor((short)1);
+            ec.setMinor((short)1);
+            NoSuchCodeLit nscl = new NoSuchCodeLit();
+            nscl.setCode(ec);
+            throw new NoSuchCodeLitFault("TestNoSuchCodeLit", nscl);
+        }
+    }
+
+    public BareDocumentResponse testDocLitBare(String in) {
+        BareDocumentResponse res = new BareDocumentResponse();
+        res.setCompany("Celtix");
+        res.setId(1);
+        return res;
+    }
+
+    private void verifyMAPs() {
+        if (context.getMessageContext() != null) {
+            String property = SERVER_ADDRESSING_PROPERTIES_INBOUND;
+            AddressingProperties maps = (AddressingProperties)
+                context.getMessageContext().get(property);
+            verificationCache.put(MAPTest.verifyMAPs(maps, this));
+        }
+    }
+
+    public String greetMeSometime(String me) {
+        return "How are you " + me;
+    }
+    
+    public Future<?>  greetMeSometimeAsync(String requestType, 
+                                           AsyncHandler<GreetMeSometimeResponse> asyncHandler) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Response<GreetMeSometimeResponse> greetMeSometimeAsync(String requestType) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Response<TestDocLitFaultResponse> testDocLitFaultAsync(String faultType) {  
+        return null; 
+        /*not called */
+    }
+    
+    public Future<?> testDocLitFaultAsync(String faultType, AsyncHandler ah) {  
+        return null; 
+        /*not called */
+    }
+    
+    public Future<?> testDocLitBareAsync(String bare, AsyncHandler ah) {
+        return null;
+        /* not called */
+    }
+    
+    public Response<BareDocumentResponse> testDocLitBareAsync(String bare) {
+        return null;
+        /* not called */
+    }
+    
+    public Future<?> greetMeAsync(String requestType, AsyncHandler<GreetMeResponse> asyncHandler) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Response<GreetMeResponse> greetMeAsync(String requestType) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Future<?> greetMeLaterAsync(long requestType, AsyncHandler<GreetMeLaterResponse> asyncHandler) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Response<GreetMeLaterResponse> greetMeLaterAsync(long requestType) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Future<?> sayHiAsync(AsyncHandler<SayHiResponse> asyncHandler) { 
+        return null; 
+        /*not called */
+    }
+    
+    public Response<SayHiResponse> sayHiAsync() { 
+        return null; 
+        /*not called */
+    }
+
+    public String testNillable(String nillElem, int intElem) {
+        // TODO Auto-generated method stub
+        return null;
+    }
+
+    public Response<TestNillableResponse> testNillableAsync(String nillElem,
+                                                            int intElem) {
+        return null;
+    }
+    
+    public Future<?> testNillableAsync(String nillElem, 
+                                       int intElem,
+                                       AsyncHandler<TestNillableResponse> asyncHandler) {
+        return null;
+    }
+    
+}

Propchange: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/AbstractGreeterImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Propchange: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/AbstractGreeterImpl.java
------------------------------------------------------------------------------
    svn:keywords = Rev Date

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java Fri Jun 11 18:28:57 2010
@@ -20,7 +20,12 @@
 package org.apache.cxf.systest.ws.addressing;
 
 import java.lang.reflect.UndeclaredThrowableException;
+
+import javax.jws.WebService;
+
 import org.apache.hello_world_soap_http.BadRecordLitFault;
+
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 
@@ -28,6 +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:" + PORT + "/SoapContext/SoapPort";
 
     private static final String CONFIG;
     static {
@@ -40,7 +46,29 @@ public class MAPTest extends MAPTestBase
     public String getConfigFileName() {
         return CONFIG;
     }
+    public String getAddress() {
+        return ADDRESS;
+    }
     
+
+    @BeforeClass
+    public static void startServers() throws Exception {
+        // special case handling for WS-Addressing system test to avoid
+        // UUID related issue when server is run as separate process
+        // via maven on Win2k
+        boolean inProcess = "Windows 2000".equals(System.getProperty("os.name"));
+        assertTrue("server did not launch correctly", 
+                   launchServer(Server.class, null,
+                                new String[] {ADDRESS, GreeterImpl.class.getName()},  inProcess));
+    }
+    @WebService(serviceName = "SOAPServiceAddressing", 
+                portName = "SoapPort", 
+                endpointInterface = "org.apache.hello_world_soap_http.Greeter", 
+                targetNamespace = "http://apache.org/hello_world_soap_http",
+                wsdlLocation = "testutils/hello_world.wsdl")
+    public static class GreeterImpl extends org.apache.cxf.systest.ws.addressing.AbstractGreeterImpl {
+        
+    }
     
     @Test
     public void testUsingKeepAliveConnection() throws Exception {

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java Fri Jun 11 18:28:57 2010
@@ -54,7 +54,6 @@ import org.apache.hello_world_soap_http.
 import org.junit.After;
 import org.junit.AfterClass;
 import org.junit.Before;
-import org.junit.BeforeClass;
 import org.junit.Ignore;
 import org.junit.Test;
 
@@ -65,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";
@@ -80,25 +81,13 @@ public abstract class MAPTestBase extend
 
     private static final QName SERVICE_NAME = 
         new QName("http://apache.org/hello_world_soap_http", "SOAPServiceAddressing");
-    private static final String NOWHERE = "http://nowhere.nada.nothing.nought:5555";
-    private static final String DECOUPLED = "http://localhost:9999/decoupled_endpoint";
     
     private static Map<Object, Map<String, String>> messageIDs =
         new HashMap<Object, Map<String, String>>();
     protected Greeter greeter;
     private String verified;
     
-    
 
-    @BeforeClass
-    public static void startServers() throws Exception {
-        // special case handling for WS-Addressing system test to avoid
-        // UUID related issue when server is run as separate process
-        // via maven on Win2k
-        boolean inProcess = "Windows 2000".equals(System.getProperty("os.name"));
-        assertTrue("server did not launch correctly", 
-                   launchServer(Server.class, inProcess));
-    }
     
     @AfterClass
     public static void shutdownBus() throws Exception {
@@ -119,6 +108,7 @@ public abstract class MAPTestBase extend
     }
     
     public abstract String getConfigFileName();
+    public abstract String getAddress();
     
     @Before
     public void setUp() throws Exception {
@@ -140,21 +130,27 @@ public abstract class MAPTestBase extend
         addInterceptors(staticBus.getInFaultInterceptors(), interceptors);
         
         EndpointReferenceType target = 
-            EndpointReferenceUtils.getEndpointReference(Server.ADDRESS);
+            EndpointReferenceUtils.getEndpointReference(getAddress());
         ReferenceParametersType params = 
             ContextUtils.WSA_OBJECT_FACTORY.createReferenceParametersType();
         JAXBElement<String> param =
              new JAXBElement<String>(CUSTOMER_NAME, String.class, CUSTOMER_KEY);
         params.getAny().add(param);
         target.setReferenceParameters(params);
-        URL wsdl = getClass().getResource("/wsdl/hello_world.wsdl");
-        ServiceImpl serviceImpl = 
-            ServiceDelegateAccessor.get(new SOAPService(wsdl, SERVICE_NAME));
-        greeter = serviceImpl.getPort(target, Greeter.class);
-
+        greeter = createGreeter(target);
         mapVerifier.verificationCache = this;
         headerVerifier.verificationCache = this;
     }
+    public URL getWSDLURL() {
+        return getClass().getResource("/wsdl/hello_world.wsdl");
+    }
+    public Greeter createGreeter(EndpointReferenceType target) throws Exception {
+        ServiceImpl serviceImpl = 
+            ServiceDelegateAccessor.get(new SOAPService(getWSDLURL(), SERVICE_NAME));
+        Greeter g = serviceImpl.getPort(target, Greeter.class);
+        updateAddressPort(g, PORT);
+        return g;
+    }
     
     @After
     public void tearDown() throws Exception {
@@ -190,7 +186,7 @@ public abstract class MAPTestBase extend
     }
 
     @Test
-    @Ignore("randomly fails quite often, but not in the debugger so not sure what is going on yet")
+    //                    + " debugger so not sure what is going on yet")
     public void testExplicitMAPs() throws Exception {
         try {
             String msgId = "urn:uuid:12345-" + Math.random();
@@ -232,7 +228,6 @@ public abstract class MAPTestBase extend
     }
     
     @Test
-    @Ignore
     public void testFaultTo() throws Exception {
         try {
             String greeting = greeter.greetMe("warmup");
@@ -240,20 +235,11 @@ public abstract class MAPTestBase extend
                          "Hello warmup",
                          greeting);
             checkVerification();
-
-            Map<String, Object> requestContext = 
-                ((BindingProvider)greeter).getRequestContext();
-            AddressingProperties maps = new AddressingPropertiesImpl();
-            maps.setReplyTo(EndpointReferenceUtils.getEndpointReference(NOWHERE));
-            maps.setFaultTo(EndpointReferenceUtils.getEndpointReference(DECOUPLED));
-            requestContext.put(CLIENT_ADDRESSING_PROPERTIES, maps);
             try {
                 greeter.testDocLitFault("BadRecordLitFault");
                 fail("expected fault from service");
             } catch (BadRecordLitFault brlf) {
                 checkVerification();
-            } catch (UndeclaredThrowableException ex) {
-                throw (Exception)ex.getCause();
             }
         } catch (UndeclaredThrowableException ex) {
             throw (Exception)ex.getCause();

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java Fri Jun 11 18:28:57 2010
@@ -19,6 +19,9 @@
 
 package org.apache.cxf.systest.ws.addressing;
 
+import javax.jws.WebService;
+
+import org.junit.BeforeClass;
 import org.junit.Test;
 
 
@@ -27,6 +30,7 @@ import org.junit.Test;
  * in the non-decoupled case.
  */
 public class NonDecoupledTest extends MAPTestBase {
+    static final String ADDRESS = "http://localhost:" + PORT + "/SoapContext/SoapPort";
 
     private static final String CONFIG =
         "org/apache/cxf/systest/ws/addressing/wsa_interceptors.xml";
@@ -35,9 +39,34 @@ public class NonDecoupledTest extends MA
         return CONFIG;
     }
     
+    @BeforeClass
+    public static void startServers() throws Exception {
+        // special case handling for WS-Addressing system test to avoid
+        // UUID related issue when server is run as separate process
+        // via maven on Win2k
+        boolean inProcess = "Windows 2000".equals(System.getProperty("os.name"));
+        assertTrue("server did not launch correctly", 
+                   launchServer(Server.class, null, 
+                                new String[] {ADDRESS, GreeterImpl.class.getName()}, inProcess));
+    }
+    
+    @WebService(serviceName = "SOAPServiceAddressing", 
+                portName = "SoapPort", 
+                endpointInterface = "org.apache.hello_world_soap_http.Greeter", 
+                targetNamespace = "http://apache.org/hello_world_soap_http",
+                wsdlLocation = "testutils/hello_world.wsdl")
+    public static class GreeterImpl extends org.apache.cxf.systest.ws.addressing.AbstractGreeterImpl {
+        
+    }
+    public String getAddress() {
+        return ADDRESS;
+    }
+
+    
     @Test
     public void foo() {
         
     }
+    
 }
 

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java Fri Jun 11 18:28:57 2010
@@ -33,12 +33,17 @@ import org.apache.cxf.interceptor.Interc
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 
 public class Server extends AbstractBusTestServerBase implements VerificationCache {
-    static final String ADDRESS = "http://localhost:9008/SoapContext/SoapPort";
 
     private String verified;
+    private String address;
+    private Class<?> cls;
  
-    protected void run()  {
-
+    public Server(String[] args) throws Exception {
+        address = args[0];
+        cls = Class.forName(args[1]);
+    }
+    
+    protected void run() {
         SpringBusFactory factory = new SpringBusFactory();
         Bus bus = factory.createBus("org/apache/cxf/systest/ws/addressing/server.xml");
         BusFactory.setDefaultBus(bus);
@@ -46,9 +51,13 @@ public class Server extends AbstractBusT
 
         addVerifiers();
 
-        GreeterImpl implementor = new GreeterImpl();
-        implementor.verificationCache = this;
-        Endpoint.publish(ADDRESS, implementor);
+        try {
+            AbstractGreeterImpl implementor = (AbstractGreeterImpl)cls.newInstance();
+            implementor.verificationCache = this;
+            Endpoint.publish(address, implementor);
+        } catch (Exception ex) {
+            throw new RuntimeException(ex);
+        }
     }
 
     protected void addVerifiers() {
@@ -73,7 +82,7 @@ public class Server extends AbstractBusT
         
     public static void main(String[] args) {
         try { 
-            Server s = new Server(); 
+            Server s = new Server(args); 
             s.start();
         } catch (Exception ex) {
             ex.printStackTrace();

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf-hpux.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf-hpux.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf-hpux.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf-hpux.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/cxf.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureTest.java Fri Jun 11 18:28:57 2010
@@ -28,6 +28,7 @@ import org.apache.cxf.interceptor.Interc
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 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;
@@ -36,12 +37,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());
         
@@ -55,7 +57,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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/spring/WSAFeatureXmlTest.java Fri Jun 11 18:28:57 2010
@@ -32,6 +32,7 @@ import org.apache.cxf.interceptor.Interc
 import org.apache.cxf.jaxws.JaxWsProxyFactoryBean;
 import org.apache.cxf.jaxws.JaxWsServerFactoryBean;
 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;
@@ -39,7 +40,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");
@@ -51,7 +53,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);
@@ -67,7 +69,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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingAnonymousPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingAnonymousPolicyTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingAnonymousPolicyTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingAnonymousPolicyTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingInlinePolicyTest.java Fri Jun 11 18:28:57 2010
@@ -46,6 +46,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);
 
@@ -56,7 +58,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);
@@ -92,6 +94,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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPServerPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPServerPolicyTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPServerPolicyTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPServerPolicyTest.java Fri Jun 11 18:28:57 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();
         

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyWsdlTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-client.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-client.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-client.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-client.xml Fri Jun 11 18:28:57 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
+</beans>

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-server.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-server.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-server.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-anon-server.xml Fri Jun 11 18:28:57 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
+</beans>

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-inline-policy.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-optional.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-optional.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-optional.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr-optional.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/addr.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_client_policy_feature.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_client_policy_feature.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_client_policy_feature.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/http_client_policy_feature.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rm.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rm.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rm.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rm.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/rmwsdl_server.xml Fri Jun 11 18:28:57 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>
@@ -83,4 +86,4 @@ http://www.springframework.org/schema/be
                     <wsrmp:BaseRetransmissionInterval Milliseconds="30000"/>
                 </wsrmp:RMAssertion>
     </wsp:Policy>
-</beans>
\ No newline at end of file
+</beans>

Modified: cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ClientPersistenceTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledBareTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledBareTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledBareTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledBareTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/DecoupledClientServerTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/SequenceTest.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/Server.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/Server.java Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/ServerPersistenceTest.java Fri Jun 11 18:28:57 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";
@@ -84,10 +86,6 @@ public class ServerPersistenceTest exten
                 System.clearProperty("derby.system.home");
             }
         }
-        
-        // run server in process to avoid a problem with UUID generation
-        // during asynchronous invocations
-
         boolean inProcess = "Windows 2000".equals(System.getProperty("os.name"));
         assertTrue("server did not launch correctly", launchServer(Server.class, inProcess));  
     }
@@ -100,6 +98,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.");
@@ -113,6 +113,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.");
  
@@ -121,7 +122,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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled.xml Fri Jun 11 18:28:57 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/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled_bare.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled_bare.xml?rev=953806&r1=953805&r2=953806&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled_bare.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/rm/decoupled_bare.xml Fri Jun 11 18:28:57 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"/>



Mime
View raw message