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 2012/05/14 23:27:52 UTC

svn commit: r1338435 - in /cxf/trunk/systests/ws-specs: ./ src/test/java/org/apache/cxf/systest/ws/addr_disable/ src/test/java/org/apache/cxf/systest/ws/addr_feature/ src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/ src/test/java/org/apach...

Author: dkulp
Date: Mon May 14 21:27:52 2012
New Revision: 1338435

URL: http://svn.apache.org/viewvc?rev=1338435&view=rev
Log:
forkmode once for ws-specs

Modified:
    cxf/trunk/systests/ws-specs/pom.xml
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/Server.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/Server.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/Server.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java
    cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java

Modified: cxf/trunk/systests/ws-specs/pom.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/pom.xml?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/pom.xml (original)
+++ cxf/trunk/systests/ws-specs/pom.xml Mon May 14 21:27:52 2012
@@ -192,9 +192,6 @@
             <scope>test</scope>
         </dependency>
     </dependencies>
-    <properties>
-        <cxf.surefire.fork.mode>pertest</cxf.surefire.fork.mode>
-    </properties>
     <profiles>
         <profile>
             <id>jaxws22</id>

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/Server.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_disable/Server.java Mon May 14 21:27:52 2012
@@ -26,17 +26,24 @@ import org.apache.cxf.testutil.common.Ab
 public class Server extends AbstractBusTestServerBase {
     static final String PORT = allocatePort(Server.class);
 
+    EndpointImpl ep;
+    
     protected void run() {
         Object implementor = new AddNumberImpl();
         String address = "http://localhost:" + PORT + "/jaxws/add";
-        
-        EndpointImpl ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), 
-                                           implementor, 
-                                           null, 
-                                           getWsdl());
+        setBus(BusFactory.getThreadDefaultBus());
+        ep = new EndpointImpl(getBus(), 
+                              implementor, 
+                              null, 
+                              getWsdl());
         ep.publish(address);
     }
     
+    public void tearDown() {
+        ep.stop();
+        ep = null;
+    }
+    
     private String getWsdl() {
         try {
             java.net.URL wsdl = getClass().getResource("/wsdl_systest_wsspec/add_numbers.wsdl");

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_feature/Server.java Mon May 14 21:27:52 2012
@@ -21,22 +21,28 @@ package org.apache.cxf.systest.ws.addr_f
 
 import javax.xml.ws.Endpoint;
 
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.apache.cxf.ws.addressing.WSAddressingFeature;
 
 public class Server extends AbstractBusTestServerBase {
     static final String PORT = allocatePort(Server.class);
-
-    protected void run()  {    
+    EndpointImpl ep;
+    protected void run()  { 
+        setBus(BusFactory.getDefaultBus());
         Object implementor = new AddNumberImpl();
         String address = "http://localhost:" + PORT + "/jaxws/add";
         //Endpoint.publish(address, implementor);
 
-        EndpointImpl ep = (EndpointImpl) Endpoint.create(implementor);
+        ep = (EndpointImpl) Endpoint.create(implementor);
         ep.getFeatures().add(new WSAddressingFeature());
         ep.publish(address);
     }
+    public void tearDown() {
+        ep.stop();
+        ep = null;
+    }
 
     public static void main(String[] args) {
         try {

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromjava/server/Server.java Mon May 14 21:27:52 2012
@@ -19,6 +19,7 @@
 
 package org.apache.cxf.systest.ws.addr_fromjava.server;
 
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.jaxws.EndpointImpl;
 import org.apache.cxf.testutil.common.AbstractBusTestServerBase;
 import org.apache.cxf.ws.addressing.WSAddressingFeature;
@@ -26,18 +27,26 @@ import org.apache.cxf.ws.addressing.WSAd
 public class Server extends AbstractBusTestServerBase {
     static final String PORT = allocatePort(Server.class);
     
+    EndpointImpl ep1;
+    EndpointImpl ep2;
+    
     protected void run() {
+        setBus(BusFactory.getDefaultBus());
         Object implementor = new AddNumberImpl();
         String address = "http://localhost:" + PORT + "/AddNumberImplPort";
-        EndpointImpl ep = new EndpointImpl(implementor);
-        ep.getFeatures().add(new WSAddressingFeature());
-        ep.publish(address);
-        
-        ep = new EndpointImpl(new AddNumberImplNoAddr());
-        ep.publish(address + "-noaddr");
+        ep1 = new EndpointImpl(implementor);
+        ep1.getFeatures().add(new WSAddressingFeature());
+        ep1.publish(address);
         
+        ep2 = new EndpointImpl(new AddNumberImplNoAddr());
+        ep2.publish(address + "-noaddr");
+    }
+    public void tearDown() {
+        ep1.stop();
+        ep2.stop();
+        ep1 = null;
+        ep2 = null;
     }
-
     public static void main(String[] args) {
         try {
             Server s = new Server();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/Server.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_fromwsdl/Server.java Mon May 14 21:27:52 2012
@@ -20,6 +20,9 @@
 package org.apache.cxf.systest.ws.addr_fromwsdl;
 
 
+import java.util.LinkedList;
+import java.util.List;
+
 import javax.jws.WebService;
 
 import org.apache.cxf.BusFactory;
@@ -30,6 +33,7 @@ import org.apache.cxf.ws.addressing.WSAd
 
 public class Server extends AbstractBusTestServerBase {
     static final String PORT = allocatePort(Server.class);
+    List<EndpointImpl> eps = new LinkedList<EndpointImpl>();
     
     @WebService(serviceName = "AddNumbersService",
                 portName = "AddNumbersPort",
@@ -60,6 +64,7 @@ public class Server extends AbstractBusT
 
         ep.getFeatures().add(new WSAddressingFeature());
         ep.publish(address);
+        eps.add(ep);
 
         implementor = new AddNumberNonAnon();
         address = "http://localhost:" + PORT + "/jaxws/addNonAnon";
@@ -71,6 +76,7 @@ public class Server extends AbstractBusT
 
         ep.getFeatures().add(new WSAddressingFeature());
         ep.publish(address);
+        eps.add(ep);
 
         implementor = new AddNumberOnlyAnon();
         address = "http://localhost:" + PORT + "/jaxws/addAnon";
@@ -82,7 +88,16 @@ public class Server extends AbstractBusT
 
         ep.getFeatures().add(new WSAddressingFeature());
         ep.publish(address);
+        eps.add(ep);
     }
+    
+    public void tearDown() {
+        for (EndpointImpl ep: eps) {
+            ep.stop();
+        }
+        eps = null;
+    }
+    
 
     private String getWsdl() {
         try {

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/Server.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/Server.java Mon May 14 21:27:52 2012
@@ -21,6 +21,8 @@ package org.apache.cxf.systest.ws.addr_w
 
 import java.io.StringReader;
 import java.util.HashMap;
+import java.util.LinkedList;
+import java.util.List;
 import java.util.Map;
 
 import javax.annotation.Resource;
@@ -47,6 +49,7 @@ import org.apache.cxf.testutil.common.Ab
 
 public class Server extends AbstractBusTestServerBase {
     static final String PORT = allocatePort(Server.class);
+    List<Endpoint> eps = new LinkedList<Endpoint>();
 
     protected void run() {
         Object implementor = new AddNumberImpl();
@@ -58,9 +61,16 @@ public class Server extends AbstractBusT
                                            getWsdl());
 
         ep.publish(address);
+        eps.add(ep);
         
-        Endpoint.publish(address + "-provider", new AddNumberProvider());
-        Endpoint.publish(address + "-providernows", new AddNumberProviderNoWsdl());
+        eps.add(Endpoint.publish(address + "-provider", new AddNumberProvider()));
+        eps.add(Endpoint.publish(address + "-providernows", new AddNumberProviderNoWsdl()));
+    }
+    public void tearDown() {
+        for (Endpoint ep: eps) {
+            ep.stop();
+        }
+        eps = null;
     }
     
     private String getWsdl() {

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/WSDLAddrPolicyAttachmentJaxwsMMProviderTest.java Mon May 14 21:27:52 2012
@@ -60,7 +60,7 @@ public class WSDLAddrPolicyAttachmentJax
         protected void run() {
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/addr_wsdl/jaxwsmm/server.xml");
-
+            setBus(bus);
             JaxWsServerFactoryBean serviceFactory = new JaxWsServerFactoryBean();
             serviceFactory.setBus(bus);
             serviceFactory.setServiceClass(MessageProviderWithAddressingPolicy.class);
@@ -114,7 +114,7 @@ public class WSDLAddrPolicyAttachmentJax
     public void testUsingAddressing() throws Exception {
         SpringBusFactory bf = new SpringBusFactory();
 
-        bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml");
+        Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr-inline-policy-old.xml");
 
         BusFactory.setDefaultBus(bus);
 
@@ -129,5 +129,6 @@ public class WSDLAddrPolicyAttachmentJax
         // oneway
         am.deliver("This is a test");
         am.deliver("This is another test");
+        bus.shutdown(true);
     }
 }

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/DecoupledJMSTest.java Mon May 14 21:27:52 2012
@@ -37,6 +37,7 @@ import org.junit.Test;
  * in the non-decoupled case.
  */
 public class DecoupledJMSTest extends MAPTestBase {
+    static final String PORT = allocatePort(DecoupledJMSTest.class);
     private static final String ADDRESS = "jms:jndi:dynamicQueues/testqueue0001?"
         + "jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
         + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:" 
@@ -51,6 +52,9 @@ public class DecoupledJMSTest extends MA
     }
     protected void updateAddressPort(Object o, int port) throws MalformedURLException {
     }
+    public String getPort() {
+        return PORT;
+    }
 
     @Test
     @Override

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTest.java Mon May 14 21:27:52 2012
@@ -29,6 +29,7 @@ import org.junit.BeforeClass;
  * Tests the addition of WS-Addressing Message Addressing Properties.
  */
 public class MAPTest extends MAPTestBase {
+    static final String PORT = allocatePort(MAPTest.class);
     static final String ADDRESS = "http://localhost:" + PORT + "/SoapContext/SoapPort";
 
     private static final String CONFIG;
@@ -45,6 +46,9 @@ public class MAPTest extends MAPTestBase
     public String getAddress() {
         return ADDRESS;
     }
+    public String getPort() {
+        return PORT;
+    }
     
 
     @BeforeClass

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/MAPTestBase.java Mon May 14 21:27:52 2012
@@ -20,6 +20,7 @@
 package org.apache.cxf.systest.ws.addressing;
 
 
+import java.io.Closeable;
 import java.lang.reflect.UndeclaredThrowableException;
 import java.net.URL;
 import java.util.HashMap;
@@ -64,7 +65,6 @@ 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;
@@ -92,8 +92,14 @@ public abstract class MAPTestBase extend
     @AfterClass
     public static void shutdownBus() throws Exception {
         staticBus.shutdown(true);
+        staticBus = null;
+        messageIDs.clear();
+        mapVerifier = null;
+        headerVerifier = null;
     }
     
+    public abstract String getPort();
+    
     private void addInterceptors(List<Interceptor<? extends Message>> chain,
                                  Interceptor<? extends Message>[] interceptors) {
         for (int i = 0; i < interceptors.length; i++) {
@@ -148,7 +154,7 @@ public abstract class MAPTestBase extend
         ServiceImpl serviceImpl = 
             ServiceDelegateAccessor.get(new SOAPService(getWSDLURL(), SERVICE_NAME));
         Greeter g = serviceImpl.getPort(target, Greeter.class);
-        updateAddressPort(g, PORT);
+        updateAddressPort(g, getPort());
         return g;
     }
     
@@ -159,7 +165,12 @@ public abstract class MAPTestBase extend
         removeInterceptors(staticBus.getOutInterceptors(), interceptors);
         removeInterceptors(staticBus.getOutFaultInterceptors(), interceptors);
         removeInterceptors(staticBus.getInFaultInterceptors(), interceptors);
-        
+
+        if (greeter instanceof Closeable) {
+            ((Closeable)greeter).close();
+        }
+        greeter = null;
+
         mapVerifier = null;
         headerVerifier = null;
         verified = null;

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledJMSTest.java Mon May 14 21:27:52 2012
@@ -37,7 +37,8 @@ import org.junit.Test;
  * in the non-decoupled case.
  */
 public class NonDecoupledJMSTest extends MAPTestBase {
-    private static final String ADDRESS = "jms:jndi:dynamicQueues/testqueue0001?"
+    static final String PORT = allocatePort(NonDecoupledJMSTest.class);
+    private static final String ADDRESS = "jms:jndi:dynamicQueues/testqueue0002?"
         + "jndiInitialContextFactory=org.apache.activemq.jndi.ActiveMQInitialContextFactory"
         + "&jndiConnectionFactoryName=ConnectionFactory&jndiURL=tcp://localhost:" 
         + EmbeddedJMSBrokerLauncher.PORT;
@@ -49,7 +50,10 @@ public class NonDecoupledJMSTest extends
     public String getConfigFileName() {
         return CONFIG;
     }
-    
+    public String getPort() {
+        return PORT;
+    }
+
     @Test
     @Override
     public void testImplicitMAPs() throws Exception {

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/NonDecoupledTest.java Mon May 14 21:27:52 2012
@@ -30,6 +30,7 @@ import org.junit.Test;
  * in the non-decoupled case.
  */
 public class NonDecoupledTest extends MAPTestBase {
+    static final String PORT = allocatePort(NonDecoupledTest.class);
     static final String ADDRESS = "http://localhost:" + PORT + "/SoapContext/SoapPort";
 
     private static final String CONFIG =
@@ -39,6 +40,10 @@ public class NonDecoupledTest extends MA
         return CONFIG;
     }
     
+    public String getPort() {
+        return PORT;
+    }
+    
     @BeforeClass
     public static void startServers() throws Exception {
         // special case handling for WS-Addressing system test to avoid

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/addressing/Server.java Mon May 14 21:27:52 2012
@@ -37,6 +37,7 @@ public class Server extends AbstractBusT
 
     private String verified;
     private String address;
+    private Endpoint ep;
     private Class<?> cls;
  
     public Server(String[] args) throws Exception {
@@ -55,11 +56,16 @@ public class Server extends AbstractBusT
         try {
             AbstractGreeterImpl implementor = (AbstractGreeterImpl)cls.newInstance();
             implementor.verificationCache = this;
-            Endpoint.publish(address, implementor);
+            ep = Endpoint.publish(address, implementor);
         } catch (Exception ex) {
             throw new RuntimeException(ex);
         }
     }
+     
+    public void tearDown() {
+        ep.stop();
+        ep = null;
+    }
 
     protected void addVerifiers() {
         MAPVerifier mapVerifier = new MAPVerifier();

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/MEXTest.java Mon May 14 21:27:52 2012
@@ -37,12 +37,14 @@ public class MEXTest extends AbstractWSA
     @BeforeClass
     public static void startServers() throws Exception {
         assertTrue("server did not launch correctly", launchServer(Server.class, true));
+        createStaticBus();
     }
 
     @Test
     public void testGet() {
         // Create the client
         JaxWsProxyFactoryBean proxyFac = new JaxWsProxyFactoryBean();
+        proxyFac.setBus(getStaticBus());
         proxyFac.setAddress("http://localhost:" + PORT + "/jaxws/addmex");
         proxyFac.getFeatures().add(new LoggingFeature());
         MetadataExchange exc = proxyFac.create(MetadataExchange.class);

Modified: cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java?rev=1338435&r1=1338434&r2=1338435&view=diff
==============================================================================
--- cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java (original)
+++ cxf/trunk/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/mex/Server.java Mon May 14 21:27:52 2012
@@ -27,17 +27,23 @@ import org.apache.cxf.testutil.common.Ab
 public class Server extends AbstractBusTestServerBase {
     static final String PORT = allocatePort(Server.class);
 
+    EndpointImpl ep;
     protected void run() {
+        setBus(BusFactory.getDefaultBus());
         Object implementor = new AddNumberImpl();
         String address = "http://localhost:" + PORT + "/jaxws/addmex";
         
-        EndpointImpl ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), 
+        ep = new EndpointImpl(BusFactory.getThreadDefaultBus(), 
                                            implementor, 
                                            null, 
                                            getWsdl());
 
         ep.publish(address);
     }
+    public void tearDown() {
+        ep.stop();
+        ep = null;
+    }
     
     private String getWsdl() {
         try {