[jboss-cvs] JBossAS SVN: r91949 - in branches/JBPAPP_5_0/testsuite: src/main/org/jboss/test/crashrecovery/ASCrashRecovery01 and 2 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Tue Aug 4 03:56:00 EDT 2009


Author: istudens at redhat.com
Date: 2009-08-04 03:56:00 -0400 (Tue, 04 Aug 2009)
New Revision: 91949

Removed:
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2-jcc-xa-ds.xml
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_82-xa-ds.xml
Modified:
   branches/JBPAPP_5_0/testsuite/imports/config/tests-crash-recovery.xml
   branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/crashrecovery/ASCrashRecovery01/TestWithJPA.java
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_97-xa-ds.xml
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mssql2005-xa-ds.xml
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mssql2008-xa-ds.xml
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mysql51-xa-ds.xml
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/oracle11-xa-ds.xml
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/scripts/as-tests.xml
Log:
added command line way how to run a single TS crash recovery test, JBPAPP-2355

Modified: branches/JBPAPP_5_0/testsuite/imports/config/tests-crash-recovery.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/imports/config/tests-crash-recovery.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/imports/config/tests-crash-recovery.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -16,14 +16,27 @@
     | Targets
   -->
 
-   <!-- JBQA-2176  -->
-   <target name="tests-ts-crash-recovery" depends="prepare-crashrec-profiles"
+   <!-- 
+    | JBQA-2176 - JBossTS crash recovery tests.
+    |
+    | Usage for all tests:
+    |    ./build.sh tests-ts-crash-recovery
+    |     
+    |  or for a selective database:
+    |    ./build.sh tests-ts-crash-recovery -Dcrash.db=psql_8.3 -Dcrash.target=crash-tests-single-db
+    |     
+    |  or for a selective test scenario:
+    |    ./build.sh tests-ts-crash-recovery -Dcrash.db=psql_8.3 -Dcrash.tstype=jts -Dcrash.tsdemarc=bmt -Dcrash.testcase=none.rev -Dcrash.target=crash-tests-single
+    -->
+   <target name="tests-ts-crash-recovery"
    	     description="Runs JBossTS crash recovery tests">
    	
  	  <available file="${jboss.dist}/server/crashrecovery-jta" property="have.profiles" value="true"/>
       <antcall target="prepare-crashrec-profiles" />
    	
-      <run-as-test target="as-tests" />
+   	  <property name="crash.target" value="crash-tests" />
+   	
+      <run-as-test target="${crash.target}" />
 
    </target>
 
@@ -57,9 +70,13 @@
             <sysproperty key="org.apache.ant.lib" value="${org.apache.ant.lib}" />
             <sysproperty key="build.reports" value="${build.reports}" />
             <sysproperty key="sm.legacy.shutdown" value="true" />
-            <!--sysproperty key="jbossas.startup.timeout" value="240" /-->
-            <sysproperty key="jbossas.shutdown.timeout" value="120" />
+            <sysproperty key="jbossas.startup.timeout" value="480" />
+            <sysproperty key="jbossas.shutdown.timeout" value="240" />
             <sysproperty key="wipeOutTxsInDoubtBeforeTest" value="${wipeOutTxsInDoubtBeforeTest}" />
+            <sysproperty key="crash.db" value="${crash.db}" />
+            <sysproperty key="crash.tstype" value="${crash.tstype}" />
+            <sysproperty key="crash.tsdemarc" value="${crash.tsdemarc}" />
+            <sysproperty key="crash.testcase" value="${crash.testcase}" />
             <env key="JBOSS_HOME" value="${jbosstest.dist}" />
             <!--arg value="-verbose"/-->
          	<arg value="-f"/>

Modified: branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/crashrecovery/ASCrashRecovery01/TestWithJPA.java
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/crashrecovery/ASCrashRecovery01/TestWithJPA.java	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/main/org/jboss/test/crashrecovery/ASCrashRecovery01/TestWithJPA.java	2009-08-04 07:56:00 UTC (rev 91949)
@@ -38,6 +38,7 @@
 import java.util.Map;
 import java.util.Set;
 
+import javax.ejb.EJBTransactionRolledbackException;
 import javax.naming.NamingException;
 import javax.transaction.HeuristicMixedException;
 import javax.transaction.NotSupportedException;
@@ -372,11 +373,18 @@
          }
          else
          {
-            System.err.println("XACrashTest:crashTest: Caught1 " + e);
+            System.err.println("XACrashTest:crashTest: Caught[1] " + e);
 
             e.printStackTrace();
          }
       }
+      catch (EJBTransactionRolledbackException re)
+      {
+         // try to recover, this failure was expected maybe?!
+         print("Failure was expected (maybe): " + re.getMessage());
+
+         recoverUids();
+      }
       catch (RuntimeException re)
       {
          if (re.getCause() instanceof HeuristicMixedException)
@@ -388,14 +396,14 @@
          }
          else
          {
-            System.err.println("XACrashTest:crashTest: Caught " + re);
+            System.err.println("XACrashTest:crashTest: Caught[2] " + re);
             re.printStackTrace();            
          }
       }
       catch (Throwable t)
       {
          t.printStackTrace();
-         System.err.println("XACrashTest:crashTest: Caught " + t);
+         System.err.println("XACrashTest:crashTest: Caught[3] " + t);
       }
       finally {
          if (clientTx)

Deleted: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2-jcc-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2-jcc-xa-ds.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2-jcc-xa-ds.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<datasources>
-    <!--
-        IBM DB2 XA driver
-        db2jcc.jar
-    -->
-    
-    <xa-datasource>
-        <jndi-name>DB2XADS</jndi-name>
-       
-        <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
-        
-        <xa-datasource-property name="DatabaseName">your_database_name</xa-datasource-property>
-        <xa-datasource-property name="User">your_user</xa-datasource-property>
-        <xa-datasource-property name="Password">your_password</xa-datasource-property>
-        
-        <!-- Note, as opposed to the Type2 driver, DB2 Type 4 requires the PortNumber. By default this is 50000-->
-        <xa-datasource-property name="PortNumber">your_port_number</xa-datasource-property>
-        
-        <!-- Must be set if using multiple DB2 XA resources in same transaction -->
-        
-        <isSameRM-override-value>false</isSameRM-override-value>    
-        
-        <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
-        <metadata>
-            <type-mapping>DB2</type-mapping>
-        </metadata>
-    
-    </xa-datasource>
-    
-</datasources>
\ No newline at end of file

Deleted: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_82-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_82-xa-ds.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_82-xa-ds.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -1,31 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--    -->
-<!--  JBoss Server Configuration    -->
-<!-- Thanks to Horia Muntean <horia at bvb.ro>   -->
-<!-- ===================================================================== -->
-
-<!-- $Id: db2-xa-ds.xml 77479 2008-08-26 10:33:09Z alex.loubyansky at jboss.com $ -->
-
-
-<datasources>
-
-   <xa-datasource>
-     <jndi-name>CrashRecoveryDS</jndi-name>
-     <!-- uncomment to enable interleaving <interleaving/> -->
-     <isSameRM-override-value>false</isSameRM-override-value>
-
-     <xa-datasource-class>COM.ibm.db2.jdbc.DB2XADataSource</xa-datasource-class>
-     dev32.qa.atl.jboss.com     
-     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-     <xa-datasource-property name="User">crashrec</xa-datasource-property>
-     <xa-datasource-property name="Password">crashrec</xa-datasource-property>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>DB2</type-mapping>
-      </metadata>
-   </xa-datasource>
-
-</datasources>

Modified: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_97-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_97-xa-ds.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_97-xa-ds.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -10,22 +10,29 @@
 
 
 <datasources>
-
    <xa-datasource>
      <jndi-name>CrashRecoveryDS</jndi-name>
-     <!-- uncomment to enable interleaving <interleaving/> -->
-     <isSameRM-override-value>false</isSameRM-override-value>
-
-     <xa-datasource-class>COM.ibm.db2.jdbc.DB2XADataSource</xa-datasource-class>
-     dev32.qa.atl.jboss.com
-     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
-     <xa-datasource-property name="User">crashrec</xa-datasource-property>
-     <xa-datasource-property name="Password">crashrec</xa-datasource-property>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>DB2</type-mapping>
-      </metadata>
+        <xa-datasource-class>com.ibm.db2.jcc.DB2XADataSource</xa-datasource-class>
+        
+        <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+        <xa-datasource-property name="User">crashrec</xa-datasource-property>
+        <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+        
+        <!-- Note, as opposed to the Type2 driver, DB2 Type 4 requires the PortNumber. By default this is 50000-->
+        <xa-datasource-property name="PortNumber">50000</xa-datasource-property>
+        <xa-datasource-property name="ServerName">vmg06.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+		<xa-datasource-property name="DriverType">4</xa-datasource-property>
+        
+	    <!-- If driverType 4 is used, the following two tags are needed -->     
+    	<!--track-connection-by-tx></track-connection-by-tx-->
+        <!-- Must be set if using multiple DB2 XA resources in same transaction -->
+        <isSameRM-override-value>false</isSameRM-override-value>
+            
+        <!-- uncomment to enable interleaving <interleaving/> -->
+        
+        <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml -->
+        <metadata>
+            <type-mapping>DB2</type-mapping>
+        </metadata>
    </xa-datasource>
-
 </datasources>

Modified: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mssql2005-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mssql2005-xa-ds.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mssql2005-xa-ds.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -27,11 +27,11 @@
     <isSameRM-override-value>false</isSameRM-override-value>
     <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
     <xa-datasource-property name="ServerName">dev30.qa.atl.jboss.com</xa-datasource-property>
+    <xa-datasource-property name="PortNumber">3918</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+    <xa-datasource-property name="User">crashrec</xa-datasource-property>
+    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
     <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
-<!-- not sure if these should be here-->
-    <user-name>crashrec</user-name>
-    <password>crashrec</password>
 
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>

Modified: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mssql2008-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mssql2008-xa-ds.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mssql2008-xa-ds.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -26,12 +26,12 @@
     <!-- uncomment to enable interleaving <interleaving/> -->
     <isSameRM-override-value>false</isSameRM-override-value>
     <xa-datasource-class>com.microsoft.sqlserver.jdbc.SQLServerXADataSource</xa-datasource-class>
-    <xa-datasource-property name="ServerName">dev30.qa.atl.jboss.com</xa-datasource-property>
+    <xa-datasource-property name="ServerName">vmg04.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+    <xa-datasource-property name="PortNumber">1433</xa-datasource-property>
     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+    <xa-datasource-property name="User">crashrec</xa-datasource-property>
+    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
     <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
-<!-- not sure if these should be here-->
-    <user-name>crashrec</user-name>
-    <password>crashrec</password>
 
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
       <metadata>

Modified: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mysql51-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mysql51-xa-ds.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/mysql51-xa-ds.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -1,6 +1,5 @@
 <?xml version="1.0" encoding="UTF-8"?>
 
-<!-- See http://www.jboss.org/community/wiki/Multiple1PC for information about local-tx-datasource -->
 <!-- $Id: mysql-ds.xml 88948 2009-05-15 14:09:08Z jesper.pedersen $ -->
 <!--  Datasource config for MySQL using 3.0.9 available from:
 http://www.mysql.com/downloads/api-jdbc-stable.html

Modified: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/oracle11-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/oracle11-xa-ds.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/oracle11-xa-ds.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -19,7 +19,7 @@
     <track-connection-by-tx>true</track-connection-by-tx> 
     <isSameRM-override-value>false</isSameRM-override-value>
     <xa-datasource-class>oracle.jdbc.xa.client.OracleXADataSource</xa-datasource-class>
-    <xa-datasource-property name="URL">jdbc:oracle:oci8:@dtfdb5:1521:crashrec</xa-datasource-property>
+    <xa-datasource-property name="URL">jdbc:oracle:thin:@dev04.qa.atl2.redhat.com:1521:qaora11</xa-datasource-property>
     <xa-datasource-property name="User">crashrec</xa-datasource-property>
     <xa-datasource-property name="Password">crashrec</xa-datasource-property>
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->

Modified: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/scripts/as-tests.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/scripts/as-tests.xml	2009-08-04 07:45:03 UTC (rev 91948)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/scripts/as-tests.xml	2009-08-04 07:56:00 UTC (rev 91949)
@@ -26,13 +26,6 @@
 
   	<pathelement location="${junit.junit.lib}/junit.jar" />
   	<pathelement location="${org.apache.ant.lib}/ant-junit.jar"/>
-
-  	<!-- FIXME Does DTF need this fileset? If not it can be removed. -->
-    <fileset dir="${product.dir}">
-       <include name="lib/*.jar"/>
-       <include name="lib/ext/*.jar"/>
-       <include name="qa/lib/*.jar"/>
-    </fileset>
   </path>
 
   <property name="node0" value="localhost" />
@@ -49,41 +42,144 @@
   <!--
       Main targets intended for JBossAS Testsuite optional task
     -->
-  <target name="as-tests" depends="want-all-dbs, prepare-drivers">
-  	
-  	<property name="wipeOutTxsInDoubt" value="true" />
-  	
-  	<!-- JTA tests -->
-  	<antcall target="as-tests-tstype"><param name="tstype" value="jta"/></antcall>
-  	
-  	<!-- JTAX (JTS) tests -->
-  	<antcall target="as-tests-tstype"><param name="tstype" value="jts"/></antcall>
-  	
+  <target name="crash-tests" depends="want-all-dbs, want-all-tstypes, want-all-tsdemarc, want-all-testcases, crash-tests-single" />
+  
+  <target name="crash-tests-single-db" depends="set-db, want-all-tstypes, want-all-tsdemarc, want-all-testcases, crash-tests-single" />
+
+  <target name="crash-tests-single-db-tstype" depends="set-db, set-tstype, want-all-tsdemarc, want-all-testcases, crash-tests-single" />
+  
+  <target name="crash-tests-single" depends="init, prepare-drivers, set-db, set-tstype, set-tsdemarc, set-testcase, crash-tests-tstype-jta, crash-tests-tstype-jts" />
+
+
+  <!--
+      Other targets... 
+   -->
+  <target name="init">
+    <property name="wipeOutTxsInDoubt" value="true" />
   </target>
   
+  <target name="set-db">
+    <condition property="want.psql_8.2">
+       <equals arg1="${crash.db}" arg2="psql_8.2"/>
+    </condition>
+    <condition property="want.psql_8.3">
+       <equals arg1="${crash.db}" arg2="psql_8.3"/>
+    </condition>
+    <condition property="want.sybase_15">
+       <equals arg1="${crash.db}" arg2="sybase_15"/>
+    </condition>
+    <condition property="want.oracle_10">
+       <equals arg1="${crash.db}" arg2="oracle_10"/>
+    </condition>
+    <condition property="want.oracle_11">
+       <equals arg1="${crash.db}" arg2="oracle_11"/>
+    </condition>
+    <condition property="want.db2_9.7">
+       <equals arg1="${crash.db}" arg2="db2_9.7"/>
+    </condition>
+    <condition property="want.mysql_5.0">
+       <equals arg1="${crash.db}" arg2="mysql_5.0"/>
+    </condition>
+    <condition property="want.mysql_5.1">
+       <equals arg1="${crash.db}" arg2="mysql_5.1"/>
+    </condition>
+    <condition property="want.mssql_2005">
+       <equals arg1="${crash.db}" arg2="mssql_2005"/>
+    </condition>
+    <condition property="want.mssql_2008">
+       <equals arg1="${crash.db}" arg2="mssql_2008"/>
+    </condition>
+  </target>
+	
   <target name="want-all-dbs">
   	<property name="want.psql_8.2" value="true" />
   	<property name="want.psql_8.3" value="true" />
-  	<!-- DEPRECATED property name="want.sybase_12" value="true" /-->
   	<property name="want.sybase_15" value="true" />
+  	<!--property name="want.oracle_10" value="true" /-->
+  	<property name="want.oracle_11" value="true" />
+  	<property name="want.db2_9.7" value="true" />
   	<property name="want.mysql_5.0" value="true" />
-  	<!--property name="want.oracle_10" value="true" />
-  	<property name="want.oracle_11" value="true" />
+  	<property name="want.mysql_5.1" value="true" />
   	<property name="want.mssql_2005" value="true" />
   	<property name="want.mssql_2008" value="true" />
-  	<property name="want.mysql_5.1" value="true" />
-  	<property name="want.db2_8.2" value="true" />
-  	<property name="want.db2_9.7" value="true" /-->
+  	<!-- DEPRECATED property name="want.sybase_12" value="true" /-->
+  	<!-- DEPRECATED property name="want.db2_8.2" value="true" /-->
   </target>
+
+  <target name="set-tstype">
+    <condition property="want.tstype.jta">
+       <equals arg1="${crash.tstype}" arg2="jta"/>
+    </condition>
+    <condition property="want.tstype.jts">
+       <equals arg1="${crash.tstype}" arg2="jts"/>
+    </condition>
+  </target>
 	
-  <!--
-      other targets
-    -->
-  <target name="as-tests-tstype">
-  	<!--attribute name="tstype"/-->
-  	<antcall target="call-tests-for-all-dbs"><param name="call.target" value="as-tests-for-database"/></antcall>
+  <target name="want-all-tstypes">
+  	<property name="want.tstype.jta" value="true" />
+  	<property name="want.tstype.jts" value="true" />
   </target>
 
+  <target name="set-tsdemarc">
+    <condition property="want.cmt">
+       <equals arg1="${crash.tsdemarc}" arg2="cmt"/>
+    </condition>
+    <condition property="want.bmt">
+       <equals arg1="${crash.tsdemarc}" arg2="bmt"/>
+    </condition>
+  </target>
+	
+  <target name="want-all-tsdemarc">
+  	<property name="want.cmt" value="true" />
+  	<property name="want.bmt" value="true" />
+  </target>
+
+  <target name="set-testcase">
+    <condition property="want.none">
+       <equals arg1="${crash.testcase}" arg2="none"/>
+    </condition>
+    <condition property="want.none.rev">
+       <equals arg1="${crash.testcase}" arg2="none.rev"/>
+    </condition>
+    <condition property="want.prepare_ex">
+       <equals arg1="${crash.testcase}" arg2="prepare_ex"/>
+    </condition>
+    <condition property="want.prepare_ex.rev">
+       <equals arg1="${crash.testcase}" arg2="prepare_ex.rev"/>
+    </condition>
+    <condition property="want.prepare_halt">
+       <equals arg1="${crash.testcase}" arg2="prepare_halt"/>
+    </condition>
+    <condition property="want.prepare_halt.rev">
+       <equals arg1="${crash.testcase}" arg2="prepare_halt.rev"/>
+    </condition>
+    <condition property="want.commit_halt">
+       <equals arg1="${crash.testcase}" arg2="commit_halt"/>
+    </condition>
+    <condition property="want.commit_halt.rev">
+       <equals arg1="${crash.testcase}" arg2="commit_halt.rev"/>
+    </condition>
+  </target>
+	
+  <target name="want-all-testcases">
+    <property name="want.none" value="true" />
+    <property name="want.none.rev" value="true" />
+    <property name="want.prepare_ex" value="true" />
+    <property name="want.prepare_ex.rev" value="true" />
+    <property name="want.prepare_halt" value="true" />
+    <property name="want.prepare_halt.rev" value="true" />
+    <property name="want.commit_halt" value="true" />
+  </target>
+
+	
+  <target name="crash-tests-tstype-jta" if="want.tstype.jta">
+  	<antcall target="call-tests-for-all-dbs"><param name="tstype" value="jta"/><param name="call.target" value="crash-tests-for-database"/></antcall>
+  </target>
+  
+  <target name="crash-tests-tstype-jts" if="want.tstype.jts">
+  	<antcall target="call-tests-for-all-dbs"><param name="tstype" value="jts"/><param name="call.target" value="crash-tests-for-database"/></antcall>
+  </target>
+
   <target name="call-tests-for-all-dbs">
   	<antcall target="call-tests-for-psql_8.2"/>
   	<antcall target="call-tests-for-psql_8.3"/>
@@ -93,9 +189,7 @@
   	<antcall target="call-tests-for-mssql_2008"/>
   	<antcall target="call-tests-for-mysql_5.0"/>
   	<antcall target="call-tests-for-mysql_5.1"/>
-  	<antcall target="call-tests-for-db2_8.2"/>
   	<antcall target="call-tests-for-db2_9.7"/>
-  	<antcall target="call-tests-for-sybase_12"/>
   	<antcall target="call-tests-for-sybase_15"/>
   </target>
 
@@ -103,7 +197,7 @@
     <antcall target="${call.target}">
       <param name="dbdriver" value="postgresql-8.2.jar"/>
       <param name="datasource" value="postgres82-xa-ds.xml" /> 
-   	  <param name="dbname" value="pgsql82" /> 
+   	  <param name="dbname" value="psql82" /> 
     </antcall>
   </target>
 	
@@ -145,7 +239,7 @@
   	<antcall target="${call.target}">
   	  <param name="dbdriver" value="${mssql.driver}"/>
   	  <param name="datasource" value="mssql2005-xa-ds.xml" /> 
-   	  <param name="dbname" value="mysql2005" /> 
+   	  <param name="dbname" value="mssql2005" /> 
     </antcall>
   </target>
 	
@@ -188,7 +282,7 @@
 	  	
   <target name="call-tests-for-db2_9.7" if="want.db2_9.7">
   	<antcall target="${call.target}">
-  	  <param name="dbdriver" value="DB2_v9/db2jcc*.jar"/>
+  	  <param name="dbdriver" value="db2jcc.jar" />
   	  <param name="datasource" value="db2_97-xa-ds.xml" /> 
    	  <param name="dbname" value="db2_9" /> 
     </antcall>
@@ -210,53 +304,76 @@
     </antcall>
   </target>
 
-  <target name="prepare-drivers">
-  	<available file="${driver.home}" property="have.dbdrivers" value="true"/>   	
-  	<antcall target="get.drivers" />
-  </target>
+  <target name="crash-tests-for-database" depends="crash-tests-for-database-cmt, crash-tests-for-database-bmt" />
 
-  <target name="as-tests-for-database">
-    <!--attribute name="dbdriver"/>
-    <attribute name="datasource"/-->
-    <sequential>
-      <antcall target="as-tests-all-testcases"><param name="cmt" value="true" /></antcall>
-      <antcall target="as-tests-all-testcases"><param name="cmt" value="false" /></antcall>
-    </sequential>
+  <target name="crash-tests-for-database-cmt" if="want.cmt">
+    <antcall target="crash-tests-all-testcases"><param name="cmt" value="true" /></antcall>
   </target>
 	
-  <target name="as-tests-all-testcases">
-    <!--attribute name="tstype"/>
-    <attribute name="datasource"/>
-    <attribute name="dbdriver"/>
-    <attribute name="cmt"/-->
-    <sequential>
-        <!--antcall target="execute-crash-recovery-test">
-        	<param name="specs" value="none"/><param name="reverseOrder" value="false"/><param name="rollbackExpected" value="false"/>
+  <target name="crash-tests-for-database-bmt" if="want.bmt">
+    <antcall target="crash-tests-all-testcases"><param name="cmt" value="false" /></antcall>
+  </target>
+	
+	
+  <target name="crash-tests-all-testcases" 
+  		depends="testcase-none,
+  		         testcase-none-rev,
+  				 testcase-prepare_ex, 
+  		         testcase-prepare_ex-rev, 
+  		         testcase-prepare_halt, 
+  		         testcase-prepare_halt-rev, 
+  		         testcase-commit_halt" />
+
+  <target name="testcase-none" if="want.none">
+        <antcall target="execute-crash-recovery-test">
+            <param name="specs" value="none"/><param name="reverseOrder" value="false"/><param name="rollbackExpected" value="false"/>
         </antcall>
+  </target>
+
+  <target name="testcase-none-rev" if="want.none.rev">
         <antcall target="execute-crash-recovery-test">
         	<param name="specs" value="none"/><param name="reverseOrder" value="true"/><param name="rollbackExpected" value="false"/>
-        </antcall-->
+        </antcall>
+  </target>
+
+  <target name="testcase-prepare_ex" if="want.prepare_ex">
         <antcall target="execute-crash-recovery-test">
         	<param name="specs" value="prepare_ex"/><param name="reverseOrder" value="false"/><param name="rollbackExpected" value="true"/>
         </antcall>
+  </target>
+
+  <target name="testcase-prepare_ex-rev" if="want.prepare_ex.rev">
         <antcall target="execute-crash-recovery-test">
         	<param name="specs" value="prepare_ex"/><param name="reverseOrder" value="true"/><param name="rollbackExpected" value="true"/>
         </antcall>
+  </target>
+
+  <target name="testcase-prepare_halt" if="want.prepare_halt">
         <antcall target="execute-crash-recovery-test">
         	<param name="specs" value="prepare_halt"/><param name="reverseOrder" value="false"/><param name="rollbackExpected" value="true"/>
         </antcall>
+  </target>
+
+  <target name="testcase-prepare_halt-rev" if="want.prepare_halt.rev">
         <antcall target="execute-crash-recovery-test">
         	<param name="specs" value="prepare_halt"/><param name="reverseOrder" value="true"/><param name="rollbackExpected" value="true"/>
         </antcall>
+  </target>
+
+  <target name="testcase-commit_halt" if="want.commit_halt">
         <antcall target="execute-crash-recovery-test">
-        	<param name="specs" value="commit_halt"/><param name="reverseOrder" value="false"/><param name="rollbackExpected" value="false"/>
-        </antcall>
-        <antcall target="execute-crash-recovery-test">
         	<param name="specs" value="commit_halt"/><param name="reverseOrder" value="true"/><param name="rollbackExpected" value="false"/>
         </antcall>  	
-    </sequential>
   </target>
 
+  <target name="testcase-commit_halt-rev" if="want.commit_halt.rev">
+        <!-- DISABLED test-case: the test is invalid for the current version --> 
+        <antcall target="execute-crash-recovery-test">
+        	<param name="specs" value="commit_halt"/><param name="reverseOrder" value="false"/><param name="rollbackExpected" value="false"/>
+        </antcall>
+  </target>
+
+
   <!--
     Note: If you want to wipe out txs in doubt before and after test you have to set property 'wipeOutTxsInDoubt' to true.
     -->
@@ -279,6 +396,7 @@
       </condition>
       <property name="testname" value="${tstype}-${specs}-${test.name.cmt}${test.name.reverseOrder}"/>
     	
+      <antcall target="hack-before-astest-run" />
       <astest:server method="start" serverName="crashrecovery-${tstype}" >
         <deploy from="dbdrivers/${dbdriver}" to="lib/${dbdriver}" />
         <deploy from="resources/${datasource}" to="deploy/${datasource}" />
@@ -312,9 +430,54 @@
         <fileset dir="${jboss.home}/server/crashrecovery-${tstype}/data/tx-object-store" />
       </copy>
       <delete dir="${jboss.home}/server/crashrecovery-${tstype}/data/tx-object-store"/>
+      <!-- delete work and tmp dirs otherwise tests failed due to permgen space -->
+      <delete dir="${jboss.home}/server/crashrecovery-${tstype}/work"/>
+      <delete dir="${jboss.home}/server/crashrecovery-${tstype}/tmp"/>
+      
+      <antcall target="hack-after-astest-run" />
     </sequential>
   </target>
 
+  <target name="hack-before-astest-run">
+  	<antcall target="hack-before-astest-run-for-oracle_10"/>
+  	<antcall target="hack-before-astest-run-for-oracle_11"/>
+  	<antcall target="hack-before-astest-run-for-db2_9.7"/>
+  </target>
+  
+  <target name="hack-after-astest-run">
+  	<antcall target="hack-after-astest-run-for-oracle_10"/>
+  	<antcall target="hack-after-astest-run-for-oracle_11"/>
+  	<antcall target="hack-after-astest-run-for-db2_9.7"/>
+  </target>
+  
+  <target name="hack-before-astest-run-for-db2_9.7" if="want.db2_9.7">
+  	<!-- deploy license .jar file  -->
+  	<copy file="${product.dir}/dbdrivers/db2jcc_license_cu.jar" todir="${jboss.home}/server/crashrecovery-${tstype}/lib" />
+  </target>
+  
+  <target name="hack-after-astest-run-for-db2_9.7" if="want.db2_9.7">
+  	<!-- undeploy license .jar file  -->
+  	<delete file="${jboss.home}/server/crashrecovery-${tstype}/lib/db2jcc_license_cu.jar" />
+  </target>
+  
+  <target name="hack-before-astest-run-for-oracle_10" if="want.oracle_10">
+  	<!-- TODO setting pad to true -->
+  </target>
+  
+  <target name="hack-after-astest-run-for-oracle_10" if="want.oracle_10">
+  	<!-- TODO  -->
+  </target>
+  
+  <target name="hack-before-astest-run-for-oracle_11" if="want.oracle_11">
+  	<!-- TODO setting pad to true -->
+  </target>
+  
+  <target name="hack-after-astest-run-for-oracle_11" if="want.oracle_11">
+  	<!-- TODO  -->
+  </target>
+  
+  
+  
   <!-- 
     Do use this target if you want to wipe out txs in doubt in all databases. 
     -->
@@ -322,10 +485,10 @@
 
   <!-- 
     Do use this target if you want to wipe out txs in doubt.
-    You can select the databases by setting properties 'want.psql', 'want.oracle' and so on.
+    You can select the databases by setting crash.db property, see target set-db.
     See target call-tests-for-all-dbs and targets call-tests-for-* .
    -->
-  <target name="wipeout-txs-indoubt">
+  <target name="wipeout-txs-indoubt" depends="set-db">
   	<antcall target="call-tests-for-all-dbs"><param name="call.target" value="execute-wipeout-txs-indoubt"/></antcall>
   </target>
   
@@ -352,6 +515,11 @@
 	
 	<property name="driver.url" value="http://reports.qa.atl.jboss.com/jdbc-drivers/"/>
 	
+    <target name="prepare-drivers">
+       <available file="${driver.home}" property="have.dbdrivers" value="true"/>   	
+       <antcall target="get.drivers" />
+    </target>
+
     <target name="get.drivers" unless="have.dbdrivers">
 
     	<mkdir dir="${driver.home}" />
@@ -380,18 +548,11 @@
         <get src="${driver.url}/maven2/mysql/mysql-connector-java/5.0.8/mysql-connector-java-5.0.8.jar"
              dest="${driver.home}/mysql-connector-java-5.0.8.jar"/>
 
-        <mkdir dir="${driver.home}/DB2_v9"/>
         <get src="${driver.url}/maven2/com/ibm/db2jcc/3.1.57/db2jcc-3.1.57.jar"
-             dest="${driver.home}/DB2_v9/db2jcc.jar"/>
+             dest="${driver.home}/db2jcc.jar"/>
         <get src="${driver.url}/maven2/com/ibm/db2jcc_license_cu/3.1.57/db2jcc_license_cu-3.1.57.jar"
-             dest="${driver.home}/DB2_v9/db2jcc_license_cu.jar"/>
+             dest="${driver.home}/db2jcc_license_cu.jar"/>
 
-        <mkdir dir="${driver.home}/DB2_v8.2_fp14"/>
-        <get src="${driver.url}/DB2_v8.2_fp14/db2jcc.jar"
-             dest="${driver.home}/DB2_v8.2_fp14/db2jcc.jar"/>
-        <get src="${driver.url}/DB2_v8.2_fp14/db2jcc_license_cu.jar"
-             dest="${driver.home}/DB2_v8.2_fp14/db2jcc_license_cu.jar"/>
-
     	<!-- FIXME this one is build 26023, but we need build 26564 by EAP5 DB matrix -->
         <get src="${driver.url}/maven2/com/sybase/jconnect/6.0.5/jconnect-6.0.5.jar"
              dest="${driver.home}/jconn3.jar"/>




More information about the jboss-cvs-commits mailing list