[jboss-cvs] JBoss Messaging SVN: r2075 - in trunk/tests: src/org/jboss/test/messaging/jms and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Jan 26 19:30:14 EST 2007


Author: timfox
Date: 2007-01-26 19:30:14 -0500 (Fri, 26 Jan 2007)
New Revision: 2075

Modified:
   trunk/tests/build.xml
   trunk/tests/src/org/jboss/test/messaging/jms/XARecoveryTest.java
   trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
Log:
More stuff to get tests running



Modified: trunk/tests/build.xml
===================================================================
--- trunk/tests/build.xml	2007-01-26 23:55:10 UTC (rev 2074)
+++ trunk/tests/build.xml	2007-01-27 00:30:14 UTC (rev 2075)
@@ -97,6 +97,7 @@
    <property name="build.tests.stylesheets" value="${tests.output}/stylesheets"/>
    <property name="build.tests.archive" value="jboss-messaging-tests.jar"/>
    <property name="build.tests.ejbarchive" value="jboss-messaging-tests-ejb.jar"/>
+   <property name="objectstore.dir" value="${tests.root}/bin/ObjectStore"/>
 
    <!--
         JUnit configuration (values specified in ./build.properties have priority)
@@ -289,6 +290,7 @@
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
          <sysproperty key="test.remoting" value="${test.remoting}"/>
          <sysproperty key="java.net.preferIPv4Stack" value="true"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <!--
          <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/>
          -->
@@ -308,6 +310,7 @@
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
          <sysproperty key="test.clustered" value="true"/>
          <sysproperty key="java.net.preferIPv4Stack" value="true"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <!--
          <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/>
          -->
@@ -326,8 +329,10 @@
          <sysproperty key="test.database" value="${stress.tests.database}"/>
          <sysproperty key="test.serialization" value="${stress.tests.serialization}"/>
          <sysproperty key="test.remoting" value="${test.remoting}"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <!-- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=rmiserver"/> -->
          <classpath refid="stress.test.execution.classpath"/>
+
       </java>
    </target>
 
@@ -403,6 +408,7 @@
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
          <sysproperty key="test.logfile.suffix" value="invm"/>
          <sysproperty key="build.lib" value="${build.lib}"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <!--
          <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
@@ -455,6 +461,7 @@
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
          <sysproperty key="test.logfile.suffix" value="invm"/>
          <sysproperty key="build.lib" value="${build.lib}"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <!--
          <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
@@ -536,6 +543,7 @@
          <sysproperty key="test.database" value="${stress.tests.database}"/>
          <sysproperty key="test.serialization" value="${stress.tests.serialization}"/>
          <sysproperty key="test.logfile.suffix" value="invm"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <!--
          <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
@@ -583,6 +591,7 @@
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
          <sysproperty key="test.remoting" value="${test.remoting}"/>
          <sysproperty key="test.logfile.suffix" value="remote-client"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <!--
          <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=antjunit"/>
@@ -663,6 +672,7 @@
          <sysproperty key="test.serialization" value="${stress.tests.serialization}"/>
          <sysproperty key="test.remoting" value="${test.remoting}"/>
          <sysproperty key="test.logfile.suffix" value="remote-client"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <!-- <jvmarg line="-Xdebug -Xnoagent -Djava.compiler=NONE -Xrunjdwp:transport=dt_shmem,server=y,suspend=y,address=unittest"/> -->
          <classpath>
@@ -799,6 +809,7 @@
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
          <sysproperty key="test.clustered" value="true"/>
          <sysproperty key="test.logfile.suffix" value="clustering-client"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <jvmarg value="-Djava.net.preferIPv4Stack=true"/>
          <!--
@@ -883,6 +894,7 @@
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
          <sysproperty key="test.clustered" value="true"/>
          <sysproperty key="test.logfile.suffix" value="clustering-client"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <jvmarg value="-Djava.net.preferIPv4Stack=true"/>
          <jvmarg value="-agentlib:jbossAgent"/>
@@ -1163,6 +1175,7 @@
          <sysproperty key="test.bind.address" value="${test.bind.address}"/>
          <sysproperty key="test.database" value="${functional.tests.database}"/>
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <classpath refid="test.execution.classpath"/>
          <formatter type="xml" usefile="${junit.formatter.usefile}"/>
@@ -1199,6 +1212,7 @@
          <sysproperty key="test.bind.address" value="${test.bind.address}"/>
          <sysproperty key="test.database" value="${functional.tests.database}"/>
          <sysproperty key="test.serialization" value="${functional.tests.serialization}"/>
+         <sysproperty key="objectstore.dir" value="${objectstore.dir}"/>
          <jvmarg value="-Xmx512M"/>
          <classpath refid="test.execution.classpath"/>
          <formatter type="xml" usefile="${junit.formatter.usefile}"/>

Modified: trunk/tests/src/org/jboss/test/messaging/jms/XARecoveryTest.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/jms/XARecoveryTest.java	2007-01-26 23:55:10 UTC (rev 2074)
+++ trunk/tests/src/org/jboss/test/messaging/jms/XARecoveryTest.java	2007-01-27 00:30:14 UTC (rev 2075)
@@ -83,7 +83,7 @@
    public void setUp() throws Exception
    {
       super.setUp();
-      ServerManagement.start("all");      
+      ServerManagement.start("all,-transaction, jbossjta");     
       
       initialContext = new InitialContext(ServerManagement.getJNDIEnvironment());
       cf = (JBossConnectionFactory)initialContext.lookup("/ConnectionFactory");

Modified: trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java
===================================================================
--- trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java	2007-01-26 23:55:10 UTC (rev 2074)
+++ trunk/tests/src/org/jboss/test/messaging/tools/jmx/ServiceContainer.java	2007-01-27 00:30:14 UTC (rev 2075)
@@ -23,6 +23,7 @@
 
 
 import java.io.ByteArrayInputStream;
+import java.io.File;
 import java.io.InputStream;
 import java.net.URL;
 import java.sql.Connection;
@@ -398,7 +399,7 @@
             deleteAllData();
          }
          if (jbossjta)
-         {
+         {                       
             startRecoveryManager();
          }
 
@@ -1038,8 +1039,43 @@
       log.debug("bound " + USER_TRANSACTION_JNDI_NAME);
    }
    
+   private boolean deleteDirectory(File directory)
+   {
+      if (directory.isDirectory())
+      {
+         String[] files = directory.list();
+         
+         for (int j = 0; j < files.length; j++)
+         {
+            if (!deleteDirectory(new File(directory, files[j])))
+            {
+               return false;
+            } 
+         }
+      }
+      
+      return directory.delete();
+   }
+   
    private void startRecoveryManager()
    {
+      //First delete the object store - might have been left over from a previous run
+      
+      String objectStoreDir = System.getProperty("objectstore.dir");
+      
+      if (objectStoreDir == null)
+      {
+         log.warn("Cannot find objectstore.dir parameter");
+      }
+      else
+      {
+         File f = new File(objectStoreDir);
+         
+         deleteDirectory(f);
+      }
+      
+      log.info("Deleting object store: " + objectStoreDir);
+      
       log.info("Starting arjuna recovery manager");
       
       //Need to start the recovery manager manually - if deploying
@@ -1050,7 +1086,7 @@
       
       log.info("Started recovery manager");
    }
-
+   
    private void startCachedConnectionManager(ObjectName on) throws Exception
    {
       CachedConnectionManager ccm = new CachedConnectionManager();




More information about the jboss-cvs-commits mailing list