You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cxf.apache.org by ay...@apache.org on 2013/02/12 13:55:34 UTC

svn commit: r1445150 - /cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/

Author: ay
Date: Tue Feb 12 12:55:34 2013
New Revision: 1445150

URL: http://svn.apache.org/r1445150
Log:
make ServiceInvocation ws-rm systests to use fresh db

Modified:
    cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckBase.java
    cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckPersistenceTest.java
    cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckTest.java
    cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java
    cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-persistent-server.xml

Modified: cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckBase.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckBase.java?rev=1445150&r1=1445149&r2=1445150&view=diff
==============================================================================
--- cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckBase.java (original)
+++ cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckBase.java Tue Feb 12 12:55:34 2013
@@ -51,9 +51,11 @@ public abstract class ServiceInvocationA
 
     public static class Server extends AbstractBusTestServerBase {
         String port;
+        String pfx;
         Endpoint ep;
         public Server(String args[]) {
             port = args[0];
+            pfx = args[1];
         }
         protected void run() {
             SpringBusFactory factory = new SpringBusFactory();
@@ -62,11 +64,14 @@ public abstract class ServiceInvocationA
             setBus(bus);
 
             ControlImpl implementor = new ControlImpl();
+            implementor.setDbName(pfx + "-server");
             implementor.setAddress("http://localhost:" + port + "/SoapContext/GreeterPort");
             GreeterImpl greeterImplementor = new GreeterImpl();
             implementor.setImplementor(greeterImplementor);
             ep = Endpoint.publish("http://localhost:" + port + "/SoapContext/ControlPort", implementor);
             LOG.fine("Published control endpoint.");
+            BusFactory.setDefaultBus(null);
+            BusFactory.setThreadDefaultBus(null);            
         }
         public void tearDown() {
             ep.stop();
@@ -80,10 +85,14 @@ public abstract class ServiceInvocationA
     private Greeter greeter;
     
     public abstract String getPort();
+    
+    public String getPrefix() {
+        return "rmdb";
+    }
 
-    public static void startServer(String port) throws Exception {
+    public static void startServer(String port, String pfx) throws Exception {
         assertTrue("server did not launch correctly", 
-                   launchServer(Server.class, null, new String[] {port}, true));
+                   launchServer(Server.class, null, new String[] {port, pfx}, true));
     }
     
     
@@ -202,8 +211,10 @@ public abstract class ServiceInvocationA
         
         assertTrue("Failed to start greeter", control.startGreeter(cfgResource));
         
+        System.setProperty("db.name", getPrefix());
         greeterBus = bf.createBus(cfgResource);
         BusFactory.setDefaultBus(greeterBus);
+        System.clearProperty("db.name");
         LOG.fine("Initialised greeter bus with configuration: " + cfgResource);
         
         GreeterService gs = new GreeterService();

Modified: cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckPersistenceTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckPersistenceTest.java?rev=1445150&r1=1445149&r2=1445150&view=diff
==============================================================================
--- cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckPersistenceTest.java (original)
+++ cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckPersistenceTest.java Tue Feb 12 12:55:34 2013
@@ -33,14 +33,19 @@ public class ServiceInvocationAckPersist
     @BeforeClass
     public static void startServers() throws Exception {
         RMTxStore.deleteDatabaseFiles("synack", true);
-        startServer(PORT);
+        RMTxStore.deleteDatabaseFiles("synack-server", true);
+        startServer(PORT, "synack");
     }
     public String getPort() {
         return PORT;
     }
+    public String getPrefix() {
+        return "synack";
+    }
     @AfterClass
     public static void cleanUpDerby() throws Exception {
         RMTxStore.deleteDatabaseFiles("synack", true);
+        RMTxStore.deleteDatabaseFiles("synack-server", true);
     }
 
     protected void setupGreeter() throws Exception {

Modified: cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckTest.java?rev=1445150&r1=1445149&r2=1445150&view=diff
==============================================================================
--- cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckTest.java (original)
+++ cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAckTest.java Tue Feb 12 12:55:34 2013
@@ -29,7 +29,7 @@ public class ServiceInvocationAckTest ex
     
     @BeforeClass
     public static void startServers() throws Exception {
-        startServer(PORT);
+        startServer(PORT, "");
     }
     public String getPort() {
         return PORT;

Modified: cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java?rev=1445150&r1=1445149&r2=1445150&view=diff
==============================================================================
--- cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java (original)
+++ cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/ServiceInvocationAtMostOnceAckTest.java Tue Feb 12 12:55:34 2013
@@ -29,7 +29,7 @@ public class ServiceInvocationAtMostOnce
     
     @BeforeClass
     public static void startServers() throws Exception {
-        startServer(PORT);
+        startServer(PORT, "");
     }
     public String getPort() {
         return PORT;

Modified: cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-persistent-server.xml
URL: http://svn.apache.org/viewvc/cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-persistent-server.xml?rev=1445150&r1=1445149&r2=1445150&view=diff
==============================================================================
--- cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-persistent-server.xml (original)
+++ cxf/trunk/systests/ws-rm/src/test/java/org/apache/cxf/systest/ws/rm/sync-ack-persistent-server.xml Tue Feb 12 12:55:34 2013
@@ -30,7 +30,9 @@
        http://schemas.xmlsoap.org/ws/2005/02/rm/policy http://schemas.xmlsoap.org/ws/2005/02/rm/wsrm-policy.xsd
        http://cxf.apache.org/ws/rm/manager http://cxf.apache.org/schemas/configuration/wsrm-manager.xsd
        http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd">
- 
+
+    <bean class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"/>
+
     <cxf:bus>
         <cxf:features>
             <cxf:logging/>
@@ -50,6 +52,6 @@
         </cxf:features>
     </cxf:bus>
 
-    <wsrm-mgr:jdbcStore id="testStore" url="jdbc:derby:synack;create=true"/>
+    <wsrm-mgr:jdbcStore id="testStore" url="jdbc:derby:${db.name};create=true"/>
 
 </beans>