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/11/16 16:58:58 UTC

svn commit: r1410417 - in /cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy: AddressingOptionalPolicyTest.java AddressingPolicyTest.java HTTPClientPolicyTest.java NestedAddressingPolicyTest.java RMPolicyTest.java

Author: dkulp
Date: Fri Nov 16 15:58:57 2012
New Revision: 1410417

URL: http://svn.apache.org/viewvc?rev=1410417&view=rev
Log:
Merged revisions 1410408 via  git cherry-pick from
https://svn.apache.org/repos/asf/cxf/trunk

........
  r1410408 | dkulp | 2012-11-16 10:45:37 -0500 (Fri, 16 Nov 2012) | 2 lines

  More teardown fixes

........

Modified:
    cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java
    cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java
    cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
    cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/NestedAddressingPolicyTest.java
    cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java

Modified: cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java?rev=1410417&r1=1410416&r2=1410417&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java (original)
+++ cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingOptionalPolicyTest.java Fri Nov 16 15:58:57 2012
@@ -60,6 +60,7 @@ public class AddressingOptionalPolicyTes
 
     public static class Server extends AbstractBusTestServerBase {
         String tmpDir = TEMPDIR;
+        Endpoint ep;
         public Server() {
         }
         public Server(String dir) {
@@ -71,6 +72,7 @@ public class AddressingOptionalPolicyTes
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr-optional.xml");
             BusFactory.setDefaultBus(bus);
+            setBus(bus);
             LoggingInInterceptor in = new LoggingInInterceptor();
             bus.getInInterceptors().add(in);
             bus.getInFaultInterceptors().add(in);
@@ -80,9 +82,13 @@ public class AddressingOptionalPolicyTes
             
             GreeterImpl implementor = new GreeterImpl();
             String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
-            Endpoint.publish(address, implementor);
+            ep = Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");            
         }
+        public void tearDown() {
+            ep.stop();
+            ep = null;
+        }
         
 
         public static void main(String[] args) {

Modified: cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java?rev=1410417&r1=1410416&r2=1410417&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java (original)
+++ cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/AddressingPolicyTest.java Fri Nov 16 15:58:57 2012
@@ -55,6 +55,7 @@ public class AddressingPolicyTest extend
 
     public static class Server extends AbstractBusTestServerBase {
         String tmpDir = TEMPDIR;
+        Endpoint ep;
         public Server() {
         }
         public Server(String dir) {
@@ -69,6 +70,7 @@ public class AddressingPolicyTest extend
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/addr.xml");
             BusFactory.setDefaultBus(bus);
+            setBus(bus);
             LoggingInInterceptor in = new LoggingInInterceptor();
             bus.getInInterceptors().add(in);
             bus.getInFaultInterceptors().add(in);
@@ -78,9 +80,13 @@ public class AddressingPolicyTest extend
             
             GreeterImpl implementor = new GreeterImpl();
             String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
-            Endpoint.publish(address, implementor);
+            ep = Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");            
         }
+        public void tearDown() {
+            ep.stop();
+            ep = null;
+        }
         
 
         public static void main(String[] args) {

Modified: cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java?rev=1410417&r1=1410416&r2=1410417&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java (original)
+++ cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/HTTPClientPolicyTest.java Fri Nov 16 15:58:57 2012
@@ -68,11 +68,11 @@ public class HTTPClientPolicyTest extend
         new QName("http://cxf.apache.org/greeter_control", "BasicGreeterService");
     
     public static class Server extends AbstractBusTestServerBase {
-   
+        Endpoint ep;
         protected void run()  {            
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus();
-            
+            setBus(bus);
             BusFactory.setDefaultBus(bus);
             LoggingInInterceptor in = new LoggingInInterceptor();
             LoggingOutInterceptor out = new LoggingOutInterceptor();           
@@ -83,10 +83,13 @@ public class HTTPClientPolicyTest extend
             HttpGreeterImpl implementor = new HttpGreeterImpl();
             implementor.setThrowAlways(true);
             String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
-            Endpoint.publish(address, implementor);
+            ep = Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");            
         }
-        
+        public void tearDown() {
+            ep.stop();
+            ep = null;
+        }
 
         public static void main(String[] args) {
             try { 

Modified: cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/NestedAddressingPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/NestedAddressingPolicyTest.java?rev=1410417&r1=1410416&r2=1410417&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/NestedAddressingPolicyTest.java (original)
+++ cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/NestedAddressingPolicyTest.java Fri Nov 16 15:58:57 2012
@@ -24,6 +24,7 @@ import java.util.logging.Logger;
 import javax.xml.ws.Endpoint;
 
 import org.apache.cxf.Bus;
+import org.apache.cxf.BusFactory;
 import org.apache.cxf.bus.spring.SpringBusFactory;
 import org.apache.cxf.common.logging.LogUtils;
 import org.apache.cxf.greeter_control.BasicGreeterService;
@@ -46,7 +47,7 @@ public class NestedAddressingPolicyTest 
         protected void run()  {            
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/http-addr-server.xml");
-            
+            setBus(bus);
             GreeterImpl implementor = new GreeterImpl();
             implementor.setThrowAlways(true);
             Endpoint.publish("http://localhost:" + PORT + "/SoapContext/GreeterPort", implementor);
@@ -86,7 +87,8 @@ public class NestedAddressingPolicyTest 
         // use a plain client
         
         SpringBusFactory bf = new SpringBusFactory();
-        Bus bus = bf.createBus();
+        bus = bf.createBus();
+        BusFactory.setDefaultBus(bus);
         
         BasicGreeterService gs = new BasicGreeterService();
         final Greeter greeter = gs.getGreeterPort();
@@ -107,6 +109,5 @@ public class NestedAddressingPolicyTest 
                        e.getMessage().contains("Addressing Property is not present"));
         }
         ((Closeable)greeter).close();
-
     }
 }
\ No newline at end of file

Modified: cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java
URL: http://svn.apache.org/viewvc/cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java?rev=1410417&r1=1410416&r2=1410417&view=diff
==============================================================================
--- cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java (original)
+++ cxf/branches/2.6.x-fixes/systests/ws-specs/src/test/java/org/apache/cxf/systest/ws/policy/RMPolicyTest.java Fri Nov 16 15:58:57 2012
@@ -72,6 +72,7 @@ public class RMPolicyTest extends Abstra
 
     public static class Server extends AbstractBusTestServerBase {
         String tmpDir = TEMPDIR;
+        Endpoint ep;
         public Server() {
         }
         public Server(String dir) {
@@ -82,6 +83,7 @@ public class RMPolicyTest extends Abstra
             SpringBusFactory bf = new SpringBusFactory();
             Bus bus = bf.createBus("org/apache/cxf/systest/ws/policy/rm.xml");
             BusFactory.setDefaultBus(bus);
+            setBus(bus);
             LoggingInInterceptor in = new LoggingInInterceptor();
             bus.getInInterceptors().add(in);
             LoggingOutInterceptor out = new LoggingOutInterceptor();
@@ -90,10 +92,13 @@ public class RMPolicyTest extends Abstra
             
             GreeterImpl implementor = new GreeterImpl();
             String address = "http://localhost:" + PORT + "/SoapContext/GreeterPort";
-            Endpoint.publish(address, implementor);
+            ep = Endpoint.publish(address, implementor);
             LOG.info("Published greeter endpoint.");
         }
-        
+        public void tearDown() {
+            ep.stop();
+            ep = null;
+        }
 
         public static void main(String[] args) {
             try {