[jboss-cvs] JBoss Messaging SVN: r2972 - trunk/tests/src/org/jboss/test/messaging/tools/container.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 7 15:29:41 EDT 2007


Author: timfox
Date: 2007-08-07 15:29:40 -0400 (Tue, 07 Aug 2007)
New Revision: 2972

Modified:
   trunk/tests/src/org/jboss/test/messaging/tools/container/ServiceContainer.java
Log:
Make sure each node has own objectstore


Modified: trunk/tests/src/org/jboss/test/messaging/tools/container/ServiceContainer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/container/ServiceContainer.java	2007-08-07 17:20:45 UTC (rev 2971)
+++ trunk/tests/src/org/jboss/test/messaging/tools/container/ServiceContainer.java	2007-08-07 19:29:40 UTC (rev 2972)
@@ -85,6 +85,7 @@
 import org.jboss.tm.TransactionManagerService;
 import org.jboss.tm.TxManager;
 import org.jboss.tm.usertx.client.ServerVMClientUserTransaction;
+import org.jboss.util.id.GUID;
 import org.w3c.dom.Element;
 import org.w3c.dom.NodeList;
 
@@ -417,11 +418,6 @@
 
          registerClassLoader();
 
-         if (jbossjta)
-         {
-            deleteObjectStore();
-         }
-
          if (transaction || jbossjta)
          {
             startTransactionManager();
@@ -1080,8 +1076,10 @@
       {
          if (jbossjta)
          {
+            setObjectStore();         
+         	
             log.info("Starting arjuna tx mgr");
-            tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
+            tm = com.arjuna.ats.jta.TransactionManager.transactionManager();                       
          }
          else
          {
@@ -1124,28 +1122,18 @@
       return directory.delete();
    }
 
-   private void deleteObjectStore()
+   private void setObjectStore()
    {
       // First delete the object store - might have been left over from a previous run
 
-      String objectStoreDir = System.getProperty("objectstore.dir");
+      //We must ensure each node has its own object store
+      String newObjectStore = "TestObjectStore-" + new GUID().toString();
+      
+      log.info("Setting objectstore.dir to " + newObjectStore);
 
-      log.info("Deleting object store: " + objectStoreDir);
-
-      if (objectStoreDir == null)
-      {
-         log.warn("Cannot find objectstore.dir parameter");
-      }
-      else
-      {
-         File f = new File(objectStoreDir);
-
-         deleteDirectory(f);
-      }
+      System.setProperty("com.arjuna.ats.arjuna.objectstore.objectStoreDir", newObjectStore);
    }
 
-
-
    private void startCachedConnectionManager(ObjectName on) throws Exception
    {
       CachedConnectionManager ccm = new CachedConnectionManager();
@@ -1700,7 +1688,7 @@
 
          if ("all".equals(tok))
          {
-            transaction = true;
+            jbossjta = true;
             database = true;
             jca = true;
             remoting = true;
@@ -1709,7 +1697,7 @@
          else
          if ("all-failover".equals(tok))
          {
-            transaction = true;
+            jbossjta = true;
             database = true;
             jca = true;
             remoting = true;
@@ -1719,7 +1707,7 @@
          else
          if ("all+http".equals(tok))
          {
-            transaction = true;
+            jbossjta = true;
             database = true;
             jca = true;
             remoting = true;
@@ -1790,7 +1778,7 @@
          }
          else if ("none".equals(tok))
          {
-            transaction = false;
+            jbossjta = false;
             database = false;
             jca = false;
             remoting = false;




More information about the jboss-cvs-commits mailing list