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/11 20:41:19 UTC
svn commit: r953820 - in /cxf/branches/2.2.x-fixes: ./
systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/
systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/
systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf...
Author: dkulp
Date: Fri Jun 11 18:41:18 2010
New Revision: 953820
URL: http://svn.apache.org/viewvc?rev=953820&view=rev
Log:
Merged revisions 952666 via svnmerge from
https://svn.apache.org/repos/asf/cxf/trunk
........
r952666 | dkulp | 2010-06-08 10:51:03 -0400 (Tue, 08 Jun 2010) | 2 lines
Update rest of uncat system tests except for the Failover test. Need
to figure out a solution for that one.
........
Modified:
cxf/branches/2.2.x-fixes/ (props changed)
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/CallbackClientServerTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/ServerImpl.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/Server.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/BookServer.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/HttpBindingServer.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerHttpBindingTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java
cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/Server.java
Propchange: cxf/branches/2.2.x-fixes/
------------------------------------------------------------------------------
Binary property 'svnmerge-integrated' - no diff available.
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractColocTest.java Fri Jun 11 18:41:18 2010
@@ -22,6 +22,7 @@ package org.apache.cxf.systest.coloc;
import java.net.URL;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Endpoint;
import javax.xml.ws.Service;
@@ -30,12 +31,15 @@ import org.apache.cxf.Bus;
import org.apache.cxf.BusFactory;
import org.apache.cxf.bus.spring.SpringBusFactory;
import org.apache.cxf.common.classloader.ClassLoaderUtils;
+import org.apache.cxf.testutil.common.TestUtil;
import org.junit.After;
import org.junit.Assert;
import org.junit.Before;
public abstract class AbstractColocTest extends Assert {
+ public static final String PORT = TestUtil.getPortNumber(AbstractColocTest.class);
+
/**
* Cxf Bus
*/
@@ -103,7 +107,10 @@ public abstract class AbstractColocTest
Service srv = Service.create(
AbstractColocTest.class.getResource(wsdlLocation),
serviceName);
- return srv.getPort(portName, cls);
+ T t = srv.getPort(portName, cls);
+ ((BindingProvider)t).getRequestContext()
+ .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, getTransportURI());
+ return t;
}
/**
* @return the greeter impl object
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/AbstractWrappedDocLitTest.java Fri Jun 11 18:41:18 2010
@@ -53,11 +53,10 @@ public abstract class AbstractWrappedDoc
@Before
public void setUp() throws Exception {
super.setUp();
- port = getPort(
- getServiceQname(),
- getPortQName(),
- getWsdlLocation(),
- Greeter.class);
+ port = getPort(getServiceQname(),
+ getPortQName(),
+ getWsdlLocation(),
+ Greeter.class);
}
@Test
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderDocLitTest.java Fri Jun 11 18:41:18 2010
@@ -26,7 +26,7 @@ import org.junit.Test;
public class ColocHeaderDocLitTest extends AbstractHeaderServiceDocLitTest {
- static final String TRANSPORT_URI = "http://localhost:9111/headers";
+ static final String TRANSPORT_URI = "http://localhost:" + PORT + "/headers";
private Log logger = LogFactory.getLog(ColocHeaderDocLitTest.class);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocHeaderRpcLitTest.java Fri Jun 11 18:41:18 2010
@@ -25,7 +25,7 @@ import org.junit.Test;
public class ColocHeaderRpcLitTest extends AbstractHeaderServiceRpcLitTest {
- static final String TRANSPORT_URI = "http://localhost:9222/headers";
+ static final String TRANSPORT_URI = "http://localhost:" + PORT + "/headers";
private Log logger = LogFactory.getLog(ColocHeaderRpcLitTest.class);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/coloc/ColocWrappedDocLitTest.java Fri Jun 11 18:41:18 2010
@@ -26,7 +26,7 @@ import org.junit.Test;
public class ColocWrappedDocLitTest extends AbstractWrappedDocLitTest {
- static final String TRANSPORT_URI = "http://localhost:9000/SoapContext/SoapPort";
+ static final String TRANSPORT_URI = "http://localhost:" + PORT + "/SoapContext/SoapPort";
private Log logger = LogFactory.getLog(ColocWrappedDocLitTest.class);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/corba/Server.java Fri Jun 11 18:41:18 2010
@@ -26,11 +26,12 @@ import org.apache.cxf.testutil.common.Ab
public class Server extends AbstractBusTestServerBase {
+ public static final String PERSIST_PORT = allocatePort(Server.class);
protected void run() {
System.out.println("Starting Server");
System.setProperty("com.sun.CORBA.POA.ORBServerId", "1");
- System.setProperty("com.sun.CORBA.POA.ORBPersistentServerPort", "40000");
+ System.setProperty("com.sun.CORBA.POA.ORBPersistentServerPort", PERSIST_PORT);
new SpringBusFactory().createBus("org/apache/cxf/systest/corba/hello_world_server.xml");
Object implementor = new BaseGreeterImpl();
String address = "file:./HelloWorld.ref";
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Cxf993Test.java Fri Jun 11 18:41:18 2010
@@ -19,6 +19,7 @@
package org.apache.cxf.systest.cxf993;
+import java.net.MalformedURLException;
import java.net.URL;
import javax.xml.namespace.QName;
@@ -30,7 +31,7 @@ import testnotification.NotificationServ
import testnotification.SendNotification;
public class Cxf993Test extends AbstractBusClientServerTestBase {
-
+ public static final String PORT = Server.PORT;
private final QName serviceName = new QName("urn://testnotification", "NotificationService");
@BeforeClass
@@ -43,13 +44,16 @@ public class Cxf993Test extends Abstract
assertEquals("dummy", getPort().sendNotification(new SendNotification()));
}
- private NotificationServicePort getPort() {
+ private NotificationServicePort getPort()
+ throws NumberFormatException, MalformedURLException {
URL wsdl = getClass().getResource("/wsdl_systest/cxf-993.wsdl");
assertNotNull("WSDL is null", wsdl);
NotificationService service = new NotificationService(wsdl, serviceName);
assertNotNull("Service is null ", service);
- return service.getNotificationServicePort();
+ NotificationServicePort port = service.getNotificationServicePort();
+ updateAddressPort(port, PORT);
+ return port;
}
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/cxf993/Server.java Fri Jun 11 18:41:18 2010
@@ -24,10 +24,11 @@ import javax.xml.ws.Endpoint;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
+ public static final String PORT = allocatePort(Server.class);
protected void run() {
Object implementor = new Cxf993Impl();
- String address = "http://localhost:9018/notification";
+ String address = "http://localhost:" + PORT + "/notification";
Endpoint.publish(address, implementor);
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/IntFaultClientServerTest.java Fri Jun 11 18:41:18 2010
@@ -31,7 +31,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class IntFaultClientServerTest extends AbstractBusClientServerTestBase {
-
+ public static final String PORT = Server.PORT;
private final QName serviceName = new QName("http://apache.org/intfault",
"SOAPService");
@BeforeClass
@@ -48,6 +48,7 @@ public class IntFaultClientServerTest ex
assertNotNull("Service is null", service);
Greeter greeter = service.getSoapPort();
+ updateAddressPort(greeter, PORT);
try {
greeter.testDocLitFault("fault");
} catch (BadRecordLitFault e) {
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/fault/Server.java Fri Jun 11 18:41:18 2010
@@ -24,10 +24,12 @@ import javax.xml.ws.Endpoint;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
+ public static final String PORT = allocatePort(Server.class);
+
protected void run() {
GreeterImpl implementor = new GreeterImpl();
- String address = "http://localhost:9000/SoapContext/SoapPort";
+ String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
Endpoint.publish(address, implementor);
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/interceptor/InterceptorFaultTest.java Fri Jun 11 18:41:18 2010
@@ -19,6 +19,7 @@
package org.apache.cxf.systest.interceptor;
+import java.net.MalformedURLException;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Iterator;
@@ -62,6 +63,8 @@ import org.junit.Test;
*
*/
public class InterceptorFaultTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = allocatePort(Server.class);
+
private static final Logger LOG = LogUtils.getLogger(InterceptorFaultTest.class);
private static final QName SOAP_FAULT_CODE = new QName("http://schemas.xmlsoap.org/soap/envelope/",
@@ -69,9 +72,9 @@ public class InterceptorFaultTest extend
private static final String FAULT_MESSAGE = "Could not send Message.";
private static final String CONTROL_PORT_ADDRESS =
- "http://localhost:9001/SoapContext/ControlPort";
+ "http://localhost:" + PORT + "/SoapContext/ControlPort";
- private static int decoupledEndpointPort = 10000;
+ private static int decoupledEndpointPort = 1;
private static String decoupledEndpoint;
@@ -93,6 +96,7 @@ public class InterceptorFaultTest extend
setBus(bus);
ControlImpl implementor = new ControlImpl();
+ implementor.setAddress("http://localhost:" + PORT + "/SoapContext/GreeterPort");
GreeterImpl greeterImplementor = new GreeterImpl();
greeterImplementor.setThrowAlways(true);
implementor.setImplementor(greeterImplementor);
@@ -286,7 +290,8 @@ public class InterceptorFaultTest extend
- private void setupGreeter(String cfgResource, boolean useDecoupledEndpoint) {
+ private void setupGreeter(String cfgResource, boolean useDecoupledEndpoint)
+ throws NumberFormatException, MalformedURLException {
SpringBusFactory bf = new SpringBusFactory();
@@ -295,6 +300,7 @@ public class InterceptorFaultTest extend
ControlService cs = new ControlService();
control = cs.getControlPort();
+ updateAddressPort(control, PORT);
assertTrue("Failed to start greeter", control.startGreeter(cfgResource));
@@ -317,6 +323,7 @@ public class InterceptorFaultTest extend
GreeterService gs = new GreeterService();
greeter = gs.getGreeterPort();
+ updateAddressPort(greeter, PORT);
LOG.fine("Created greeter client.");
if (!useDecoupledEndpoint) {
@@ -325,9 +332,10 @@ public class InterceptorFaultTest extend
// programatically configure decoupled endpoint that is guaranteed to
// be unique across all test cases
-
- decoupledEndpointPort--;
- decoupledEndpoint = "http://localhost:" + decoupledEndpointPort + "/decoupled_endpoint";
+ decoupledEndpointPort++;
+ decoupledEndpoint = "http://localhost:"
+ + allocatePort("decoupled-" + decoupledEndpointPort)
+ + "/decoupled_endpoint";
Client c = ClientProxy.getClient(greeter);
HTTPConduit hc = (HTTPConduit)(c.getConduit());
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/jca/OutBoundConnectionTest.java Fri Jun 11 18:41:18 2010
@@ -40,6 +40,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class OutBoundConnectionTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = Server.PORT;
private final QName serviceName = new QName("http://apache.org/hello_world_soap_http",
"SOAPService");
@@ -47,10 +48,10 @@ public class OutBoundConnectionTest exte
"SoapPort");
public static class Server extends AbstractBusTestServerBase {
-
+ public static final String PORT = allocatePort(Server.class);
protected void run() {
Object implementor = new GreeterImpl();
- String address = "http://localhost:9000/SoapContext/SoapPort";
+ String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
Endpoint.publish(address, implementor);
}
@@ -85,6 +86,7 @@ public class OutBoundConnectionTest exte
wsdl,
service.getServiceName(),
portName);
+ cri.setAddress("http://localhost:" + PORT + "/SoapContext/SoapPort");
ManagedConnectionFactory managedFactory = new ManagedConnectionFactoryImpl();
Subject subject = new Subject();
ManagedConnection mc = managedFactory.createManagedConnection(subject, cri);
@@ -106,7 +108,7 @@ public class OutBoundConnectionTest exte
public void testGetConnectionFromSEI() throws Exception {
CXFConnectionRequestInfo requestInfo = new CXFConnectionRequestInfo();
requestInfo.setInterface(Greeter.class);
- requestInfo.setAddress("http://localhost:9000/SoapContext/SoapPort");
+ requestInfo.setAddress("http://localhost:" + PORT + "/SoapContext/SoapPort");
ManagedConnectionFactory factory = new ManagedConnectionFactoryImpl();
ManagedConnection mc = factory.createManagedConnection(null, requestInfo);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/JSClientServerTest.java Fri Jun 11 18:41:18 2010
@@ -34,7 +34,10 @@ import org.junit.Test;
public class JSClientServerTest extends AbstractBusClientServerTestBase {
-
+
+ public static final String JS_PORT = Server.JS_PORT;
+ public static final String JSX_PORT = Server.JSX_PORT;
+
private static final String NS = "http://apache.org/hello_world_soap_http";
@BeforeClass
@@ -57,6 +60,7 @@ public class JSClientServerTest extends
String response2 = new String("TestSayHiResponse");
try {
Greeter greeter = service.getPort(portName, Greeter.class);
+ updateAddressPort(greeter, JS_PORT);
String greeting = greeter.greetMe("TestGreetMeRequest");
assertNotNull("no response received from service", greeting);
assertEquals(response1, greeting);
@@ -85,6 +89,7 @@ public class JSClientServerTest extends
String response2 = new String("TestSayHiResponse");
try {
Greeter greeter = service.getPort(portName, Greeter.class);
+ updateAddressPort(greeter, JSX_PORT);
String greeting = greeter.greetMe("TestGreetMeRequest");
assertNotNull("no response received from service", greeting);
assertEquals(response1, greeting);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/js/Server.java Fri Jun 11 18:41:18 2010
@@ -26,17 +26,19 @@ import org.apache.cxf.js.rhino.ProviderF
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
-
+ public static final String JS_PORT = allocatePort(Server.class);
+ public static final String JSX_PORT = allocatePort(Server.class, 1);
protected void run() {
try {
ProviderFactory pf = new ProviderFactory();
String f = getClass().getResource("resources/hello_world.js").toURI().getPath();
f = URLDecoder.decode(f, "UTF-8");
- pf.createAndPublish(new File(f), "http://localhost:9000/SoapContext/SoapPort", false);
+ pf.createAndPublish(new File(f), "http://localhost:" + JS_PORT
+ + "/SoapContext/SoapPort", false);
f = getClass().getResource("resources/hello_world.jsx").toURI().getPath();
f = URLDecoder.decode(f, "UTF-8");
- pf.createAndPublish(new File(f), "http://localhost:9100", false);
+ pf.createAndPublish(new File(f), "http://localhost:" + JSX_PORT, false);
} catch (Exception ex) {
ex.printStackTrace();
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/lifecycle/LifeCycleTest.java Fri Jun 11 18:41:18 2010
@@ -34,6 +34,7 @@ import org.apache.cxf.endpoint.ServerLif
import org.apache.cxf.endpoint.ServerLifeCycleManager;
import org.apache.cxf.feature.AbstractFeature;
import org.apache.cxf.greeter_control.ControlImpl;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.ws.addressing.WSAddressingFeature;
import org.junit.After;
@@ -42,12 +43,17 @@ import org.junit.Before;
import org.junit.Test;
public class LifeCycleTest extends Assert {
+ public static final String PORT1 = TestUtil.getPortNumber(LifeCycleTest.class, 1);
+ public static final String PORT2 = TestUtil.getPortNumber(LifeCycleTest.class, 2);
+ public static final String PORT3 = TestUtil.getPortNumber(LifeCycleTest.class, 3);
+ public static final String PORT4 = TestUtil.getPortNumber(LifeCycleTest.class, 4);
+
private static final int RECURSIVE_LIMIT = 3;
private static final String[] ADDRESSES =
- {"http://localhost:9056/SoapContext/SoapPort",
- "http://localhost:9057/SoapContext/SoapPort",
- "http://localhost:9058/SoapContext/SoapPort",
- "http://localhost:9059/SoapContext/SoapPort"};
+ {"http://localhost:" + PORT1 + "/SoapContext/SoapPort",
+ "http://localhost:" + PORT2 + "/SoapContext/SoapPort",
+ "http://localhost:" + PORT3 + "/SoapContext/SoapPort",
+ "http://localhost:" + PORT4 + "/SoapContext/SoapPort"};
private static final String CONFIG =
"org/apache/cxf/systest/lifecycle/cxf.xml";
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/CountersClientServerTest.java Fri Jun 11 18:41:18 2010
@@ -46,7 +46,9 @@ import org.junit.Test;
public class CountersClientServerTest extends AbstractBusClientServerTestBase {
-
+ public static final String PORT = allocatePort(Server.class);
+ public static final String JMX_PORT = allocatePort(Server.class, 1);
+
private final QName portName =
new QName("http://apache.org/hello_world_soap_http",
"SoapPort");
@@ -58,7 +60,7 @@ public class CountersClientServerTest ex
Bus bus = bf.createBus("org/apache/cxf/systest/management/counter-spring.xml", true);
BusFactory.setDefaultBus(bus);
Object implementor = new GreeterImpl();
- Endpoint.publish("http://localhost:9000/SoapContext/SoapPort", implementor);
+ Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort", implementor);
}
public static void main(String[] args) {
@@ -105,6 +107,7 @@ public class CountersClientServerTest ex
assertNotNull(service);
Greeter greeter = service.getPort(portName, Greeter.class);
+ updateAddressPort(greeter, PORT);
String response = new String("Bonjour");
String reply = greeter.sayHi();
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedBusTest.java Fri Jun 11 18:41:18 2010
@@ -31,11 +31,14 @@ import org.apache.cxf.helpers.CastUtils;
import org.apache.cxf.management.InstrumentationManager;
import org.apache.cxf.management.ManagementConstants;
import org.apache.cxf.management.jmx.InstrumentationManagerImpl;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.workqueue.WorkQueueManager;
import org.junit.Assert;
import org.junit.Test;
public class ManagedBusTest extends Assert {
+ public static final String JMX_PORT1 = TestUtil.getPortNumber("Server.1");
+ public static final String JMX_PORT2 = TestUtil.getPortNumber(ManagedBusTest.class, 3);
@Test
public void testManagedSpringBus() throws Exception {
@@ -45,7 +48,8 @@ public class ManagedBusTest extends Asse
assertNotNull(im);
InstrumentationManagerImpl imi = (InstrumentationManagerImpl)im;
- assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi", imi.getJMXServiceURL());
+ assertEquals("service:jmx:rmi:///jndi/rmi://localhost:9913/jmxrmi",
+ imi.getJMXServiceURL());
assertTrue(!imi.isEnabled());
assertNull(imi.getMBeanServer());
@@ -59,14 +63,14 @@ public class ManagedBusTest extends Asse
public void testManagedBusWithTransientId() throws Exception {
SpringBusFactory factory = new SpringBusFactory();
Bus bus = factory.createBus("org/apache/cxf/systest/management/managed-spring.xml", true);
- doManagedBusTest(bus, bus.getId(), "cxf_managed_bus_test", 9916);
+ doManagedBusTest(bus, bus.getId(), "cxf_managed_bus_test", Integer.parseInt(JMX_PORT1));
}
@Test
public void testManagedBusWithPersistentId() throws Exception {
SpringBusFactory factory = new SpringBusFactory();
Bus bus = factory.createBus("org/apache/cxf/systest/management/persistent-id.xml", true);
- doManagedBusTest(bus, "cxf_managed_bus_test", bus.getId(), 9917);
+ doManagedBusTest(bus, "cxf_managed_bus_test", bus.getId(), Integer.parseInt(JMX_PORT2));
}
private void doManagedBusTest(Bus bus, String expect, String reject, int port) throws Exception {
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/ManagedClientServerTest.java Fri Jun 11 18:41:18 2010
@@ -44,7 +44,10 @@ import org.junit.Test;
public class ManagedClientServerTest extends AbstractBusClientServerTestBase {
-
+ public static final String PORT = allocatePort(Server.class);
+ public static final String JMX_PORT = allocatePort(Server.class, 1);
+
+
private final QName portName =
new QName("http://apache.org/hello_world_soap_http",
"SoapPort");
@@ -56,7 +59,8 @@ public class ManagedClientServerTest ext
Bus bus = bf.createBus("org/apache/cxf/systest/management/managed-spring.xml", true);
BusFactory.setDefaultBus(bus);
Object implementor = new GreeterImpl();
- Endpoint.publish(null, implementor);
+ Endpoint.publish("http://localhost:" + PORT + "/SoapContext/SoapPort",
+ implementor);
}
public static void main(String[] args) {
@@ -105,7 +109,7 @@ public class ManagedClientServerTest ext
assertNotNull(service);
Greeter greeter = service.getPort(portName, Greeter.class);
-
+ updateAddressPort(greeter, PORT);
String response = new String("Bonjour");
String reply = greeter.sayHi();
assertNotNull("no response received from service", reply);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/counter-spring.xml Fri Jun 11 18:41:18 2010
@@ -21,11 +21,12 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<bean id="org.apache.cxf.management.InstrumentationManager" class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
<property name="bus" ref="cxf" />
<property name="enabled" value="true" />
- <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9915/jmxrmi" />
+ <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:${testutil.ports.Server.1}/jmxrmi" />
</bean>
<bean id="org.apache.cxf.management.counters.CounterRepository" class="org.apache.cxf.management.counters.CounterRepository">
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/managed-spring.xml Fri Jun 11 18:41:18 2010
@@ -21,12 +21,14 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<bean id="org.apache.cxf.management.InstrumentationManager"
class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
<property name="bus" ref="cxf" />
<property name="enabled" value="true" />
- <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9916/jmxrmi" />
+ <property name="JMXServiceURL"
+ value="service:jmx:rmi:///jndi/rmi://localhost:${testutil.ports.Server.1}/jmxrmi" />
</bean>
<bean id="wq" class="org.apache.cxf.workqueue.AutomaticWorkQueueImpl">
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/management/persistent-id.xml Fri Jun 11 18:41:18 2010
@@ -21,12 +21,13 @@
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="
http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
+ <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
<bean id="org.apache.cxf.management.InstrumentationManager"
class="org.apache.cxf.management.jmx.InstrumentationManagerImpl">
<property name="bus" ref="cxf" />
<property name="enabled" value="true" />
- <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:9917/jmxrmi" />
+ <property name="JMXServiceURL" value="service:jmx:rmi:///jndi/rmi://localhost:${testutil.ports.ManagedBusTest.3}/jmxrmi" />
<property name="persistentBusId" value="cxf:managed,bus=test" />
</bean>
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/ClientMtomXopTest.java Fri Jun 11 18:41:18 2010
@@ -56,7 +56,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class ClientMtomXopTest extends AbstractBusClientServerTestBase {
-
+ public static final String PORT = Server.PORT;
public static final QName MTOM_PORT = new QName("http://cxf.apache.org/mime", "TestMtomPort");
public static final QName MTOM_SERVICE = new QName("http://cxf.apache.org/mime", "TestMtomService");
@@ -182,7 +182,7 @@ public class ClientMtomXopTest extends A
assertNotNull(r);
}
- private static <T> T createPort(QName serviceName, QName portName, Class<T> serviceEndpointInterface,
+ private <T> T createPort(QName serviceName, QName portName, Class<T> serviceEndpointInterface,
boolean enableMTOM, boolean installInterceptors) throws Exception {
Bus bus = BusFactory.getDefaultBus();
ReflectionServiceFactoryBean serviceFactory = new JaxWsServiceFactoryBean();
@@ -209,6 +209,7 @@ public class ClientMtomXopTest extends A
Object obj = Proxy
.newProxyInstance(serviceEndpointInterface.getClassLoader(),
new Class[] {serviceEndpointInterface, BindingProvider.class}, ih);
+ updateAddressPort(obj, PORT);
return serviceEndpointInterface.cast(obj);
}
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomPolicyTest.java Fri Jun 11 18:41:18 2010
@@ -44,6 +44,7 @@ import org.apache.cxf.message.MessageImp
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.test.AbstractCXFTest;
import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.transport.Conduit;
import org.apache.cxf.transport.ConduitInitiator;
import org.apache.cxf.transport.ConduitInitiatorManager;
@@ -55,8 +56,8 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class MtomPolicyTest extends AbstractCXFTest {
-
- String address = "http://localhost:9036/EchoService";
+ public static final String PORT = TestUtil.getPortNumber(MtomPolicyTest.class);
+ String address = "http://localhost:" + PORT + "/EchoService";
@BeforeClass
public static void setKeepAliveProperty() {
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/MtomServerTest.java Fri Jun 11 18:41:18 2010
@@ -41,6 +41,7 @@ import org.apache.cxf.message.MessageImp
import org.apache.cxf.service.model.EndpointInfo;
import org.apache.cxf.test.AbstractCXFTest;
import org.apache.cxf.test.TestUtilities;
+import org.apache.cxf.testutil.common.TestUtil;
import org.apache.cxf.transport.Conduit;
import org.apache.cxf.transport.ConduitInitiator;
import org.apache.cxf.transport.ConduitInitiatorManager;
@@ -53,7 +54,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class MtomServerTest extends AbstractCXFTest {
-
+ public static final String PORT = TestUtil.getPortNumber(MtomServerTest.class);
private static final String HTTP_ID = "http://schemas.xmlsoap.org/wsdl/http/";
@@ -72,7 +73,7 @@ public class MtomServerTest extends Abst
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
sf.setServiceBean(new EchoService());
sf.setBus(getBus());
- String address = "http://localhost:9036/EchoService";
+ String address = "http://localhost:" + PORT + "/EchoService";
sf.setAddress(address);
Map<String, Object> props = new HashMap<String, Object>();
props.put(Message.MTOM_ENABLED, "true");
@@ -134,7 +135,7 @@ public class MtomServerTest extends Abst
JaxWsServerFactoryBean sf = new JaxWsServerFactoryBean();
sf.setServiceBean(new EchoService());
sf.setBus(getBus());
- String address = "http://localhost:9036/EchoService";
+ String address = "http://localhost:" + PORT + "/EchoService";
sf.setAddress(address);
Map<String, Object> props = new HashMap<String, Object>();
props.put(Message.MTOM_ENABLED, "true");
@@ -143,7 +144,7 @@ public class MtomServerTest extends Abst
server.getEndpoint().getService().getDataBinding().setMtomThreshold(0);
servStatic(getClass().getResource("mtom-policy.xml"),
- "http://localhost:9036/policy.xsd");
+ "http://localhost:" + PORT + "/policy.xsd");
EndpointInfo ei = new EndpointInfo(null, HTTP_ID);
ei.setAddress(address);
@@ -169,9 +170,12 @@ public class MtomServerTest extends Abst
if (is == null) {
throw new RuntimeException("Could not find resource " + "request");
}
+ ByteArrayOutputStream bout = new ByteArrayOutputStream();
+ IOUtils.copy(is, bout);
+ String s = bout.toString("UTF-8");
+ s = s.replaceAll(":9036/", ":" + PORT + "/");
- IOUtils.copy(is, os);
-
+ os.write(s.getBytes("UTF-8"));
os.flush();
is.close();
os.close();
@@ -195,7 +199,7 @@ public class MtomServerTest extends Abst
assertTrue("Wrong size: " + out.size()
+ "\n" + out.toString(),
out.size() > 970 && out.size() < 1020);
- unregisterServStatic("http://localhost:9036/policy.xsd");
+ unregisterServStatic("http://localhost:" + PORT + "/policy.xsd");
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom/Server.java Fri Jun 11 18:41:18 2010
@@ -27,10 +27,11 @@ import org.apache.cxf.mtom_xop.TestMtomI
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
+ public static final String PORT = allocatePort(Server.class);
protected void run() {
Object implementor = new TestMtomImpl();
- String address = "http://localhost:9036/mime-test";
+ String address = "http://localhost:" + PORT + "/mime-test";
try {
EndpointImpl jaxep = (EndpointImpl) javax.xml.ws.Endpoint.publish(address, implementor);
Endpoint ep = jaxep.getServer().getEndpoint();
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/MTOMBindingTypeTest.java Fri Jun 11 18:41:18 2010
@@ -40,6 +40,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class MTOMBindingTypeTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = Server.PORT;
private final QName serviceName = new QName("http://apache.org/cxf/systest/mtom_feature",
"HelloService");
@@ -129,6 +130,14 @@ public class MTOMBindingTypeTest extends
HelloService service = new HelloService(wsdl, serviceName);
assertNotNull("Service is null ", service);
- return service.getHelloPort();
+ Hello hello = service.getHelloPort();
+ try {
+ updateAddressPort(hello, PORT);
+ } catch (Exception ex) {
+ //ignore
+ }
+
+ return hello;
+
}
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_bindingtype/Server.java Fri Jun 11 18:41:18 2010
@@ -24,10 +24,11 @@ import javax.xml.ws.Endpoint;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
+ public static final String PORT = allocatePort(Server.class);
protected void run() {
Object implementor = new HelloImpl();
- String address = "http://localhost:9091/jaxws-mtom/hello";
+ String address = "http://localhost:" + PORT + "/jaxws-mtom/hello";
Endpoint.publish(address, implementor);
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/MtomFeatureClientServerTest.java Fri Jun 11 18:41:18 2010
@@ -35,7 +35,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class MtomFeatureClientServerTest extends AbstractBusClientServerTestBase {
-
+ public static final String PORT = Server.PORT;
private final QName serviceName = new QName("http://apache.org/cxf/systest/mtom_feature",
"HelloService");
private Hello port = getPort();
@@ -124,6 +124,12 @@ public class MtomFeatureClientServerTest
HelloService service = new HelloService(wsdl, serviceName);
assertNotNull("Service is null ", service);
//return service.getHelloPort();
- return service.getHelloPort(new MTOMFeature());
+ Hello hello = service.getHelloPort(new MTOMFeature());
+ try {
+ updateAddressPort(hello, PORT);
+ } catch (Exception e) {
+ //ignore
+ }
+ return hello;
}
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/mtom_feature/Server.java Fri Jun 11 18:41:18 2010
@@ -24,10 +24,11 @@ import javax.xml.ws.Endpoint;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
+ public static final String PORT = allocatePort(Server.class);
protected void run() {
Object implementor = new HelloImpl();
- String address = "http://localhost:9091/jaxws-mtom/hello";
+ String address = "http://localhost:" + PORT + "/jaxws-mtom/hello";
Endpoint.publish(address, implementor);
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/CallbackClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/CallbackClientServerTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/CallbackClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/CallbackClientServerTest.java Fri Jun 11 18:41:18 2010
@@ -37,6 +37,9 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class CallbackClientServerTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = Server.PORT;
+ public static final String CB_PORT = allocatePort(CallbackClientServerTest.class);
+
private static final QName SERVICE_NAME
= new QName("http://apache.org/nested_callback", "SOAPService");
private static final QName SERVICE_NAME_CALLBACK
@@ -62,13 +65,14 @@ public class CallbackClientServerTest ex
Object implementor = new CallbackImpl();
- String address = "http://localhost:9005/CallbackContext/NestedCallbackPort";
+ String address = "http://localhost:" + CB_PORT + "/CallbackContext/NestedCallbackPort";
Endpoint.publish(address, implementor);
URL wsdlURL = getClass().getResource("/wsdl/nested_callback.wsdl");
SOAPService ss = new SOAPService(wsdlURL, SERVICE_NAME);
ServerPortType port = ss.getPort(PORT_NAME, ServerPortType.class);
+ updateAddressPort(port, PORT);
EndpointReferenceType ref = null;
try {
@@ -76,6 +80,7 @@ public class CallbackClientServerTest ex
SERVICE_NAME_CALLBACK,
PORT_NAME_CALLBACK.getLocalPart());
EndpointReferenceUtils.setInterfaceName(ref, PORT_TYPE_CALLBACK);
+ EndpointReferenceUtils.setAddress(ref, address);
} catch (Exception e) {
e.printStackTrace();
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/Server.java Fri Jun 11 18:41:18 2010
@@ -25,10 +25,11 @@ import javax.xml.ws.Endpoint;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
-
+ public static final String PORT = allocatePort(Server.class);
+
protected void run() {
Object implementor = new ServerImpl();
- String address = "http://localhost:9007/SoapContext/SoapPort";
+ String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
Endpoint.publish(address, implementor);
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/ServerImpl.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/ServerImpl.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/ServerImpl.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/nested_callback/ServerImpl.java Fri Jun 11 18:41:18 2010
@@ -24,6 +24,7 @@ import java.net.URL;
import javax.annotation.Resource;
import javax.xml.namespace.QName;
+import javax.xml.ws.BindingProvider;
import javax.xml.ws.Service;
import javax.xml.ws.wsaddressing.W3CEndpointReference;
@@ -64,7 +65,7 @@ public class ServerImpl implements Serve
QName interfaceName = EndpointReferenceUtils.getInterfaceName(callback, bus);
String wsdlLocation = EndpointReferenceUtils.getWSDLLocation(callback);
QName serviceName = EndpointReferenceUtils.getServiceName(callback, bus);
-
+ String address = EndpointReferenceUtils.getAddress(callback);
String portString = EndpointReferenceUtils.getPortName(callback);
@@ -87,6 +88,8 @@ public class ServerImpl implements Serve
URL wsdlURL = new URL(wsdlLocation);
Service service = Service.create(wsdlURL, serviceName);
CallbackPortType port = (CallbackPortType)service.getPort(portName, sei);
+ ((BindingProvider)port).getRequestContext()
+ .put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
port.serverSayHi("Sean");
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/OOBHeaderTest.java Fri Jun 11 18:41:18 2010
@@ -57,7 +57,7 @@ import org.junit.Test;
public class OOBHeaderTest extends AbstractBusClientServerTestBase {
-
+ public static final String PORT = Server.PORT;
public static final String CONFIG_FILE = "org/apache/cxf/systest/outofband/header/cxf.xml";
public static final String TEST_HDR_NS = "http://cxf.apache.org/outofband/Header";
@@ -177,7 +177,8 @@ public class OOBHeaderTest extends Abstr
assertNotNull("Service is null", service);
PutLastTradedPricePortType putLastTradedPrice = service.getPort(portName,
- PutLastTradedPricePortType.class);
+ PutLastTradedPricePortType.class);
+ updateAddressPort(putLastTradedPrice, PORT);
TradePriceData priceData = new TradePriceData();
priceData.setTickerPrice(1.0f);
@@ -206,13 +207,13 @@ public class OOBHeaderTest extends Abstr
String address = "";
switch (i) {
case 0:
- address = "http://localhost:9107/SOAPDocLitBareService/SoapPort";
+ address = "http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPort";
break;
case 1:
- address = "http://localhost:9107/SOAPDocLitBareService/SoapPortNoHeader";
+ address = "http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortNoHeader";
break;
default:
- address = "http://localhost:9107/SOAPDocLitBareService/SoapPortHeader";
+ address = "http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortHeader";
}
((BindingProvider)putLastTradedPrice).getRequestContext()
.put(BindingProvider.ENDPOINT_ADDRESS_PROPERTY, address);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/outofband/header/Server.java Fri Jun 11 18:41:18 2010
@@ -33,6 +33,7 @@ import org.apache.cxf.Bus;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
+ public static final String PORT = allocatePort(Server.class);
Bus bus;
@@ -55,7 +56,7 @@ public class Server extends AbstractBusT
"SOAPService"));
props.put(Endpoint.WSDL_PORT, new QName("http://apache.org/hello_world_doc_lit_bare", "SoapPort"));
ep.setProperties(props);
- ep.publish("http://localhost:9107/SOAPDocLitBareService/SoapPort");
+ ep.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPort");
ep = Endpoint.create(implementor);
props = new HashMap<String, Object>(2);
@@ -64,7 +65,7 @@ public class Server extends AbstractBusT
props.put(Endpoint.WSDL_PORT, new QName("http://apache.org/hello_world_doc_lit_bare", "SoapPort"));
props.put("endpoint-processes-headers", "");
ep.setProperties(props);
- ep.publish("http://localhost:9107/SOAPDocLitBareService/SoapPortNoHeader");
+ ep.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortNoHeader");
ep = Endpoint.create(implementor);
props = new HashMap<String, Object>(2);
@@ -73,7 +74,7 @@ public class Server extends AbstractBusT
props.put(Endpoint.WSDL_PORT, new QName("http://apache.org/hello_world_doc_lit_bare", "SoapPort"));
props.put("endpoint-processes-headers", "{http://cxf.apache.org/outofband/Header}outofbandHeader");
ep.setProperties(props);
- ep.publish("http://localhost:9107/SOAPDocLitBareService/SoapPortHeader");
+ ep.publish("http://localhost:" + PORT + "/SOAPDocLitBareService/SoapPortHeader");
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/JarResolverTest.java Fri Jun 11 18:41:18 2010
@@ -26,13 +26,13 @@ import javax.xml.ws.Service;
import org.apache.cxf.endpoint.ServiceContractResolverRegistry;
import org.apache.cxf.endpoint.ServiceContractResolverRegistryImpl;
-import org.apache.cxf.systest.jca.OutBoundConnectionTest.Server;
import org.apache.cxf.testutil.common.AbstractBusClientServerTestBase;
import org.apache.hello_world_soap_http.Greeter;
import org.junit.BeforeClass;
import org.junit.Test;
public class JarResolverTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = Server.PORT;
private final QName serviceName = new QName("http://apache.org/hello_world_soap_http", "SOAPService");
private final QName portName = new QName("http://apache.org/hello_world_soap_http", "SoapPort");
@@ -62,6 +62,7 @@ public class JarResolverTest extends Abs
//service.addPort(portName, SOAPBinding.SOAP11HTTP_BINDING,
// "http://localhost:9000/SoapContext/SoapPort");
Greeter greeter = service.getPort(portName, Greeter.class);
+ updateAddressPort(greeter, PORT);
String resp = greeter.sayHi();
assertNotNull(resp);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/resolver/Server.java Fri Jun 11 18:41:18 2010
@@ -25,9 +25,10 @@ import org.apache.cxf.testutil.common.Ab
import org.apache.hello_world_soap_http.GreeterImpl;
public class Server extends AbstractBusTestServerBase {
+ public static final String PORT = allocatePort(Server.class);
protected void run() {
Object implementor = new GreeterImpl();
- String address = "http://localhost:9000/SoapContext/SoapPort";
+ String address = "http://localhost:" + PORT + "/SoapContext/SoapPort";
Endpoint.publish(address, implementor);
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/BookServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/BookServer.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/BookServer.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/BookServer.java Fri Jun 11 18:41:18 2010
@@ -37,7 +37,7 @@ import org.codehaus.jettison.mapped.Mapp
import org.codehaus.jettison.mapped.MappedXMLOutputFactory;
public class BookServer extends AbstractBusTestServerBase {
-
+ public static final String PORT = allocatePort(BookServer.class);
protected void run() {
//book service in unwrapped style
BookServiceImpl serviceObj = new BookServiceImpl();
@@ -45,7 +45,7 @@ public class BookServer extends Abstract
sf.setServiceClass(BookService.class);
// Use the HTTP Binding which understands the Java Rest Annotations
sf.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
- sf.setAddress("http://localhost:9080/xml/");
+ sf.setAddress("http://localhost:" + PORT + "/xml/");
sf.getServiceFactory().setInvoker(new BeanInvoker(serviceObj));
// Turn the "wrapped" style off. This means that CXF won't generate
@@ -62,7 +62,7 @@ public class BookServer extends Abstract
sfWrapped.setServiceClass(BookServiceWrapped.class);
// Use the HTTP Binding which understands the Java Rest Annotations
sfWrapped.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
- sfWrapped.setAddress("http://localhost:9080/xmlwrapped");
+ sfWrapped.setAddress("http://localhost:" + PORT + "/xmlwrapped");
sfWrapped.getServiceFactory().setInvoker(new BeanInvoker(serviceWrappedObj));
sfWrapped.create();
@@ -71,7 +71,7 @@ public class BookServer extends Abstract
sfJson.setServiceClass(BookService.class);
// Use the HTTP Binding which understands the Java Rest Annotations
sfJson.setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
- sfJson.setAddress("http://localhost:9080/json");
+ sfJson.setAddress("http://localhost:" + PORT + "/json");
sfJson.getServiceFactory().setInvoker(new BeanInvoker(serviceObj));
// Turn the "wrapped" style off. This means that CXF won't generate
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/HttpBindingServer.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/HttpBindingServer.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/HttpBindingServer.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/HttpBindingServer.java Fri Jun 11 18:41:18 2010
@@ -25,10 +25,10 @@ import javax.xml.ws.http.HTTPBinding;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class HttpBindingServer extends AbstractBusTestServerBase {
-
+ public static final String PORT = allocatePort(HttpBindingServer.class);
protected void run() {
Endpoint e = Endpoint.create(HTTPBinding.HTTP_BINDING, new RestSourcePayloadProviderHttpBinding());
- String address = "http://localhost:9024/XMLService/RestProviderPort/Customer";
+ String address = "http://localhost:" + PORT + "/XMLService/RestProviderPort/Customer";
e.publish(address);
}
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerBookTest.java Fri Jun 11 18:41:18 2010
@@ -51,6 +51,7 @@ import org.junit.Test;
public class RestClientServerBookTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = BookServer.PORT;
static final Logger LOG = LogUtils.getLogger(RestClientServerBookTest.class);
@BeforeClass
@@ -68,7 +69,7 @@ public class RestClientServerBookTest ex
// Use the HTTP Binding which understands the Java Rest Annotations
sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
- sf.setAddress("http://localhost:9080/xml/");
+ sf.setAddress("http://localhost:" + PORT + "/xml/");
BookService bs = (BookService)sf.create();
GetBook getBook = new GetBook();
getBook.setId(123);
@@ -87,7 +88,7 @@ public class RestClientServerBookTest ex
// Use the HTTP Binding which understands the Java Rest Annotations
sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
- sf.setAddress("http://localhost:9080/xml/");
+ sf.setAddress("http://localhost:" + PORT + "/xml/");
BookService bs = (BookService)sf.create();
GetAnotherBook getAnotherBook = new GetAnotherBook();
getAnotherBook.setId(123);
@@ -104,7 +105,7 @@ public class RestClientServerBookTest ex
// Use the HTTP Binding which understands the Java Rest Annotations
sf.getClientFactoryBean().setBindingId(HttpBindingFactory.HTTP_BINDING_ID);
- sf.setAddress("http://localhost:9080/xmlwrapped/");
+ sf.setAddress("http://localhost:" + PORT + "/xmlwrapped/");
BookServiceWrapped bs = (BookServiceWrapped)sf.create();
Book book = bs.getBook(123);
assertEquals(book.getId(), (long)123);
@@ -114,7 +115,7 @@ public class RestClientServerBookTest ex
@Test
public void testGetBookWrappedUsingURL() throws Exception {
String endpointAddress =
- "http://localhost:9080/xmlwrapped/books/123";
+ "http://localhost:" + PORT + "/xmlwrapped/books/123";
URL url = new URL(endpointAddress);
InputStream in = url.openStream();
assertNotNull(in);
@@ -138,7 +139,7 @@ public class RestClientServerBookTest ex
@Test
public void testGetBooksJSON() throws Exception {
String endpointAddress =
- "http://localhost:9080/json/books";
+ "http://localhost:" + PORT + "/json/books";
URL url = new URL(endpointAddress);
InputStream in = url.openStream();
assertNotNull(in);
@@ -151,7 +152,7 @@ public class RestClientServerBookTest ex
@Test
public void testGetBookJSON() throws Exception {
String endpointAddress =
- "http://localhost:9080/json/books/123";
+ "http://localhost:" + PORT + "/json/books/123";
URL url = new URL(endpointAddress);
InputStream in = url.openStream();
assertNotNull(in);
@@ -164,7 +165,7 @@ public class RestClientServerBookTest ex
@Test
public void testAddBookJSON() throws Exception {
String endpointAddress =
- "http://localhost:9080/json/books";
+ "http://localhost:" + PORT + "/json/books";
File input = new File(getClass().getResource("resources/add_book_json.txt").toURI());
PostMethod post = new PostMethod(endpointAddress);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerHttpBindingTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerHttpBindingTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerHttpBindingTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerHttpBindingTest.java Fri Jun 11 18:41:18 2010
@@ -44,6 +44,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class RestClientServerHttpBindingTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = HttpBindingServer.PORT;
private final QName serviceName = new QName("http://apache.org/hello_world_xml_http/wrapped",
"XMLService");
@@ -51,7 +52,7 @@ public class RestClientServerHttpBinding
"RestProviderPort");
private final String endpointAddress =
- "http://localhost:9024/XMLService/RestProviderPort/Customer";
+ "http://localhost:" + PORT + "/XMLService/RestProviderPort/Customer";
@BeforeClass
public static void startServers() throws Exception {
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/RestClientServerTest.java Fri Jun 11 18:41:18 2010
@@ -50,6 +50,7 @@ import org.junit.BeforeClass;
import org.junit.Test;
public class RestClientServerTest extends AbstractBusClientServerTestBase {
+ public static final String PORT = Server.PORT;
private final QName serviceName = new QName("http://apache.org/hello_world_xml_http/wrapped",
"XMLService");
@@ -57,7 +58,7 @@ public class RestClientServerTest extend
"RestProviderPort");
private final String endpointAddress =
- "http://localhost:9023/XMLService/RestProviderPort/Customer";
+ "http://localhost:" + PORT + "/XMLService/RestProviderPort/Customer";
@BeforeClass
public static void startServers() throws Exception {
@@ -78,6 +79,7 @@ public class RestClientServerTest extend
assertNotNull(reqMsg);
Dispatch<DOMSource> disp = service.createDispatch(portName, DOMSource.class, Service.Mode.PAYLOAD);
+ updateAddressPort(disp, PORT);
DOMSource result = disp.invoke(reqMsg);
assertNotNull(result);
Modified: cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/Server.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/Server.java?rev=953820&r1=953819&r2=953820&view=diff
==============================================================================
--- cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/Server.java (original)
+++ cxf/branches/2.2.x-fixes/systests/uncategorized/src/test/java/org/apache/cxf/systest/rest/Server.java Fri Jun 11 18:41:18 2010
@@ -24,10 +24,10 @@ import javax.xml.ws.Endpoint;
import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
public class Server extends AbstractBusTestServerBase {
-
+ public static final String PORT = allocatePort(Server.class);
protected void run() {
Object implementor = new RestSourcePayloadProvider();
- String address = "http://localhost:9023/XMLService/RestProviderPort/Customer";
+ String address = "http://localhost:" + PORT + "/XMLService/RestProviderPort/Customer";
Endpoint.publish(address, implementor);
}