[jboss-cvs] JBossAS SVN: r109497 - in trunk/testsuite: src/main/org/jboss/test/jbossts/ASCrashRecovery01 and 6 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Fri Nov 26 12:18:11 EST 2010


Author: istudens at redhat.com
Date: 2010-11-26 12:18:09 -0500 (Fri, 26 Nov 2010)
New Revision: 109497

Added:
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java
   trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml
Removed:
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelperRem.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashLocalHome.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashRemHome.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/RecoveredXid.java
   trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-1-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-2-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle-rac1-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle-rac2-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/sybase12-xa-ds.xml
Modified:
   trunk/testsuite/imports/config/tests-crash-recovery.xml
   trunk/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/TestWithJPA.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/WipeOutTxsInDoubt.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/JTSContextPropagation01/TestContextPropagation.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashBMTBean.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelper.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/crash/TestEntityHelper.java
   trunk/testsuite/src/main/org/jboss/test/jbossts/taskdefs/TransactionLog.java
   trunk/testsuite/src/resources/jbossts/resources/db2_97-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/mssql2005-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/mssql2008-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/mysql50-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/mysql51-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle-rac-lb-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-lb-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle10-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle11-r2-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/oracle11-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/postgres82-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/postgres83-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/resources/sybase15-xa-ds.xml
   trunk/testsuite/src/resources/jbossts/scripts/as-tests.xml
Log:
crash rec tests enhanced to cover new XA resource recovery functionality of JCA, ported from EAP5 branch, JBQA-3205

Modified: trunk/testsuite/imports/config/tests-crash-recovery.xml
===================================================================
--- trunk/testsuite/imports/config/tests-crash-recovery.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/imports/config/tests-crash-recovery.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -17,7 +17,7 @@
   -->
 
    <!-- 
-    | JBQA-2176 - JBossTS crash recovery tests.
+    | JBQA-2176 - JBossTS crash recovery tests with EJB3.
     |
     | Usage for all tests:
     |    ./build.sh tests-ts-crash-recovery
@@ -28,29 +28,63 @@
     |  or for particular test scenario:
     |    ./build.sh tests-ts-crash-recovery -Djbossts.db=psql_8.3 -Djbossts.tstype=jts -Djbossts.tsdemarc=bmt -Djbossts.testcase=none.rev -Djbossts.target=crash-tests-single
     |
-    | Note: If you want to force the wiping out any txs in doubt from DB before the test you can use the property -DwipeOutTxsInDoubtBeforeTest=true. 
+    | Usage for cluster tests:
+    |    ./build.sh tests-ts-crash-recovery -Djbossts.db=oracle_rac -Djbossts.tstype=jts -Djbossts.target=crash-tests-single-db-tstype 
+    |
+    | Added new option for settings of datasource credentials:
+    |    -Djbossts.credentials=cr1 - the default one
+    |         <xa-datasource-property name="User">crashrec</xa-datasource-property>
+    |         <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    |    -Djbossts.credentials=cr2
+    |         <user-name>crash0</user-name>
+    |         <password>crash0</password>
+    |         <recover-user-name>crashrec</recover-user-name>
+    |         <recover-password>crashrec</recover-password>
+    |    -Djbossts.credentials=cr3
+    |         <security-domain>CrashRecoveryDomain0</security-domain>
+    |         <recover-user-name>crashrec</recover-user-name>
+    |         <recover-password>crashrec</recover-password>
+    |    -Djbossts.credentials=cr4
+    |         <security-domain>CrashRecoveryDomain0</security-domain>
+    |         <recover-security-domain>CrashRecoveryDomain</recover-security-domain>
+    |
+    | Note 1: The 'jbossts.credentials' property is useless in connection with -Djbossts.db=[oracle_rac|oracle_rac_r2].
+    | Note 2: If you want to force the wiping out any txs in doubt from DB before the test you can use the property -DwipeOutTxsInDoubtBeforeTest=true.
+    | Note 3: For EWP, use '-Djbossts.jtaonly=true' to prepare only jta profile in the AS server. Otherwise both JTA/JTS profiles are always created/checked.
+    |
+    | Possible values for the jbossts.db parameter are: 
+    |     psql_8.2 psql_8.3 psql_8.4 psql_9.0 sybase_15 sybase_15.5 oracle_10 oracle_11 oracle_11_r2 db2_9.7 
+    |     mysql_5.0 mysql_5.1 mssql_2005 mssql_2008 oracle_rac oracle_rac_lb oracle_rac_r2 oracle_rac_r2_lb
+    | Data-sources related to these DBs can be found in src/resources/jbossts/resources/.
     -->
    <target name="tests-ts-crash-recovery" depends="init-dependencies"
            description="Runs JBossTS crash recovery tests">
 
-      <available file="${jboss.dist}/server/crashrecovery-jta" property="have.crashrecovery.jta.profile" value="true"/>
-      <available file="${jboss.dist}/server/crashrecovery-jts" property="have.crashrecovery.jts.profile" value="true"/>
-      <condition property="have.crash.recovery.profiles">
-        <and>
-          <istrue value="${have.crashrecovery.jta.profile}"/>
-          <istrue value="${have.crashrecovery.jts.profile}"/>
-        </and>
+      <!--  prepare jta profile  -->
+      <available file="${jboss.dist}/server/crashrecovery-jta" property="have.crash.recovery.jta.profile" value="true"/>
+      <antcall target="prepare-crashrec-profile-jta" />
+
+      <!--  prepare jts profile  -->
+      <condition property="have.crash.recovery.jts.profile">
+         <or>
+            <available file="${jboss.dist}/server/crashrecovery-jts"/>
+            <isset property="jbossts.jtaonly"/>
+         </or>
       </condition>
-
-      <antcall target="prepare-crashrec-profiles" />
+      <antcall target="prepare-crashrec-profile-jts" />
    	
       <property name="jbossts.target" value="crash-tests" />
-      <property name="jbossts.max.time" value="300000" />
+      <property name="jbossts.max.time" value="420000" />
+      <property name="jbossts.credentials" value="cr1" />
    	
       <run-as-test target="${jbossts.target}" />
 
    </target>
 
+   <target name="tests-ts-sweep-crashrec-profiles">
+      <delete dir="${jboss.dist}/server/crashrecovery-jta" />
+      <delete dir="${jboss.dist}/server/crashrecovery-jts" />
+   </target>
 
   <!--
     | Macros and others
@@ -89,6 +123,7 @@
             <sysproperty key="jbossts.tstype" value="${jbossts.tstype}" />
             <sysproperty key="jbossts.tsdemarc" value="${jbossts.tsdemarc}" />
             <sysproperty key="jbossts.testcase" value="${jbossts.testcase}" />
+            <sysproperty key="jbossts.credentials" value="${jbossts.credentials}" />
             <sysproperty key="testTime" value="${jbossts.max.time}" />
             <env key="JBOSS_HOME" value="${jbosstest.dist}" />
             <arg value="-f"/>
@@ -101,7 +136,7 @@
    </macrodef>
    
    
-   <target name="prepare-crashrec-profiles" unless="have.crash.recovery.profiles">
+   <target name="prepare-crashrec-profile-jta" unless="have.crash.recovery.jta.profile">
       <delete dir="${jboss.dist}/server/crashrecovery-jta" />
       <create-config baseconf="default" newconf="crashrecovery-jta">
          <patternset>
@@ -112,6 +147,10 @@
          </patternset>
       </create-config>
 
+      <antcall target="setup-recovery"><param name="conf" value="crashrecovery-jta"/></antcall>
+   </target>
+   
+   <target name="prepare-crashrec-profile-jts" unless="have.crash.recovery.jts.profile">
       <delete dir="${jboss.dist}/server/crashrecovery-jts" />
       <create-config baseconf="all" newconf="crashrecovery-jts">
          <patternset>
@@ -127,38 +166,50 @@
          <property name="target.server.dir" location="${jboss.dist}/server/crashrecovery-jts"/>
       </ant>
 
-      <setup-crash-recovery conf="crashrecovery-jta"/>
-      <setup-crash-recovery conf="crashrecovery-jts"/>
+      <antcall target="setup-recovery"><param name="conf" value="crashrecovery-jts"/></antcall>       
    </target>
   
-	
-   <macrodef name="setup-crash-recovery">
-      <attribute name="conf"/>
-      <sequential>
-      
-         <!-- enable crash recovery and point it to our datasource -->
-         <replaceregexp file="${jboss.dist}/server/@{conf}/deploy/transaction-jboss-beans.xml" flags="s"
-            match="(&lt;bean name=&quot;JTAEnvironmentBean&quot;)(.*?)(&lt;/bean&gt;)"
-            replace="\1\2@@@PUT_RECOVERY_PROPERTY_HERE@@@\3" />
-         <replace file="${jboss.dist}/server/@{conf}/deploy/transaction-jboss-beans.xml">
-            <replacetoken><![CDATA[@@@PUT_RECOVERY_PROPERTY_HERE@@@]]></replacetoken>
-            <replacevalue><![CDATA[
-        <property name="xaResourceRecoveryInstances">
-            <list elementClass="java.lang.String">
-                <value>com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=CrashRecoveryDS</value>
-            </list>
-        </property>
-]]></replacevalue>
-         </replace>
-         
+   <target name="setup-recovery">
+      <antcall target="setup-recovery-jbossts-jpa" />
+      <antcall target="setup-security-domains" />
+   </target>
+
+   <target name="setup-recovery-jbossts-jpa">
+      <echo message="Setting up crash recovery for profile ${conf}.."/>
          <!-- more verbose logging 
          FIXME modify it for new transactions, i.e. for deploy/transaction-jboss-beans.xml file
       	 <replace file="${jboss.dist}/server/@{conf}/conf/jbossts-properties.xml">
       	    <replacetoken><![CDATA[type="System" value="0x00000000"]]></replacetoken>
       	    <replacevalue><![CDATA[type="System" value="0xffffffff"]]></replacevalue>
       	 </replace-->
-          
-      </sequential>
-   </macrodef>
+   </target>
+	
+   <target name="setup-security-domains">
+      <echo message="Setting up security domains for profile ${conf}.."/>
+   	  <replace file="${jboss.dist}/server/${conf}/conf/login-config.xml">
+         <replacetoken><![CDATA[</policy>]]></replacetoken>
+         <replacevalue><![CDATA[
+    <application-policy name="CrashRecoveryDomain">
+        <authentication>
+            <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
+                <module-option name="username">crashrec</module-option>
+                <module-option name="password">-170d8ac0642414f0207a6df87216de44</module-option>
+                <module-option name="managedConnectionFactoryName">jboss.jca:service=XATxCM,name=CrashRecoveryDS</module-option>
+            </login-module>
+        </authentication>
+    </application-policy>
 
+    <application-policy name="CrashRecoveryDomain0">
+        <authentication>
+            <login-module code="org.jboss.resource.security.SecureIdentityLoginModule" flag="required">
+                <module-option name="username">crash0</module-option>
+                <module-option name="password">-47043946269bfc76</module-option>
+                <module-option name="managedConnectionFactoryName">jboss.jca:service=XATxCM,name=CrashRecoveryDS</module-option>
+            </login-module>
+        </authentication>
+    </application-policy>
+</policy>]]></replacevalue>
+      </replace>
+   </target>
+
 </project>

Modified: trunk/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/TestWithJPA.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/TestWithJPA.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/TestWithJPA.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -21,13 +21,13 @@
 package org.jboss.test.jbossts.ASCrashRecovery01;
 
 import org.jboss.test.jbossts.recovery.ASFailureSpec;
+import org.jboss.test.jbossts.recovery.RecoveredXid;
 import org.jboss.test.jbossts.taskdefs.JUnitClientTest;
 import org.jboss.test.jbossts.taskdefs.TransactionLog;
 import org.jboss.test.jbossts.taskdefs.Utils;
 import org.jboss.test.jbossts.crash.CrashHelper;
-import org.jboss.test.jbossts.crash.CrashHelperRem;
+import org.jboss.test.jbossts.crash.JPACrashHelperRem;
 import org.jboss.test.jbossts.crash.CrashRem;
-import org.jboss.test.jbossts.crash.RecoveredXid;
 import org.jboss.test.jbossts.crash.TestEntity;
 import org.jboss.test.jbossts.crash.TestEntityHelper;
 import org.jboss.test.jbossts.crash.TestEntityHelperRem;
@@ -47,7 +47,7 @@
 import javax.transaction.UserTransaction;
 
 /**
- * Crash recovery tests with one crash XA resource and one JPA entity resource.
+ * Crash recovery tests with EJB3 entity.
  * 
  * @author <a href="istudens at redhat.com">Ivo Studensky</a>
  * @version $Revision: 1.1 $
@@ -55,7 +55,7 @@
 public class TestWithJPA extends JUnitClientTest
 {
    // the longest time to wait in millis before declaring a test a failed (overridable)
-   private static final int MAX_TEST_TIME = 300000;     // 5 minutes  - allows two intervals of recovery which is 2 minutes by default
+   private static final int MAX_TEST_TIME = 5 * 60 * 1000;     // 5 minutes  - allows two intervals of recovery which is 2 minutes by default
 
    private boolean isCMT = false;
    private boolean clientTx = false;
@@ -73,6 +73,7 @@
    private TransactionLog store;
    private int existingUids;
    private Set<RecoveredXid> existingXidsInDoubt;
+   private String recoveryDatasource = null;
 
    private String serverName = "default";
 
@@ -122,6 +123,8 @@
             wipeOutTxsInDoubtBeforeTest = val.equalsIgnoreCase("true");
          else if ("wipeOutTxsInDoubtAfterTest".equals(key))
             wipeOutTxsInDoubtAfterTest = val.equalsIgnoreCase("true");
+         else if ("recoveryDatasource".equals(key))
+            recoveryDatasource = val;
       }
 
       sb.insert(0, ":\n").insert(0, getName()).insert(0, "Executing test ");
@@ -137,7 +140,7 @@
             storeDir = serverPath + "data/tx-object-store";
          else
             storeDir = serverPath + storeDir;
-
+         System.out.println("transaction log will be stored in " + storeDir + "(file=" + storeImple+")");
          store = new TransactionLog(storeDir, storeImple);
 
          if (expectFailure)
@@ -160,8 +163,8 @@
          if (wipeOutTxsInDoubtBeforeTest)
             wipeOutTxsInDoubt();
 
-         existingXidsInDoubt = lookupCrashHelper().checkXidsInDoubt();
-         if (isDebug)
+         existingXidsInDoubt = lookupCrashHelper().checkXidsInDoubt(recoveryDatasource);
+         if (existingXidsInDoubt.size() > 0)
             print(existingXidsInDoubt.size() + " txs in doubt in database before test run");
 
          // name of this test will be the primary key for test record in DB
@@ -182,7 +185,7 @@
             print("checkDatabase result: " + dbChanged);
          }
          
-         Set<RecoveredXid> xidsInDoubtAfterTest = lookupCrashHelper().checkXidsInDoubt();
+         Set<RecoveredXid> xidsInDoubtAfterTest = lookupCrashHelper().checkXidsInDoubt(recoveryDatasource);
          if (wipeOutTxsInDoubt || wipeOutTxsInDoubtAfterTest)
             wipeOutTxsInDoubt(existingXidsInDoubt, xidsInDoubtAfterTest);
 
@@ -272,7 +275,7 @@
       print("wiping out txs in doubt");
       try
       {
-         lookupCrashHelper().wipeOutTxsInDoubt(xidsToRecover);
+         lookupCrashHelper().wipeOutTxsInDoubt(recoveryDatasource, xidsToRecover);
       }  
       catch (Exception e)
       {
@@ -319,9 +322,9 @@
       return (CrashRem) config.getNamingContext(serverName).lookup(name);
    }
 
-   private CrashHelperRem lookupCrashHelper() throws Exception
+   private JPACrashHelperRem lookupCrashHelper() throws Exception
    {
-      return (CrashHelperRem) config.getNamingContext(serverName).lookup(CrashHelper.REMOTE_JNDI_NAME);
+      return (JPACrashHelperRem) config.getNamingContext(serverName).lookup(CrashHelper.REMOTE_JNDI_NAME);
    }
 
    private UserTransaction startTx() throws NamingException, SystemException, NotSupportedException
@@ -372,7 +375,7 @@
       }
       catch (RuntimeException re)
       {
-         if (re.getCause() instanceof HeuristicMixedException)  //FIXME unreachable condition?
+         if (re.getCause() instanceof HeuristicMixedException)
          {
             // try to recover, this failure was expected maybe?!
             print("Failure was expected (maybe): " + re.getMessage());
@@ -429,20 +432,25 @@
          pendingUids = getPendingUids();
          try 
          {
-            xidsInDoubtAfterTest = lookupCrashHelper().checkXidsInDoubt();
+            xidsInDoubtAfterTest = lookupCrashHelper().checkXidsInDoubt(recoveryDatasource);
          }
          catch (Exception e)
          {
+            e.printStackTrace();
             return false;
          }
          pendingXidsInDoubt = xidsInDoubtAfterTest.size();
 
          if (pendingUids == -1)
+         {
+            print("recoverUids failed, object store error, pendingUids == -1");
             return false;   // object store error
-
+         }
          if (pendingUids <= existingUids && pendingXidsInDoubt <= totalExistingXidsInDoubt)
+         {
+            print("recoverUids success");
             return true;    // all uids in AS and txs in doubt in DB recovered
-
+         }
          pendingUids -= existingUids;
          pendingXidsInDoubt -= totalExistingXidsInDoubt;
 
@@ -454,6 +462,8 @@
          
       } while (maxWait > 0);
 
+      print("recoverUids failed, took too long to recover");
+
       // the test failed to recover some uids - clear them out ready for the next test
       if (pendingUids > 0)
       {

Modified: trunk/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/WipeOutTxsInDoubt.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/WipeOutTxsInDoubt.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/ASCrashRecovery01/WipeOutTxsInDoubt.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -20,9 +20,9 @@
  */
 package org.jboss.test.jbossts.ASCrashRecovery01;
 
+import org.jboss.test.jbossts.recovery.CrashHelperRem;
 import org.jboss.test.jbossts.taskdefs.JUnitClientTest;
 import org.jboss.test.jbossts.crash.CrashHelper;
-import org.jboss.test.jbossts.crash.CrashHelperRem;
 import org.apache.tools.ant.BuildException;
 
 import java.util.Map;

Modified: trunk/testsuite/src/main/org/jboss/test/jbossts/JTSContextPropagation01/TestContextPropagation.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/JTSContextPropagation01/TestContextPropagation.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/JTSContextPropagation01/TestContextPropagation.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -22,6 +22,8 @@
 
 import org.jboss.test.jbossts.recovery.ASFailureMode;
 import org.jboss.test.jbossts.recovery.ASFailureSpec;
+import org.jboss.test.jbossts.recovery.CrashHelperRem;
+import org.jboss.test.jbossts.recovery.RecoveredXid;
 import org.jboss.test.jbossts.taskdefs.JUnitClientTest;
 import org.jboss.test.jbossts.taskdefs.TransactionLog;
 import org.jboss.test.jbossts.taskdefs.Utils;
@@ -30,8 +32,6 @@
 import org.jboss.test.jbossts.txpropagation.ejb2.TxPropagationEJB2Rem;
 import org.jboss.test.jbossts.txpropagation.ejb3.TxPropagationRem;
 import org.jboss.test.jbossts.crash.CrashHelper;
-import org.jboss.test.jbossts.crash.CrashHelperRem;
-import org.jboss.test.jbossts.crash.RecoveredXid;
 import org.jboss.test.jbossts.crash.TestEntity;
 import org.jboss.test.jbossts.crash.TestEntityHelper;
 import org.jboss.test.jbossts.crash.TestEntityHelperRem;

Added: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/AppServerJDBCXARecovery.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,591 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, JBoss Inc., and others contributors as indicated
+ * by the @authors tag. All rights reserved.
+ * See the copyright.txt in the distribution for a
+ * full listing of individual contributors.
+ * This copyrighted material is made available to anyone wishing to use,
+ * modify, copy, or redistribute it subject to the terms and conditions
+ * of the GNU Lesser General Public License, v. 2.1.
+ * This program is distributed in the hope that it will be useful, but WITHOUT A
+ * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
+ * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA  02110-1301, USA.
+ *
+ * (C) 2008,
+ * @author Redhat Middleware LLC.
+ */
+package org.jboss.test.jbossts.crash;
+
+import com.arjuna.ats.jta.recovery.XAResourceRecovery;
+
+
+
+import javax.crypto.NoSuchPaddingException;
+import javax.crypto.BadPaddingException;
+import javax.crypto.IllegalBlockSizeException;
+import javax.crypto.Cipher;
+import javax.crypto.spec.SecretKeySpec;
+import javax.transaction.xa.XAResource;
+import javax.naming.InitialContext;
+import javax.sql.XADataSource;
+import javax.sql.ConnectionEventListener;
+import javax.sql.ConnectionEvent;
+import javax.sql.XAConnection;
+import javax.management.MBeanServerConnection;
+import javax.management.ObjectName;
+import javax.management.MBeanException;
+import javax.management.InstanceNotFoundException;
+import java.sql.SQLException;
+import java.sql.Connection;
+import java.util.Properties;
+import java.util.Iterator;
+import java.util.StringTokenizer;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
+import java.io.InputStream;
+import java.io.ByteArrayInputStream;
+import java.lang.reflect.Method;
+import java.beans.PropertyEditor;
+import java.beans.PropertyEditorManager;
+import java.security.NoSuchAlgorithmException;
+import java.security.InvalidKeyException;
+import java.math.BigInteger;
+
+import org.jboss.security.SecurityAssociation;
+import org.jboss.security.SimplePrincipal;
+import org.jboss.logging.Logger;
+
+/**
+ * Taken from https://svn.jboss.org/repos/labs/labs/jbosstm/trunk/atsintegration/classes/com/arjuna/ats/internal/jbossatx/jta/AppServerJDBCXARecovery.java ,
+ * some changes applied.
+ * Username/password credentials programmatically set to CrashHelper.DS_USER_NAME and CrashHelper.DS_PASSWORD.
+ * 
+ * 
+ * This provides recovery for compliant JDBC drivers accessed via datasources deployed in JBossAS 5
+ * It is not meant to be db driver specific.
+ *
+ * This code is based on JDBCXARecovery, which expects JNDI to contain an XADataSource implementation.
+ * In JBossAS, the object created in JNDI when a -ds.xml file containing <xa-datasource> element is used,
+ * does not implement the XADataSource interface. We therefore use this modified code to pull the
+ * datasource configuration information from the app server's JMX and instantiate an XADataSource from
+ * which it can then create an XAConnection.
+ *
+ * To use this class, add an entry in the JTAEnvironmentBean's xaResourceRecoveryInstances list
+ * for each database for which you need recovery, ensuring the value ends with ;jndiname=<datasource-name>
+ * i.e. the same value as is in the -ds.xml jndi-name element.
+ *
+ * Note for users with secured JMX invokers, use the extended format:
+ *   ;jndiname=MyExampleDbName,username=foo,password=bar
+ * The username and password refer to the JMX invoker, NOT the datasource.
+ *
+ * It's not possible to override the jdbc username and password given in the -ds.xml file at present.
+ * Since the recovery system sometimes needs greater db user privs than the app code, it may be preferable to
+ * set up a -ds.xml file only for recovery usage. This approach works for databases which allow users to
+ * recover one another's transactions, which is most of them. But consult
+ * your db docs or friendly neighbourhood DBA to be sure, then test it anyhow.
+ *
+ * You also need the XARecoveryModule enabled and appropriate values for nodeIdentifier and xaRecoveryNode set.
+ * See the JBossTS recovery guide if you are unclear on how the recovery system works.
+ *
+ * Note: This implementation expects to run inside the app server JVM. It probably won't work
+ * if you configure the recovery manager to run as a separate process. (JMX can be accessed remotely,
+ * but it would need code changes to the lookup function and some classpath additions).
+ *
+ * <bean name="JTAEnvironmentBean" class="com.arjuna.ats.jta.common.JTAEnvironmentBean">
+ *   ...
+ *   <property name="xaResourceRecoveryClassNames">
+ *     <list elementClass="java.lang.String">
+ *       <value>com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=MyExampleDbName[,username=foo,password=bar]</value>
+ *     </list>
+ *   </property>
+ *
+ * deprecated see JBTM-756
+ */
+public class AppServerJDBCXARecovery implements XAResourceRecovery {
+
+// implementation based on com.arjuna.ats.internal.jdbc.recovery.JDBCXARecovery
+
+    public AppServerJDBCXARecovery()
+        throws SQLException
+    {
+        if (log.isDebugEnabled())
+		{
+            log.debug("AppServerJDBCXARecovery<init>");
+        }
+
+        _hasMoreResources        = false;
+        _connectionEventListener = new LocalConnectionEventListener();
+    }
+
+    /**
+     * The recovery module will have chopped off this class name already. The
+     * parameter should specify a jndi name for the datasource.
+     */
+
+    public boolean initialise(String parameter)
+        throws SQLException
+    {
+        if (log.isDebugEnabled())
+		{
+            log.debug("AppServerJDBCXARecovery.initialise(" + parameter + ")");
+        }
+
+        if (parameter == null)
+            return false;
+
+        retrieveData(parameter, _DELIMITER);
+
+        return true;
+    }
+
+    public synchronized XAResource getXAResource()
+        throws SQLException
+    {
+        createConnection();
+
+        if (_connection == null) {
+            throw new SQLException("The data source named [" + _dataSourceId + "] is not deployed.");
+        }
+
+        return _connection.getXAResource();
+    }
+
+    public boolean hasMoreResources()
+    {
+        if(!_force) {
+            return false;
+        }
+
+        if (_dataSource == null)
+            try
+            {
+                createDataSource();
+            }
+            catch (SQLException sqlException)
+            {
+                return false;
+            }
+
+        if (_dataSource != null)
+        {
+            _hasMoreResources = ! _hasMoreResources;
+
+            return _hasMoreResources;
+        }
+        else
+            return false;
+    }
+
+    /**
+     * Lookup the XADataSource in JNDI.
+     */
+    private final void createDataSource()
+        throws SQLException
+    {
+        // Note: the repeated use of SecurityAssociation.set[Principal|Credential] is a workaround for
+        // JBAS-7171 / JBAS-6449 / JBPAPP-2479. Although now fixed in some AS/EAP releases, we keep the
+        // workaround in place for now so we can work on older, non-fixed releases too.
+
+        try
+        {
+            if (_dataSource == null)
+            {
+                // This is where we do JBossAS specific magic. Use the JMX to fetch the name of the XADataSource class
+                // and its config params so that we don't have to duplicate the information in the -ds.xml file.
+
+                // TODO: can we make this flexible enough to handle remote app server processes, so that
+                // we can run the recovery manager out of process? The server addr would need to be on a per
+                // jndiname basis, as we may be doing recovery for a whole cluster. We would need AS
+                // jmx classes (and the db drivers naturally) on the recovery manager classpath.
+
+                InitialContext context = new InitialContext();
+                MBeanServerConnection server = (MBeanServerConnection)context.lookup("jmx/invoker/RMIAdaptor");
+                ObjectName objectName = new ObjectName("jboss.jca:name="+_dataSourceId+",service=ManagedConnectionFactory");
+
+                if(_username !=null && _password !=null)
+                {
+                	SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                	SecurityAssociation.setCredential(_password);
+                }
+
+                String className = (String)server.invoke(objectName, "getManagedConnectionFactoryAttribute", new Object[] {"XADataSourceClass"}, new String[] {"java.lang.String"});
+		        if (log.isDebugEnabled())
+				{
+                	log.debug("AppServerJDBCXARecovery datasource classname = "+className);
+                }
+
+                if(_username !=null && _password !=null)
+                {
+                	SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                	SecurityAssociation.setCredential(_password);
+                }
+
+                String properties = (String)server.invoke(objectName, "getManagedConnectionFactoryAttribute", new Object[] {"XADataSourceProperties"}, new String[] {"java.lang.String"});
+                // debug disabled due to security paranoia - it may log datasource password in cleartext.
+                // log.debug("AppServerJDBCXARecovery.result="+properties);
+
+/*                
+                ObjectName txCmObjectName = new ObjectName("jboss.jca:name=" +_dataSourceId + ",service=XATxCM");
+
+                if(_username !=null && _password !=null)
+                {
+                	SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                	SecurityAssociation.setCredential(_password);
+                }                
+
+                String securityDomainName = (String) server.getAttribute(txCmObjectName, "SecurityDomainJndiName");
+                
+		        if (log.isDebugEnabled())
+				{
+                	log.debug("Security domain name associated with JCA ConnectionManager jboss.jca:name=" +_dataSourceId + ",service=XATxCM"+" is:"+securityDomainName);
+                }
+
+                if(securityDomainName != null && !securityDomainName.equals(""))
+                {
+                	ObjectName _objectName = new ObjectName("jboss.security:service=XMLLoginConfig");
+
+                    if(_username !=null && _password !=null)
+                    {
+                        SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                        SecurityAssociation.setCredential(_password);
+                    }
+
+                	String config = (String)server.invoke(_objectName, "displayAppConfig", new Object[] {securityDomainName}, new String[] {"java.lang.String"});
+                    String loginModuleClass = getValueForLoginModuleClass(config);
+            		_dbUsername = getValueForKey(config, _USERNAME);
+            		String _encryptedPassword = getValueForKey(config, _PASSWORD);
+
+                    if("org.jboss.resource.security.JaasSecurityDomainIdentityLoginModule".equals(loginModuleClass))
+                    {
+                        String jaasSecurityDomain = getValueForKey(config, "jaasSecurityDomain");
+                        if(_username !=null && _password !=null)
+                        {
+                            SecurityAssociation.setPrincipal(new SimplePrincipal(_username));
+                            SecurityAssociation.setCredential(_password);
+                        }
+                        _dbPassword = decodePBE(server, _encryptedPassword, jaasSecurityDomain);
+                    }
+                    else
+                    {
+                        _dbPassword = decode(_encryptedPassword);
+                    }
+
+                    _encrypted = true;
+                }
+*/
+                
+                try {
+                    _dataSource = getXADataSource(className, properties);
+                    _supportsIsValidMethod = true; // assume it does; we'll lazily check the first time we try to connect
+                } catch(Exception e) {
+                    _dataSource = null;
+                    log.error("AppServerJDBCXARecovery.createDataSource got exception during getXADataSource call: "+e.toString(), e);
+                    SQLException sqlException = new SQLException(e.toString());
+                    sqlException.initCause(e);
+                    throw sqlException;
+                }
+            }
+        }
+        catch (MBeanException mbe)
+        {
+            if (mbe.getTargetException() instanceof InstanceNotFoundException)
+            {
+                log.warn("AppServerJDBCXARecovery.createDataSource(name="+_dataSourceId+"): InstanceNotFound. Datasource not deployed, or wrong name?");
+
+                // this is an expected condition when the data source is not yet deployed
+                // just ignore this for now, the next time around, we try again to see if its deployed yet
+                return;
+            } else {
+                log.error("AppServerJDBCXARecovery.createDataSource(name="+_dataSourceId+") got exception " + mbe.toString(), mbe);
+            }
+
+            SQLException sqlException = new SQLException(mbe.toString());
+            sqlException.initCause(mbe);
+            throw sqlException;
+        }
+        catch (SQLException ex)
+        {
+            log.error("AppServerJDBCXARecovery.createDataSource got exception "+ex.toString(), ex);
+            throw ex;
+        }
+        catch (Exception e)
+        {
+            log.error("AppServerJDBCXARecovery.createDataSource got exception "+e.toString(), e);
+
+            SQLException sqlException = new SQLException(e.toString());
+            sqlException.initCause(e);
+            throw sqlException;
+        }
+    }
+
+    /**
+     * Create the XAConnection from the XADataSource.
+     */
+
+    private final void createConnection()
+        throws SQLException
+    {
+        try
+        {
+            if (_dataSource == null)
+            {
+                createDataSource();
+                // if we still don't have it, its because the data source isn't deployed yet
+                if (_dataSource == null) {
+                    return;
+                }
+            }
+
+            Boolean isConnectionValid;
+            try {
+                if (_connection != null && _supportsIsValidMethod) {
+                    Connection connection = _connection.getConnection();
+                    Method method = connection.getClass().getMethod("isValid",  new Class[] {Integer.class});
+                    isConnectionValid = (Boolean) method.invoke(connection, new Object[] {new Integer(5)});
+                } else {
+                    isConnectionValid = Boolean.FALSE;
+                }
+            } catch (NoSuchMethodException nsme) {
+                isConnectionValid = Boolean.FALSE;
+                _supportsIsValidMethod = false;
+		        if (log.isDebugEnabled())
+				{
+	                log.debug("XA datasource does not support isValid method - connection will always be recreated");
+	            }
+            } catch (Throwable t) {
+                isConnectionValid = Boolean.FALSE;
+		        if (log.isDebugEnabled())
+				{
+	                log.debug("XA connection is invalid - will recreate a new one. Cause: " + t);
+	            }
+            }
+
+            if (!isConnectionValid.booleanValue()) {
+                if (_connection != null) {
+                    try {
+                        _connection.close(); // just attempt to clean up anything that we can
+                    } catch (Throwable t) {
+                    } finally {
+                        _connection = null;
+                    }
+                }
+
+                // Check if the password is encrypted, the criteria should be the existence of <security-domain>EncryptDBPassword</security-domain>
+                // in the -ds.xml file.
+                
+                if(!_encrypted) {
+                    _connection = _dataSource.getXAConnection();
+                }
+                else {
+                    _connection = _dataSource.getXAConnection(_dbUsername, _dbPassword);
+                }
+                _connection.addConnectionEventListener(_connectionEventListener);
+		        if (log.isDebugEnabled())
+				{
+	                log.debug("Created new XAConnection");
+	            }
+            }
+        }
+        catch (SQLException ex)
+        {
+            log.error("AppServerJDBCXARecovery.createConnection got exception "+ex.toString(), ex);
+            throw ex;
+        }
+        catch (Exception e)
+        {
+            log.error("AppServerJDBCXARecovery.createConnection got exception "+e.toString(), e);
+
+            SQLException sqlException = new SQLException(e.toString());
+            sqlException.initCause(e);
+            throw sqlException;
+        }
+    }
+
+    private class LocalConnectionEventListener implements ConnectionEventListener
+    {
+        public void connectionErrorOccurred(ConnectionEvent connectionEvent)
+        {
+            _connection.removeConnectionEventListener(_connectionEventListener);
+            _connection = null;
+        }
+
+        public void connectionClosed(ConnectionEvent connectionEvent)
+        {
+            _connection.removeConnectionEventListener(_connectionEventListener);
+            _connection = null;
+        }
+    }
+
+    // borrowed from org.jboss.resource.adapter.jdbc.xa.XAManagedConnectionFactory
+    // in which the equivalent functionality is protected not public :-(
+    private XADataSource getXADataSource(String xaDataSourceClassname, String propertiesString) throws Exception
+    {
+        // Map any \ to \\
+        propertiesString = propertiesString.replaceAll("\\\\", "\\\\\\\\");
+
+        Properties properties = new Properties();
+        InputStream is = new ByteArrayInputStream(propertiesString.getBytes());
+        properties.load(is);
+        
+        // HACK for crash recovery tests
+        // check whether we have User and Password in XA properties
+        if (! properties.containsKey("User"))
+        {
+           properties.setProperty("User", CrashHelper.DS_USER_NAME);
+           properties.setProperty("Password", CrashHelper.DS_PASSWORD);
+        }
+        // end of hack
+
+        Class clazz = Thread.currentThread().getContextClassLoader().loadClass(xaDataSourceClassname);
+        XADataSource xads = (XADataSource) clazz.newInstance();
+        Class[] NOCLASSES = new Class[] {};
+        for (Iterator i = properties.keySet().iterator(); i.hasNext();)
+        {
+            String name = (String) i.next();
+            String value = properties.getProperty(name);
+            //This is a bad solution.  On the other hand the only known example
+            // of a setter with no getter is for Oracle with password.
+            //Anyway, each xadatasource implementation should get its
+            //own subclass of this that explicitly sets the
+            //properties individually.
+            Class type = null;
+            try
+            {
+                Method getter = clazz.getMethod("get" + name, NOCLASSES);
+                type = getter.getReturnType();
+            }
+            catch (NoSuchMethodException e)
+            {
+                type = String.class;
+
+                try
+                {
+                    //HACK for now until we can rethink the XADataSourceProperties variable and pass type information
+                    Method getter = clazz.getMethod("is" + name, NOCLASSES);
+                    type = getter.getReturnType();
+
+                }catch(NoSuchMethodException nsme)
+                {
+                    type = String.class;
+
+                }
+
+            }
+
+            Method setter = clazz.getMethod("set" + name, new Class[] { type });
+            PropertyEditor editor = PropertyEditorManager.findEditor(type);
+            editor.setAsText(value);
+            setter.invoke(xads, new Object[] { editor.getValue() });
+        }
+        return xads;
+    }
+
+    public void retrieveData(String parameter,String delimiter)
+    {
+        StringTokenizer st = new StringTokenizer(parameter,delimiter);
+        while (st.hasMoreTokens())
+        {
+            String data = st.nextToken();
+            if(data.length()>9)
+            {
+                if(_USERNAME.equalsIgnoreCase(data.substring(0,8)))
+                {
+                    _username =data.substring(9);
+                }
+                if(_PASSWORD.equalsIgnoreCase(data.substring(0,8)))
+                {
+                    _password =data.substring(9);
+                }
+                if(_JNDINAME.equalsIgnoreCase(data.substring(0,8)))
+                {
+                    _dataSourceId=data.substring(9);
+                }
+                if(_FORCE.equals(data.substring(0, 10)))
+                {
+                    _force = true;
+                }
+            }
+        }
+
+        if(_dataSourceId == null && parameter != null && parameter.indexOf('=') == -1) {
+            // try to fallback to old parameter format where only the dataSourceId is given, without jndiname= prefix
+            _dataSourceId = parameter;
+        }
+
+        if(!_force) {
+            log.warn("AppServerJDBCXARecovery has been deprecated, see JBTM-756");
+        }
+    }
+
+    private String getValueForKey(String config, String key)
+    {
+		Pattern usernamePattern = Pattern.compile("(name=" + key + ", value=)(.*)(</li>)");
+		Matcher m = usernamePattern.matcher(config);
+		if(m.find())
+		{
+			return m.group(2);
+		}
+		return "";
+	}
+
+    private String getValueForLoginModuleClass(String config)
+    {
+        Pattern usernamePattern = Pattern.compile("(" + _MODULE + ":)(.*)");
+        Matcher m = usernamePattern.matcher(config);
+        if(m.find())
+        {
+            return m.group(2).trim();
+        }
+        return "";
+    }
+    
+    private static String decode(String secret) throws NoSuchPaddingException, NoSuchAlgorithmException,
+            InvalidKeyException, BadPaddingException, IllegalBlockSizeException
+    {
+	    byte[] kbytes = "jaas is the way".getBytes();
+	    SecretKeySpec key = new SecretKeySpec(kbytes, "Blowfish");
+	
+	    BigInteger n = new BigInteger(secret, 16);
+	    byte[] encoding = n.toByteArray();
+	    
+	    Cipher cipher = Cipher.getInstance("Blowfish");
+	    cipher.init(Cipher.DECRYPT_MODE, key);
+	    byte[] decode = cipher.doFinal(encoding);
+	    return new String(decode);
+	 }
+
+    private static String decodePBE(MBeanServerConnection server, String password, String jaasSecurityDomain) throws Exception
+    {
+        byte[] secret = (byte[]) server.invoke(new ObjectName(jaasSecurityDomain), "decode64", new Object[] {password}, new String[] {"java.lang.String"});
+        return new String(secret, "UTF-8");
+    }
+
+
+    private boolean _supportsIsValidMethod;
+    private XAConnection _connection;
+    private XADataSource                 _dataSource;
+    private LocalConnectionEventListener _connectionEventListener;
+    private boolean                      _hasMoreResources;
+    private boolean _encrypted;
+
+    private boolean _force = false;
+
+    private String _dataSourceId;
+    private String _username;
+    private String _password;
+    private String _dbUsername;
+    private String _dbPassword;
+    
+    private final String _JNDINAME = "jndiname";
+    private final String _USERNAME = "username";
+    private final String _PASSWORD = "password";
+    private final String _FORCE = "force=true";
+    private final String _MODULE = "LoginModule Class";
+    private final String _DELIMITER = ",";
+    
+    private Logger log = org.jboss.logging.Logger.getLogger(AppServerJDBCXARecovery.class);
+}

Modified: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashBMTBean.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashBMTBean.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashBMTBean.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -28,8 +28,6 @@
 import javax.annotation.Resource;
 import javax.ejb.EJBContext;
 import javax.ejb.Stateless;
-import javax.ejb.TransactionAttribute;
-import javax.ejb.TransactionAttributeType;
 import javax.ejb.TransactionManagement;
 import javax.ejb.TransactionManagementType;
 import javax.transaction.SystemException;
@@ -45,13 +43,11 @@
    @Resource
    private EJBContext context;
    
-   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public String testXA(String ... args)
    {
       return "Passed";
    }
 
-   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public String testXA(ASFailureSpec... specs)
    {
       TestASRecovery xatest = new TestASRecovery();
@@ -68,17 +64,16 @@
       return xatest.startTest() ? "Passed" : "Failed";
    }
 
-   @TransactionAttribute(TransactionAttributeType.REQUIRES_NEW)
    public String testXA(String testEntityPK, boolean reverseOrder, ASFailureSpec... specs)
    {
+      log.info("BMT testXA called with " + specs.length + " specs and testEntityPK=" + testEntityPK + " reverseOrder=" + reverseOrder);
+
       TestASRecoveryWithJPA xatest = new TestASRecoveryWithJPA();
       String txStatus = getStatus(context.getUserTransaction());
 
       if (txStatus != null)
-         log.info("BMT method called with tx status: " + txStatus);
+         log.info("BMT testXA called with tx status: " + txStatus);
 
-      log.info("BMT testXA called with " + specs.length + " specs and testEntityPK=" + testEntityPK + " reverseOrder=" + reverseOrder);
-
       xatest.setTestEntityPK(testEntityPK);
       xatest.setReverseOrder(reverseOrder);
       
@@ -87,8 +82,8 @@
 
       return xatest.startTest() ? "Passed" : "Failed";
    }
-
-   public String getStatus(UserTransaction tx)
+   
+   protected String getStatus(UserTransaction tx)
    {
       if (tx == null)
          return null;

Modified: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelper.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelper.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelper.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -22,21 +22,17 @@
 package org.jboss.test.jbossts.crash;
 
 import java.sql.SQLException;
-import java.util.HashSet;
 import java.util.Set;
 
 import javax.ejb.Stateless;
 import javax.ejb.TransactionAttribute;
 import javax.ejb.TransactionAttributeType;
-import javax.transaction.xa.XAException;
 import javax.transaction.xa.XAResource;
-import javax.transaction.xa.Xid;
 
-import org.jboss.logging.Logger;
+import org.jboss.test.jbossts.recovery.CommonCrashHelper;
+import org.jboss.test.jbossts.recovery.RecoveredXid;
 
-import com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;
 
-
 /**
  * Helper class for playing with txs in doubt.
  * 
@@ -44,167 +40,72 @@
  * @version $Revision: 1.1 $
  */
 @Stateless
-public class CrashHelper implements CrashHelperRem
+public class CrashHelper extends CommonCrashHelper implements JPACrashHelperRem
 {
-   public static final String REMOTE_JNDI_NAME      = CrashHelper.class.getSimpleName() + "/remote";
-   private static Logger log                        = Logger.getLogger(CrashHelper.class);
+   public static final String REMOTE_JNDI_NAME = CrashHelper.class.getSimpleName() + "/remote";
    
    /**
-    * JNDI name of crash recovery datasource.  
+    * Default JNDI name of recovery datasource.  
     */
    public static final String DS_JNDI_NAME          = "CrashRecoveryDS";
+   public static final String DS_USER_NAME          = "crashrec";
+   public static final String DS_PASSWORD           = "crashrec";
 
+   private String datasourceName = DS_JNDI_NAME;
+
    
-   /**
-    * Wipes out xids in doubt from database ({@link #DS_JNDI_NAME}) according to 
-    * <code>xidToRecover</code> list. If xidToRecover is null, it wipes out all xids in doubt.
-    * 
-    * @param xidToRecover list of Xids to recover
-    */
    @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
-   public boolean wipeOutTxsInDoubt(Set<RecoveredXid> xidsToRecover)
+   public Set<RecoveredXid> checkXidsInDoubt(String datasourceName)
    {
-      log.info("wipe out txs in doubt");
-      try
-      {
-         AppServerJDBCXARecovery appServerRecovery = new AppServerJDBCXARecovery();
+      setDatasourceName(datasourceName);
+      return super.checkXidsInDoubt();
+   }
 
-         if (appServerRecovery.initialise("jndiname=" + DS_JNDI_NAME))
-         {
-            if (appServerRecovery.hasMoreResources())
-            {
-               XAResource xares = appServerRecovery.getXAResource();
-
-               Xid[] txInDoubt = null;
-               try
-               {               
-                  txInDoubt = xares.recover(XAResource.TMSTARTRSCAN);
-               }
-               catch (XAException e)
-               {
-                  log.error("Cannot start recovering on xares", e);
-                  
-                  try
-                  {
-                     xares.recover(XAResource.TMENDRSCAN);
-                  }
-                  catch (Exception e1)
-                  {
-                  }
-
-                  return false;
-               }
-
-               if (txInDoubt == null || txInDoubt.length == 0)
-                  return true;
-               
-               log.info("There are " + txInDoubt.length + " xids in doubt");
-               
-               for (int k=0; k < txInDoubt.length; k++)
-               {
-                  RecoveredXid xid = convertToRecoveredXid(txInDoubt[k]);
-                  if (xidsToRecover == null || xidsToRecover.contains(xid))
-                  {
-                     try
-                     {
-                        log.info("rollbacking of Xid " + xid);
-                        xares.rollback(txInDoubt[k]);
-                     }
-                     catch (Exception e)
-                     {
-                        log.error("Error in rollback of Xid " + txInDoubt[k], e);
-                     }
-                  }
-               }
-
-               try
-               {
-                  if (xares != null)
-                     xares.recover(XAResource.TMENDRSCAN);
-               }
-               catch (XAException e)
-               {
-                  log.error("Cannot finish recovering on xares", e);
-               }
-            }
-         }
-      }
-      catch (SQLException e)
-      {
-         log.error("Cannot get any XAResource by AppServerJDBCXARecovery", e);
-         return false;
-      }
-
-      return true;
+   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+   public boolean wipeOutTxsInDoubt(String datasourceName, Set<RecoveredXid> xidsToRecover)
+   {
+      setDatasourceName(datasourceName);
+      return super.wipeOutTxsInDoubt(xidsToRecover);
    }
 
+   private void setDatasourceName(String datasourceName)
+   {
+      if (datasourceName != null && datasourceName.length() > 0)
+         this.datasourceName = datasourceName;
+   }
+   
    /**
-    * Checks xids in doubt in datasource with {@link #DS_JNDI_NAME}. 
-    * 
-    * @return number of xids in doubt
+    * Gets XAResource for a datasource with name ({@link #DS_JNDI_NAME}).
     */
-   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
-   public Set<RecoveredXid> checkXidsInDoubt()
+   @Override
+   protected XAResource getNewXAResource() throws Exception
    {
-      Set<RecoveredXid> xids = new HashSet<RecoveredXid>();
+      XAResource xares = null;
       try
       {
          AppServerJDBCXARecovery appServerRecovery = new AppServerJDBCXARecovery();
 
-         if (appServerRecovery.initialise("jndiname=" + DS_JNDI_NAME))
+         if (appServerRecovery.initialise("jndiname=" + datasourceName + ",force=true"))
          {
             if (appServerRecovery.hasMoreResources())
             {
-               XAResource xares = appServerRecovery.getXAResource();
-
-               try
-               {               
-                  Xid[] xidsInDoubt = xares.recover(XAResource.TMSTARTRSCAN);
-                  
-                  if (xidsInDoubt != null)
-                  {
-                     log.info("There are " + xidsInDoubt.length + " xids in doubt");
-
-                     for (int k=0; k < xidsInDoubt.length; k++)
-                        xids.add(convertToRecoveredXid(xidsInDoubt[k]));
-                  }
-               }
-               catch (XAException e)
-               {
-                  log.error("Cannot start recover scan on xares", e);
-               }
-               finally
-               {
-                  try
-                  {
-                     if (xares != null)
-                        xares.recover(XAResource.TMENDRSCAN);
-                  }
-                  catch (XAException e)
-                  {
-                     log.error("Cannot finish recover scan on xares", e);
-                  }
-               }
+               xares = appServerRecovery.getXAResource();
             }
          }
       }
       catch (SQLException e)
       {
          log.error("Cannot get any XAResource by AppServerJDBCXARecovery", e);
+         throw e;
       }
-
-      return xids;
+      
+      return xares;
    }
-   
-   private RecoveredXid convertToRecoveredXid(Xid xid)
+
+   @Override
+   protected void closeXAResource()
    {
-      RecoveredXid recoveredXid = new RecoveredXid();
-      
-      recoveredXid.setBranchQualifier(xid.getBranchQualifier());
-      recoveredXid.setFormatId(xid.getFormatId());
-      recoveredXid.setGlobalTransactionId(xid.getGlobalTransactionId());
-      
-      return recoveredXid;
+      // Nothing to do here. Is it alright?
    }
 
 }

Deleted: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelperRem.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelperRem.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashHelperRem.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,33 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.jbossts.crash;
-
-import java.util.Set;
-
-import javax.ejb.Remote;
-
- at Remote
-public interface CrashHelperRem
-{
-   public boolean wipeOutTxsInDoubt(Set<RecoveredXid> xidsToRecover);
-   public Set<RecoveredXid> checkXidsInDoubt();
-}

Deleted: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashLocalHome.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashLocalHome.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashLocalHome.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,28 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2008,
- * @author JBoss Inc.
- */
-package org.jboss.test.jbossts.crash;
-
-import javax.ejb.EJBLocalHome;
-import javax.ejb.CreateException;
-
-public interface CrashLocalHome extends EJBLocalHome {
-    CrashLocal create() throws CreateException;
-}

Deleted: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashRemHome.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashRemHome.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/CrashRemHome.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,29 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source
- * Copyright 2008, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags.
- * See the copyright.txt in the distribution for a
- * full listing of individual contributors.
- * This copyrighted material is made available to anyone wishing to use,
- * modify, copy, or redistribute it subject to the terms and conditions
- * of the GNU Lesser General Public License, v. 2.1.
- * This program is distributed in the hope that it will be useful, but WITHOUT A
- * WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
- * PARTICULAR PURPOSE.  See the GNU Lesser General Public License for more details.
- * You should have received a copy of the GNU Lesser General Public License,
- * v.2.1 along with this distribution; if not, write to the Free Software
- * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
- * MA  02110-1301, USA.
- *
- * (C) 2008,
- * @author JBoss Inc.
- */
-package org.jboss.test.jbossts.crash;
-
-import javax.ejb.EJBHome;
-import javax.ejb.CreateException;
-import java.rmi.RemoteException;
-
-public interface CrashRemHome extends EJBHome {
-    CrashRem create() throws CreateException, RemoteException;
-}

Added: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/JPACrashHelperRem.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jbossts.crash;
+
+import java.util.Set;
+
+import javax.ejb.Remote;
+
+import org.jboss.test.jbossts.recovery.RecoveredXid;
+
+ at Remote
+public interface JPACrashHelperRem
+{
+   public boolean wipeOutTxsInDoubt(String datasourceName, Set<RecoveredXid> xidsToRecover);
+   public Set<RecoveredXid> checkXidsInDoubt(String datasourceName);
+}

Deleted: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/RecoveredXid.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/RecoveredXid.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/RecoveredXid.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,107 +0,0 @@
-/*
- * JBoss, Home of Professional Open Source.
- * Copyright 2009, Red Hat Middleware LLC, and individual contributors
- * as indicated by the @author tags. See the copyright.txt file in the
- * distribution for a full listing of individual contributors.
- *
- * This is free software; you can redistribute it and/or modify it
- * under the terms of the GNU Lesser General Public License as
- * published by the Free Software Foundation; either version 2.1 of
- * the License, or (at your option) any later version.
- *
- * This software is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this software; if not, write to the Free
- * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
- * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
- */
-package org.jboss.test.jbossts.crash;
-
-import java.io.Serializable;
-import java.util.Arrays;
-
-public class RecoveredXid implements Serializable
-{
-   private byte[] branchQualifier;
-   private int formatId;
-   private byte[] globalTransactionId;
-   
-   public RecoveredXid()
-   {
-   }
-
-   public byte[] getBranchQualifier()
-   {
-      return branchQualifier;
-   }
-
-   public void setBranchQualifier(byte[] branchQualifier)
-   {
-      this.branchQualifier = branchQualifier;
-   }
-
-   public int getFormatId()
-   {
-      return formatId;
-   }
-
-   public void setFormatId(int formatId)
-   {
-      this.formatId = formatId;
-   }
-
-   public byte[] getGlobalTransactionId()
-   {
-      return globalTransactionId;
-   }
-
-   public void setGlobalTransactionId(byte[] globalTransactionId)
-   {
-      this.globalTransactionId = globalTransactionId;
-   }
-
-   @Override
-   public int hashCode()
-   {
-      final int prime = 31;
-      int result = 1;
-      result = prime * result + Arrays.hashCode(branchQualifier);
-      result = prime * result + formatId;
-      result = prime * result + Arrays.hashCode(globalTransactionId);
-      return result;
-   }
-
-   @Override
-   public boolean equals(Object obj)
-   {
-      if (this == obj)
-         return true;
-      if (obj == null)
-         return false;
-      if (getClass() != obj.getClass())
-         return false;
-      RecoveredXid other = (RecoveredXid) obj;
-      if (!Arrays.equals(branchQualifier, other.branchQualifier))
-         return false;
-      if (formatId != other.formatId)
-         return false;
-      if (!Arrays.equals(globalTransactionId, other.globalTransactionId))
-         return false;
-      return true;
-   }
-
-   @Override
-   /**
-    * Only for debugging purposes.
-    */
-   public String toString()
-   {
-      return "RecoveredXid [branchQualifier=" + Arrays.toString(branchQualifier) + ", formatId=" + formatId
-            + ", globalTransactionId=" + Arrays.toString(globalTransactionId) + "]";
-   }
-   
-}

Modified: trunk/testsuite/src/main/org/jboss/test/jbossts/crash/TestEntityHelper.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/crash/TestEntityHelper.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/crash/TestEntityHelper.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -80,7 +80,6 @@
     */
    public TestEntity getTestEntity(String entityPK)
    {
-      log.info("entityPK = " + entityPK);
       TestEntity entity = em.find(TestEntity.class, entityPK);
       log.debug("TestEntityHelper#getTestEntity(" + entityPK + ") = " + entity);
       

Added: trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CommonCrashHelper.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,208 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jbossts.recovery;
+
+import java.util.HashSet;
+import java.util.Set;
+
+import javax.ejb.EJBException;
+import javax.ejb.TransactionAttribute;
+import javax.ejb.TransactionAttributeType;
+import javax.transaction.xa.XAException;
+import javax.transaction.xa.XAResource;
+import javax.transaction.xa.Xid;
+
+import org.jboss.logging.Logger;
+import org.jboss.test.jbossts.recovery.RecoveredXid;
+
+
+/**
+ * Helper class for playing with in-doubt txs.
+ * 
+ * @author <a href="istudens at redhat.com">Ivo Studensky</a>
+ * @version $Revision: 1.1 $
+ */
+public abstract class CommonCrashHelper implements CrashHelperRem
+{
+   protected static Logger log = Logger.getLogger(CommonCrashHelper.class);
+
+
+   /**
+    * Wipes out in-doubt xids according to <code>xidToRecover</code> list. 
+    * If xidToRecover is null, it wipes out all in-doubt xids. 
+    * The in-doubt xids are taken from {@link #getNewXAResource()}. 
+    * 
+    * @param xidToRecover list of Xids to recover
+    */
+   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+   public boolean wipeOutTxsInDoubt(Set<RecoveredXid> xidsToRecover)
+   {
+      log.info("wipe out in-doubt txs");
+
+      XAResource xares = null;
+      try
+      {
+         xares = getNewXAResource();
+         
+         if (xares == null)
+            return false;
+
+         Xid[] txInDoubt = null;
+         try
+         {               
+            txInDoubt = xares.recover(XAResource.TMSTARTRSCAN);
+         }
+         catch (XAException e)
+         {
+            log.error("Cannot start recovering on xares", e);
+
+            try
+            {
+               xares.recover(XAResource.TMENDRSCAN);
+            }
+            catch (Exception e1)
+            {
+            }
+
+            return false;
+         }
+
+         if (txInDoubt == null || txInDoubt.length == 0)
+            return true;
+
+         log.info("There are " + txInDoubt.length + " xids in doubt");
+
+         for (int k=0; k < txInDoubt.length; k++)
+         {
+            RecoveredXid xid = convertToRecoveredXid(txInDoubt[k]);
+            if (xidsToRecover == null || xidsToRecover.contains(xid))
+            {
+               try
+               {
+                  log.info("rollbacking of Xid " + xid);
+                  xares.rollback(txInDoubt[k]);
+               }
+               catch (Exception e)
+               {
+                  log.error("Error in rollback of Xid " + txInDoubt[k], e);
+               }
+            }
+         }
+
+         try
+         {
+            if (xares != null)
+               xares.recover(XAResource.TMENDRSCAN);
+         }
+         catch (XAException e)
+         {
+            log.error("Cannot finish recovering on xares", e);
+         }
+      }
+      catch (Exception e)
+      {
+         log.error("Cannot get a new XA resource", e);
+         throw new EJBException("Cannot get a new XA resource: " + e.getMessage());
+      }
+      finally
+      {
+         closeXAResource();
+      }
+      return true;
+   }
+
+   /**
+    * Checks in-doubt xids by XAResource taken from {@link #getNewXAResource()}. 
+    * 
+    * @return in-doubt xids
+    */
+   @TransactionAttribute(TransactionAttributeType.NOT_SUPPORTED)
+   public Set<RecoveredXid> checkXidsInDoubt()
+   {
+      Set<RecoveredXid> xids = new HashSet<RecoveredXid>();
+
+      XAResource xares = null;
+      try
+      {               
+         xares = getNewXAResource();
+
+         try
+         {
+            Xid[] xidsInDoubt = xares.recover(XAResource.TMSTARTRSCAN);
+
+            if (xidsInDoubt != null)
+            {
+               log.info("There are " + xidsInDoubt.length + " xids in doubt");
+
+               for (int k=0; k < xidsInDoubt.length; k++)
+                  xids.add(convertToRecoveredXid(xidsInDoubt[k]));
+            }
+         }
+         catch (XAException e)
+         {
+            log.error("Cannot start recover scan on xares", e);
+            throw new EJBException("Cannot start recover scan on xares: " + e.getMessage());
+         }
+         finally
+         {
+            try
+            {
+               if (xares != null)
+                  xares.recover(XAResource.TMENDRSCAN);
+            }
+            catch (XAException e)
+            {
+               log.error("Cannot finish recover scan on xares", e);
+            }
+         }
+      }
+      catch (Exception e)
+      {
+         log.error("Cannot get a new XA resource", e);
+         throw new EJBException("Cannot get a new XA resource: " + e.getMessage());
+      }
+      finally
+      {
+         closeXAResource();
+      }
+
+      return xids;
+   }
+
+   private RecoveredXid convertToRecoveredXid(Xid xid)
+   {
+      RecoveredXid recoveredXid = new RecoveredXid();
+
+      recoveredXid.setBranchQualifier(xid.getBranchQualifier());
+      recoveredXid.setFormatId(xid.getFormatId());
+      recoveredXid.setGlobalTransactionId(xid.getGlobalTransactionId());
+
+      return recoveredXid;
+   }
+
+   
+   protected abstract XAResource getNewXAResource() throws Exception;
+
+   // Should not throw out any exception.
+   protected abstract void closeXAResource();
+
+}

Added: trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/CrashHelperRem.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,35 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jbossts.recovery;
+
+import java.util.Set;
+
+import javax.ejb.Remote;
+
+import org.jboss.test.jbossts.recovery.RecoveredXid;
+
+ at Remote
+public interface CrashHelperRem
+{
+   public boolean wipeOutTxsInDoubt(Set<RecoveredXid> xidsToRecover);
+   public Set<RecoveredXid> checkXidsInDoubt();
+}

Added: trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java	                        (rev 0)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/recovery/RecoveredXid.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,107 @@
+/*
+ * JBoss, Home of Professional Open Source.
+ * Copyright 2009, Red Hat Middleware LLC, and individual contributors
+ * as indicated by the @author tags. See the copyright.txt file in the
+ * distribution for a full listing of individual contributors.
+ *
+ * This is free software; you can redistribute it and/or modify it
+ * under the terms of the GNU Lesser General Public License as
+ * published by the Free Software Foundation; either version 2.1 of
+ * the License, or (at your option) any later version.
+ *
+ * This software is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+ * Lesser General Public License for more details.
+ *
+ * You should have received a copy of the GNU Lesser General Public
+ * License along with this software; if not, write to the Free
+ * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA
+ * 02110-1301 USA, or see the FSF site: http://www.fsf.org.
+ */
+package org.jboss.test.jbossts.recovery;
+
+import java.io.Serializable;
+import java.util.Arrays;
+
+public class RecoveredXid implements Serializable
+{
+   private byte[] branchQualifier;
+   private int formatId;
+   private byte[] globalTransactionId;
+   
+   public RecoveredXid()
+   {
+   }
+
+   public byte[] getBranchQualifier()
+   {
+      return branchQualifier;
+   }
+
+   public void setBranchQualifier(byte[] branchQualifier)
+   {
+      this.branchQualifier = branchQualifier;
+   }
+
+   public int getFormatId()
+   {
+      return formatId;
+   }
+
+   public void setFormatId(int formatId)
+   {
+      this.formatId = formatId;
+   }
+
+   public byte[] getGlobalTransactionId()
+   {
+      return globalTransactionId;
+   }
+
+   public void setGlobalTransactionId(byte[] globalTransactionId)
+   {
+      this.globalTransactionId = globalTransactionId;
+   }
+
+   @Override
+   public int hashCode()
+   {
+      final int prime = 31;
+      int result = 1;
+      result = prime * result + Arrays.hashCode(branchQualifier);
+      result = prime * result + formatId;
+      result = prime * result + Arrays.hashCode(globalTransactionId);
+      return result;
+   }
+
+   @Override
+   public boolean equals(Object obj)
+   {
+      if (this == obj)
+         return true;
+      if (obj == null)
+         return false;
+      if (getClass() != obj.getClass())
+         return false;
+      RecoveredXid other = (RecoveredXid) obj;
+      if (!Arrays.equals(branchQualifier, other.branchQualifier))
+         return false;
+      if (formatId != other.formatId)
+         return false;
+      if (!Arrays.equals(globalTransactionId, other.globalTransactionId))
+         return false;
+      return true;
+   }
+
+   @Override
+   /**
+    * Only for debugging purposes.
+    */
+   public String toString()
+   {
+      return "RecoveredXid [branchQualifier=" + Arrays.toString(branchQualifier) + ", formatId=" + formatId
+            + ", globalTransactionId=" + Arrays.toString(globalTransactionId) + "]";
+   }
+   
+}

Modified: trunk/testsuite/src/main/org/jboss/test/jbossts/taskdefs/TransactionLog.java
===================================================================
--- trunk/testsuite/src/main/org/jboss/test/jbossts/taskdefs/TransactionLog.java	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/main/org/jboss/test/jbossts/taskdefs/TransactionLog.java	2010-11-26 17:18:09 UTC (rev 109497)
@@ -30,6 +30,7 @@
 import com.arjuna.ats.arjuna.AtomicAction;
 import com.arjuna.ats.internal.arjuna.common.UidHelper;
 
+import java.lang.reflect.Constructor;
 import java.util.ArrayList;
 import java.util.Collection;
 
@@ -60,8 +61,9 @@
             try
             {
                 Class c = Class.forName(impleType);
-
-                store = (RecoveryStore) c.newInstance();
+                Constructor constructor = c.getConstructor(new Class[] {ObjectStoreEnvironmentBean.class});
+                
+                store = (RecoveryStore) constructor.newInstance(new Object[] {objectStoreEnvironmentBean});
             }
             catch (final Throwable ex)
             {

Modified: trunk/testsuite/src/resources/jbossts/resources/db2_97-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/db2_97-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/db2_97-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -14,9 +14,8 @@
      <jndi-name>CrashRecoveryDS</jndi-name>
         <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>
+        <xa-datasource-property name="DatabaseName">jbossqa</xa-datasource-property>
+        @CREDENTIALS@
         
         <!-- 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>

Modified: trunk/testsuite/src/resources/jbossts/resources/mssql2005-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/mssql2005-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/mssql2005-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -29,8 +29,7 @@
     <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>
+    @CREDENTIALS@
     <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
 
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

Modified: trunk/testsuite/src/resources/jbossts/resources/mssql2008-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/mssql2008-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/mssql2008-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -29,8 +29,7 @@
     <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>
+    @CREDENTIALS@
     <xa-datasource-property name="SelectMethod">cursor</xa-datasource-property>
 
       <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->

Modified: trunk/testsuite/src/resources/jbossts/resources/mysql50-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/mysql50-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/mysql50-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -13,8 +13,7 @@
     <xa-datasource-property name="ServerName">vmg08.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">3306</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>
+    @CREDENTIALS@
     <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
     <!-- sql to call when connection is created
     <new-connection-sql>some arbitrary sql</new-connection-sql>

Modified: trunk/testsuite/src/resources/jbossts/resources/mysql51-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/mysql51-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/mysql51-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -13,8 +13,7 @@
     <xa-datasource-property name="ServerName">vmg02.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">3306</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>
+    @CREDENTIALS@
     <exception-sorter-class-name>com.mysql.jdbc.integration.jboss.ExtendedMysqlExceptionSorter</exception-sorter-class-name>
     <!-- sql to call when connection is created
     <new-connection-sql>some arbitrary sql</new-connection-sql>

Modified: trunk/testsuite/src/resources/jbossts/resources/oracle-rac-lb-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle-rac-lb-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle-rac-lb-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -20,10 +20,9 @@
     <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:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=vmg24-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vmg25-vip.mw.lab.eng.bos.redhat.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
     <!-- Checks the Oracle error codes and messages for fatal errors -->
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->

Deleted: trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-1-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-1-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-1-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
-<!-- ===================================================================== -->
-
-<datasources>
-
-  <xa-datasource>
-    <jndi-name>CrashRecoveryDS</jndi-name>
-    <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg27-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</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 -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
-    <!-- Checks the Oracle error codes and messages for fatal errors -->
-    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
-    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
-    <no-tx-separate-pools/>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
-  </xa-datasource>
-
-</datasources>

Deleted: trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-2-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-2-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-2-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
-<!-- ===================================================================== -->
-
-<datasources>
-
-  <xa-datasource>
-    <jndi-name>RecoveryDS</jndi-name>
-    <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg28-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</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 -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
-    <!-- Checks the Oracle error codes and messages for fatal errors -->
-    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
-    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
-    <no-tx-separate-pools/>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
-  </xa-datasource>
-
-</datasources>

Modified: trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-lb-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-lb-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-lb-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -20,8 +20,7 @@
     <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:thin:@(DESCRIPTION=(ADDRESS_LIST=(LOAD_BALANCE=ON)(ADDRESS=(PROTOCOL=TCP)(HOST=vmg27-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(ADDRESS=(PROTOCOL=TCP)(HOST=vmg28-vip.mw.lab.eng.bos.redhat.com)(PORT=1521)))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
     <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
     <!-- Checks the Oracle error codes and messages for fatal errors -->

Added: trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle-rac-r2-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  JBoss Server Configuration                                           -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
+
+<!-- ===================================================================== -->
+<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
+<!-- ===================================================================== -->
+
+<datasources>
+
+  <xa-datasource>
+    <jndi-name>CrashRecoveryDS</jndi-name>
+    <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg27-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
+    <xa-datasource-property name="User">crash0</xa-datasource-property>
+    <xa-datasource-property name="Password">crash0</xa-datasource-property>
+    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
+    <!-- Checks the Oracle error codes and messages for fatal errors -->
+    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
+    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
+    <no-tx-separate-pools/>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Oracle9i</type-mapping>
+      </metadata>
+  </xa-datasource>
+
+  <xa-datasource>
+    <jndi-name>RecoveryDS</jndi-name>
+    <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg28-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</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 -->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
+    <!-- Checks the Oracle error codes and messages for fatal errors -->
+    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
+    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
+    <no-tx-separate-pools/>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Oracle9i</type-mapping>
+      </metadata>
+  </xa-datasource>
+
+</datasources>

Added: trunk/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle-rac-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,59 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  JBoss Server Configuration                                           -->
+<!--                                                                       -->
+<!-- ===================================================================== -->
+
+<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
+
+<!-- ===================================================================== -->
+<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
+<!-- ===================================================================== -->
+
+<datasources>
+
+  <xa-datasource>
+    <jndi-name>CrashRecoveryDS</jndi-name>
+    <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg24-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</xa-datasource-property>
+    <xa-datasource-property name="User">crash0</xa-datasource-property>
+    <xa-datasource-property name="Password">crash0</xa-datasource-property>
+    <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
+    <!-- Checks the Oracle error codes and messages for fatal errors -->
+    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
+    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
+    <no-tx-separate-pools/>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Oracle9i</type-mapping>
+      </metadata>
+  </xa-datasource>
+
+  <xa-datasource>
+    <jndi-name>RecoveryDS</jndi-name>
+    <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg25-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</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 -->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
+    <!-- Checks the Oracle error codes and messages for fatal errors -->
+    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
+    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
+    <no-tx-separate-pools/>
+
+      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+      <metadata>
+         <type-mapping>Oracle9i</type-mapping>
+      </metadata>
+  </xa-datasource>
+
+</datasources>

Deleted: trunk/testsuite/src/resources/jbossts/resources/oracle-rac1-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle-rac1-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle-rac1-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
-<!-- ===================================================================== -->
-
-<datasources>
-
-  <xa-datasource>
-    <jndi-name>CrashRecoveryDS</jndi-name>
-    <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg24-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</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 -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
-    <!-- Checks the Oracle error codes and messages for fatal errors -->
-    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
-    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
-    <no-tx-separate-pools/>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
-  </xa-datasource>
-
-</datasources>

Deleted: trunk/testsuite/src/resources/jbossts/resources/oracle-rac2-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle-rac2-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle-rac2-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,38 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!--                                                                       -->
-<!-- ===================================================================== -->
-
-<!-- $Id: oracle-xa-ds.xml 71535 2008-04-01 07:05:03Z adrian at jboss.org $ -->
-
-<!-- ===================================================================== -->
-<!-- ATTENTION:  DO NOT FORGET TO SET Pad=true IN transaction-service.xml  -->
-<!-- ===================================================================== -->
-
-<datasources>
-
-  <xa-datasource>
-    <jndi-name>RecoveryDS</jndi-name>
-    <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg25-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</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 -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
-    <!-- Checks the Oracle error codes and messages for fatal errors -->
-    <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
-    <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
-    <no-tx-separate-pools/>
-
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
-  </xa-datasource>
-
-</datasources>

Modified: trunk/testsuite/src/resources/jbossts/resources/oracle10-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle10-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle10-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -20,10 +20,9 @@
     <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:thin:@vmg05.mw.lab.eng.bos.redhat.com:1521:qaora10</xa-datasource-property>
-    <xa-datasource-property name="User">crashrec</xa-datasource-property>
-    <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
     <!-- Checks the Oracle error codes and messages for fatal errors -->
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->

Modified: trunk/testsuite/src/resources/jbossts/resources/oracle11-r2-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle11-r2-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle11-r2-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -19,11 +19,10 @@
     <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:thin:@(DESCRIPTION=(ADDRESS=(PROTOCOL=TCP)(HOST=vmg27-vip.mw.lab.eng.bos.redhat.com)(PORT=1521))(CONNECT_DATA=(SERVICE_NAME=qarac.jboss)))</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="URL">jdbc:oracle:thin:@vmg27.mw.lab.eng.bos.redhat.com:1521:qaora11</xa-datasource-property>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
     <!-- Checks the Oracle error codes and messages for fatal errors -->
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->

Modified: trunk/testsuite/src/resources/jbossts/resources/oracle11-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/oracle11-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/oracle11-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -20,19 +20,18 @@
     <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: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>
+    @CREDENTIALS@
     <!-- Uses the pingDatabase method to check a connection is still valid before handing it out from the pool -->
-    <!--valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name-->
+    <valid-connection-checker-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleValidConnectionChecker</valid-connection-checker-class-name>
     <!-- Checks the Oracle error codes and messages for fatal errors -->
     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.OracleExceptionSorter</exception-sorter-class-name>
     <!-- Oracles XA datasource cannot reuse a connection outside a transaction once enlisted in a global transaction and vice-versa -->
     <no-tx-separate-pools/>
 
-      <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
-      <metadata>
-         <type-mapping>Oracle9i</type-mapping>
-      </metadata>
+    <!-- corresponding type-mapping in the standardjbosscmp-jdbc.xml (optional) -->
+    <metadata>
+       <type-mapping>Oracle9i</type-mapping>
+    </metadata>
   </xa-datasource>
 
 </datasources>

Modified: trunk/testsuite/src/resources/jbossts/resources/postgres82-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/postgres82-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/postgres82-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -7,7 +7,6 @@
     <xa-datasource-property name="ServerName">vmg01.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">5432</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>
+    @CREDENTIALS@
   </xa-datasource>
 </datasources>

Modified: trunk/testsuite/src/resources/jbossts/resources/postgres83-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/postgres83-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/postgres83-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -7,7 +7,6 @@
     <xa-datasource-property name="ServerName">vmg03.mw.lab.eng.bos.redhat.com</xa-datasource-property>
     <xa-datasource-property name="PortNumber">5432</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>
+    @CREDENTIALS@
   </xa-datasource>
 </datasources>

Added: trunk/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/jbossts/resources/postgres84-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+  <xa-datasource>
+    <jndi-name>CrashRecoveryDS</jndi-name>
+    <track-connection-by-tx>true</track-connection-by-tx> 
+    <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
+    <xa-datasource-property name="ServerName">postgresql02.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+    <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
+    <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+    @CREDENTIALS@
+  </xa-datasource>
+</datasources>

Added: trunk/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/jbossts/resources/postgres90-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<datasources>
+  <xa-datasource>
+    <jndi-name>CrashRecoveryDS</jndi-name>
+    <track-connection-by-tx>true</track-connection-by-tx> 
+    <xa-datasource-class>org.postgresql.xa.PGXADataSource</xa-datasource-class>
+    <xa-datasource-property name="ServerName">vmg03.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+    <xa-datasource-property name="PortNumber">5432</xa-datasource-property>
+    <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+    @CREDENTIALS@
+  </xa-datasource>
+</datasources>

Deleted: trunk/testsuite/src/resources/jbossts/resources/sybase12-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/sybase12-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/sybase12-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -1,32 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-
-<!-- ===================================================================== -->
-<!--                                                                       -->
-<!--  JBoss Server Configuration                                           -->
-<!-- Thanks to kosulin in the forumns                                      -->
-<!-- ===================================================================== -->
-
-<!-- $Id: sybase-xa-ds.xml 85945 2009-03-16 19:45:12Z dimitris at jboss.org $ -->
-
-<datasources>
-
-   <xa-datasource>
-     <jndi-name>CrashRecoveryDS</jndi-name>
-     <!-- uncomment to enable interleaving <interleaving/> -->
-     <xa-datasource-class>com.sybase.jdbc3.jdbc.SybXADataSource</xa-datasource-class>
-     <xa-datasource-property name="NetworkProtocol">Tds</xa-datasource-property>
-     <xa-datasource-property name="ServerName">dev01.qa.atl.jboss.com</xa-datasource-property>
-     <xa-datasource-property name="PortNumber">4100</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>
-     <min-pool-size>1</min-pool-size>
-     <max-pool-size>20</max-pool-size>
-     <idle-timeout-minutes>15</idle-timeout-minutes>
-     <!--check-valid-connection-sql>select 1 from mytable</check-valid-connection-sql-->
-     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
-     <type-mapping>Sybase</type-mapping>
-
-   </xa-datasource>
-
-</datasources>

Modified: trunk/testsuite/src/resources/jbossts/resources/sybase15-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/sybase15-xa-ds.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/resources/sybase15-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -13,20 +13,16 @@
    <xa-datasource>
      <jndi-name>CrashRecoveryDS</jndi-name>
      <!-- uncomment to enable interleaving <interleaving/> -->
-     <xa-datasource-class>com.sybase.jdbc3.jdbc.SybXADataSource</xa-datasource-class>
+     <xa-datasource-class>com.sybase.jdbc4.jdbc.SybXADataSource</xa-datasource-class>
      <xa-datasource-property name="NetworkProtocol">Tds</xa-datasource-property>
-     <xa-datasource-property name="ServerName">dev77.qa.atl2.redhat.com</xa-datasource-property>
-     <xa-datasource-property name="PortNumber">4100</xa-datasource-property>
+     <xa-datasource-property name="ServerName">vmg07.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+     <xa-datasource-property name="PortNumber">5000</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>
-     <min-pool-size>1</min-pool-size>
-     <max-pool-size>20</max-pool-size>
-     <idle-timeout-minutes>15</idle-timeout-minutes>
+     @CREDENTIALS@
      <!--check-valid-connection-sql>select 1 from mytable</check-valid-connection-sql-->
      <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
      <type-mapping>Sybase</type-mapping>
-
+     <track-connection-by-tx/>
    </xa-datasource>
 
 </datasources>

Added: trunk/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml	                        (rev 0)
+++ trunk/testsuite/src/resources/jbossts/resources/sybase15.5-xa-ds.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+
+<!-- ===================================================================== -->
+<!--                                                                       -->
+<!--  JBoss Server Configuration                                           -->
+<!-- Thanks to kosulin in the forumns                                      -->
+<!-- ===================================================================== -->
+
+<!-- $Id: sybase-xa-ds.xml 85945 2009-03-16 19:45:12Z dimitris at jboss.org $ -->
+
+<datasources>
+
+   <xa-datasource>
+     <jndi-name>CrashRecoveryDS</jndi-name>
+     <!-- uncomment to enable interleaving <interleaving/> -->
+     <xa-datasource-class>com.sybase.jdbc4.jdbc.SybXADataSource</xa-datasource-class>
+     <xa-datasource-property name="NetworkProtocol">Tds</xa-datasource-property>
+     <xa-datasource-property name="ServerName">vmg09.mw.lab.eng.bos.redhat.com</xa-datasource-property>
+     <xa-datasource-property name="PortNumber">5000</xa-datasource-property>
+     <xa-datasource-property name="DatabaseName">crashrec</xa-datasource-property>
+     @CREDENTIALS@
+     <!--check-valid-connection-sql>select 1 from mytable</check-valid-connection-sql-->
+     <exception-sorter-class-name>org.jboss.resource.adapter.jdbc.vendor.SybaseExceptionSorter</exception-sorter-class-name>
+     <type-mapping>Sybase</type-mapping>
+     <track-connection-by-tx/>
+   </xa-datasource>
+
+</datasources>

Modified: trunk/testsuite/src/resources/jbossts/scripts/as-tests.xml
===================================================================
--- trunk/testsuite/src/resources/jbossts/scripts/as-tests.xml	2010-11-26 17:11:07 UTC (rev 109496)
+++ trunk/testsuite/src/resources/jbossts/scripts/as-tests.xml	2010-11-26 17:18:09 UTC (rev 109497)
@@ -54,9 +54,18 @@
     <condition property="want.psql_8.3">
        <equals arg1="${jbossts.db}" arg2="psql_8.3"/>
     </condition>
+    <condition property="want.psql_8.4">
+       <equals arg1="${jbossts.db}" arg2="psql_8.4"/>
+    </condition>
+    <condition property="want.psql_9.0">
+       <equals arg1="${jbossts.db}" arg2="psql_9.0"/>
+    </condition>
     <condition property="want.sybase_15">
        <equals arg1="${jbossts.db}" arg2="sybase_15"/>
     </condition>
+    <condition property="want.sybase_15.5">
+       <equals arg1="${jbossts.db}" arg2="sybase_15.5"/>
+    </condition>
     <condition property="want.oracle_10">
        <equals arg1="${jbossts.db}" arg2="oracle_10"/>
     </condition>
@@ -98,7 +107,10 @@
   <target name="want-all-dbs">
   	<property name="want.psql_8.2" value="true" />
   	<property name="want.psql_8.3" value="true" />
+  	<property name="want.psql_8.4" value="true" />
+  	<property name="want.psql_9.0" value="true" />
   	<property name="want.sybase_15" value="true" />
+  	<property name="want.sybase_15.5" value="true" />
   	<property name="want.oracle_10" value="true" />
   	<property name="want.oracle_11" value="true" />
   	<property name="want.oracle_11_r2" value="true" />
@@ -188,6 +200,8 @@
   <target name="call-tests-for-all-dbs">
   	<antcall target="call-tests-for-psql_8.2"/>
   	<antcall target="call-tests-for-psql_8.3"/>
+  	<antcall target="call-tests-for-psql_8.4"/>
+  	<!--antcall target="call-tests-for-psql_9.0"/-->
   	<antcall target="call-tests-for-oracle_10"/>
   	<antcall target="call-tests-for-oracle_11"/>
   	<antcall target="call-tests-for-oracle_11_r2"/>
@@ -197,6 +211,7 @@
   	<antcall target="call-tests-for-mysql_5.1"/>
   	<antcall target="call-tests-for-db2_9.7"/>
   	<antcall target="call-tests-for-sybase_15"/>
+  	<antcall target="call-tests-for-sybase_15.5"/>
   	<antcall target="call-tests-for-oracle_rac"/>
   	<antcall target="call-tests-for-oracle_rac_lb"/>
   	<antcall target="call-tests-for-oracle_rac_r2"/>
@@ -219,6 +234,22 @@
     </antcall>
   </target>
 
+  <target name="call-tests-for-psql_8.4" if="want.psql_8.4">
+    <antcall target="${call.target}">
+      <param name="dbdriver" value="${driver.name.psql_8.4}"/>
+      <param name="datasource" value="postgres84-xa-ds.xml" /> 
+   	  <param name="dbname" value="psql84" /> 
+    </antcall>
+  </target>
+
+  <target name="call-tests-for-psql_9.0" if="want.psql_9.0">
+    <antcall target="${call.target}">
+      <param name="dbdriver" value="${driver.name.psql_9.0}"/>
+      <param name="datasource" value="postgres90-xa-ds.xml" /> 
+   	  <param name="dbname" value="psql90" /> 
+    </antcall>
+  </target>
+
   <target name="call-tests-for-oracle_10" if="want.oracle_10">
   	<antcall target="${call.target}">
   	  <param name="dbdriver" value="${driver.name.oracle_10}"/>
@@ -245,15 +276,16 @@
 
   <target name="call-tests-for-oracle_rac" if="want.oracle_rac">
     <antcall target="${call.target}">
-      <param name="dbdriver" value="${driver.name.oracle_11}"/>
-      <param name="datasource" value="oracle-rac1-xa-ds.xml" /> 
+      <param name="dbdriver" value="${driver.name.oracle_11_rac}"/>
+      <param name="datasource" value="oracle-rac-xa-ds.xml" /> 
       <param name="dbname" value="oracle_rac" /> 
+      <param name="recovery.datasource" value="RecoveryDS" />
     </antcall>
   </target>
 
   <target name="call-tests-for-oracle_rac_lb" if="want.oracle_rac_lb">
     <antcall target="${call.target}">
-      <param name="dbdriver" value="${driver.name.oracle_11}"/>
+      <param name="dbdriver" value="${driver.name.oracle_11_rac}"/>
       <param name="datasource" value="oracle-rac-lb-xa-ds.xml" /> 
       <param name="dbname" value="oracle_rac_lb" /> 
     </antcall>
@@ -261,15 +293,16 @@
 
   <target name="call-tests-for-oracle_rac_r2" if="want.oracle_rac_r2">
     <antcall target="${call.target}">
-      <param name="dbdriver" value="${driver.name.oracle_11}"/>
-      <param name="datasource" value="oracle-rac-r2-1-xa-ds.xml" /> 
+      <param name="dbdriver" value="${driver.name.oracle_11_rac}"/>
+      <param name="datasource" value="oracle-rac-r2-xa-ds.xml" /> 
       <param name="dbname" value="oracle_rac_r2" /> 
+      <param name="recovery.datasource" value="RecoveryDS" />
     </antcall>
   </target>
 
   <target name="call-tests-for-oracle_rac_r2_lb" if="want.oracle_rac_r2_lb">
     <antcall target="${call.target}">
-      <param name="dbdriver" value="${driver.name.oracle_11}"/>
+      <param name="dbdriver" value="${driver.name.oracle_11_rac}"/>
       <param name="datasource" value="oracle-rac-r2-lb-xa-ds.xml" /> 
       <param name="dbname" value="oracle_rac_r2_lb" /> 
     </antcall>
@@ -323,6 +356,13 @@
     </antcall>
   </target>
 
+  <target name="call-tests-for-sybase_15.5" if="want.sybase_15.5">
+  	<antcall target="${call.target}">
+  	  <param name="dbdriver" value="${driver.name.sybase_15}"/>
+  	  <param name="datasource" value="sybase15.5-xa-ds.xml" /> 
+   	  <param name="dbname" value="sybase15.5" /> 
+    </antcall>
+  </target>
 
 
   <target name="crash-tests-for-database" depends="crash-tests-for-database-cmt, crash-tests-for-database-bmt" />
@@ -416,7 +456,7 @@
       <condition property="test.name.reverseOrder" value="-reverse" else="">
         <istrue value="${reverseOrder}"/>
       </condition>
-      <property name="testname" value="${tstype}-${specs}-${test.name.cmt}${test.name.reverseOrder}"/>
+      <property name="testname" value="${tstype}-${specs}-${test.name.cmt}${test.name.reverseOrder}-${jbossts.credentials}"/>
 
       <condition property="astest.app.jar.name" value="${astest.alternative.jar.name}">
         <isset property="astest.alternative.jar.name"/>
@@ -428,9 +468,11 @@
       </condition>
       <property name="storeType" value="StateManager/BasicAction/TwoPhaseCoordinator/AtomicAction" />
      
+      <property name="recovery.datasource" value="CrashRecoveryDS" />
+  	
+      <deploy-datasource-and-set-credentials from="${product.dir}/resources/${datasource}" to="${jboss.home}/server/crashrecovery-${tstype}/deploy/${datasource}" />
       <astest:server method="start" serverName="crashrecovery-${tstype}" >
         <deploy from="dbdrivers/${dbdriver}" to="lib/${dbdriver}" />
-        <deploy from="resources/${datasource}" to="deploy/${datasource}" />
         <deploy from="${astest.jar.deploy.dir}/${astest.app.jar.name}" to="deploy/${astest.app.jar.name}" />
       </astest:server>
       <astest:action abortOnFail="false" waitFor="10000" impl="org.jboss.test.jbossts.taskdefs.JUnitClientAction">
@@ -447,24 +489,27 @@
         <param key="debug" value="true" />
         <param key="reportFile" value="${build.reports}/TEST-org.jboss.test.jbossts.ASCrashRecovery01.TestWithJPA-${dbname}-${testname}.xml" />
         <param key="testTime" value="${testTime}" />
+        <param key="recoveryDatasource" value="${recovery.datasource}" />
       </astest:action>
       <astest:server method="stop" serverName="crashrecovery-${tstype}" >
         <undeploy from="deploy/${astest.app.jar.name}" />
-        <undeploy from="deploy/${datasource}" />
-        <undeploy from="lib/${dbdriver}" />    	
+        <undeploy from="lib/${dbdriver}" />
       </astest:server>
-      
-      <!-- archive the server log -->
-      <zip destfile="${jboss.home}/server/crashrecovery-${tstype}/log/server-${dbname}-${testname}.log.zip">
-        <fileset file="${jboss.home}/server/crashrecovery-${tstype}/log/server.log"/>
-        <fileset file="${jboss.home}/server/crashrecovery-${tstype}/log/boot.log"/>
+
+      <!-- archive artifacts -->
+      <zip destfile="${jboss.home}/server/crashrecovery-${tstype}/server-${dbname}-${testname}.artifacts.zip">
+        <fileset dir="${jboss.home}/server/crashrecovery-${tstype}">
+          <include name="log/boot.log"/>
+          <include name="log/server.log"/>
+          <include name="data/tx-object-store/**"/>
+          <include name="deploy/*-ds.xml"/>
+          <exclude name="deploy/hsqldb-ds.xml"/>
+        </fileset>
       </zip>
+      <delete file="${jboss.home}/server/crashrecovery-${tstype}/deploy/${datasource}"/>
       <delete file="${jboss.home}/server/crashrecovery-${tstype}/log/server.log"/>
-      <delete file="${jboss.home}/server/crashrecovery-${tstype}/log/boot.log"/>
-      <copy todir="${jboss.home}/server/crashrecovery-${tstype}/data/tx-object-store-${dbname}-${testname}"> 
-        <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 - FIXME is this the right way how to ensure that? -->
       <delete dir="${jboss.home}/server/crashrecovery-${tstype}/work"/>
       <delete dir="${jboss.home}/server/crashrecovery-${tstype}/tmp"/>
@@ -472,13 +517,40 @@
     </sequential>
   </target>
 
-  <target name="hack-before-astest-run" depends="hack-before-astest-run-for-db2_9.7, hack-before-astest-run-for-oracle_rac, hack-before-astest-run-for-oracle_rac_r2" />
+  <macrodef name="deploy-datasource-and-set-credentials">
+    <attribute name="from"/>
+    <attribute name="to"/>
+    <sequential>
+    	
+      <condition property="recover.credentials" value="&lt;xa-datasource-property name=&quot;User&quot;&gt;crashrec&lt;/xa-datasource-property&gt;&lt;xa-datasource-property name=&quot;Password&quot;&gt;crashrec&lt;/xa-datasource-property&gt;">
+         <equals arg1="${jbossts.credentials}" arg2="cr1"/>
+      </condition>
+      <condition property="recover.credentials" value="&lt;user-name&gt;crash0&lt;/user-name&gt;&lt;password&gt;crash0&lt;/password&gt;&lt;recover-user-name&gt;crashrec&lt;/recover-user-name&gt;&lt;recover-password&gt;crashrec&lt;/recover-password&gt;">
+         <equals arg1="${jbossts.credentials}" arg2="cr2"/>
+      </condition>
+      <condition property="recover.credentials" value="&lt;security-domain&gt;CrashRecoveryDomain0&lt;/security-domain&gt;&lt;recover-user-name&gt;crashrec&lt;/recover-user-name&gt;&lt;recover-password&gt;crashrec&lt;/recover-password&gt;">
+         <equals arg1="${jbossts.credentials}" arg2="cr3"/>
+      </condition>
+      <condition property="recover.credentials" value="&lt;security-domain&gt;CrashRecoveryDomain0&lt;/security-domain&gt;&lt;recover-security-domain&gt;CrashRecoveryDomain&lt;/recover-security-domain&gt;">
+         <equals arg1="${jbossts.credentials}" arg2="cr4"/>
+      </condition>
+    	
+      <echo message="Datasource: @{to}"/>
+      <echo message="Setting DS credentials to: ${recover.credentials}"/>
+    	
+      <copy file="@{from}" tofile="@{to}">
+        <filterset>
+          <filter token="CREDENTIALS" value="${recover.credentials}"/>
+        </filterset>	
+	  </copy>
+    </sequential>
+  </macrodef>
+
+  <target name="hack-before-astest-run" depends="hack-before-astest-run-for-db2_9.7" />
   
-  <target name="hack-after-astest-run" depends="hack-after-astest-run-for-db2_9.7, hack-after-astest-run-for-oracle_rac, hack-after-astest-run-for-oracle_rac_r2" />
+  <target name="hack-after-astest-run" depends="hack-after-astest-run-for-db2_9.7" />
   
   <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" />
   	<!-- prepare hacked astest jar -->
   	<property name="astest.alternative.jar.name" value="db2-${astest.jar.name}" />
   	
@@ -507,49 +579,10 @@
   </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" />
+  	<!-- nothing to do here -->
   </target>
   
-  <target name="hack-before-astest-run-for-oracle_rac" if="want.oracle_rac">
-    <antcall target="hack-before-astest-run-for-oracle_racs"><param name="oracle_rac_second_ds" value="oracle-rac2-xa-ds.xml"/></antcall>
-  </target>
   
-  <target name="hack-after-astest-run-for-oracle_rac" if="want.oracle_rac">
-    <antcall target="hack-after-astest-run-for-oracle_racs"><param name="oracle_rac_second_ds" value="oracle-rac2-xa-ds.xml"/></antcall>
-  </target>
-
-  <target name="hack-before-astest-run-for-oracle_rac_r2" if="want.oracle_rac_r2">
-    <antcall target="hack-before-astest-run-for-oracle_racs"><param name="oracle_rac_second_ds" value="oracle-rac-r2-2-xa-ds.xml"/></antcall>
-  </target>
-  
-  <target name="hack-after-astest-run-for-oracle_rac_r2" if="want.oracle_rac_r2">
-    <antcall target="hack-after-astest-run-for-oracle_racs"><param name="oracle_rac_second_ds" value="oracle-rac-r2-2-xa-ds.xml"/></antcall>
-  </target>
-
-  <target name="hack-before-astest-run-for-oracle_racs">
-    <!-- deploy the second DS configuration  -->
-    <copy file="${product.dir}/resources/${oracle_rac_second_ds}" todir="${jboss.home}/server/crashrecovery-${tstype}/deploy" />
-
-    <!-- hack the configuration of JBossTS in order to use the second datasource for crash recovery -->
-    <replace file="${jboss.home}/server/crashrecovery-${tstype}/deploy/transaction-jboss-beans.xml">
-      <replacetoken><![CDATA[com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=CrashRecoveryDS]]></replacetoken>
-      <replacevalue><![CDATA[com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=RecoveryDS]]></replacevalue>
-    </replace>
-  </target>
-
-  <target name="hack-after-astest-run-for-oracle_racs">
-    <!-- undeploy the second DS configuration -->
-    <delete file="${jboss.home}/server/crashrecovery-${tstype}/deploy/${oracle_rac_second_ds}" />
-  	
-    <!-- unhack the configuration of JBossTS -->
-    <replace file="${jboss.home}/server/crashrecovery-${tstype}/deploy/transaction-jboss-beans.xml">
-      <replacetoken><![CDATA[com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=RecoveryDS]]></replacetoken>
-      <replacevalue><![CDATA[com.arjuna.ats.internal.jbossatx.jta.AppServerJDBCXARecovery;jndiname=CrashRecoveryDS]]></replacevalue>
-    </replace>
-  </target>
-  
-  
   <!-- 
     Do use this target if you want to wipe out txs in doubt in all databases. 
     -->
@@ -595,39 +628,55 @@
 	<!-- =====  get db drivers - borrowed from  https://svn.jboss.org/repos/labs/labs/jbosstm/trunk/qa/build.xml  ==== -->
     <!-- set these to the location(s) of the database drivers -->
 	
-	<property name="driver.url" value="http://reports.qa.atl.jboss.com/jdbc-drivers/"/>
+    <property name="driver.url" value="http://www.qa.jboss.com/jdbc-drivers-products/EAP/5.1.0"/>
     <property name="driver.name.psql_8.2" value="postgresql-8.2.jar"/>
     <property name="driver.name.psql_8.3" value="postgresql-8.3.jar"/>
-    <property name="driver.name.sybase_15" value="jconn3.jar"/>
+    <property name="driver.name.psql_8.4" value="postgresql-8.4.jar"/>
+    <property name="driver.name.psql_9.0" value="postgresql-9.0.jar"/>
+    <property name="driver.name.sybase_15" value="jconn4.jar"/>
     <property name="driver.name.oracle_10" value="ojdbc14.jar"/>
     <property name="driver.name.oracle_11" value="ojdbc6.jar"/>
+    <property name="driver.name.oracle_11_rac" value="ojdbc6_rac.jar"/>
     <property name="driver.name.db2_9.7" value="db2jcc.jar"/>
     <property name="driver.name.mysql_5.0" value="mysql-connector-java-5.0.jar"/>
     <property name="driver.name.mysql_5.1" value="mysql-connector-java-5.1.jar"/>
-    <property name="driver.name.mssql_2005" value="sqljdbc4.jar"/>
-    <property name="driver.name.mssql_2008" value="sqljdbc4.jar"/>
+    <property name="driver.name.mssql_2005" value="sqljdbc4_2005.jar"/>
+    <property name="driver.name.mssql_2008" value="sqljdbc4_2008.jar"/>
 	
     <target name="prepare-drivers">
        <available file="${driver.home}/${driver.name.psql_8.2}" property="have.dbdriver.psql_8.2" value="true"/>      
        <available file="${driver.home}/${driver.name.psql_8.3}" property="have.dbdriver.psql_8.3" value="true"/>      
+       <available file="${driver.home}/${driver.name.psql_8.4}" property="have.dbdriver.psql_8.4" value="true"/>      
+       <available file="${driver.home}/${driver.name.psql_9.0}" property="have.dbdriver.psql_9.0" value="true"/>      
        <available file="${driver.home}/${driver.name.sybase_15}" property="have.dbdriver.sybase_15" value="true"/>
        <available file="${driver.home}/${driver.name.oracle_10}" property="have.dbdriver.oracle_10" value="true"/>   	
        <available file="${driver.home}/${driver.name.oracle_11}" property="have.dbdriver.oracle_11" value="true"/>      
+       <available file="${driver.home}/${driver.name.oracle_11_rac}" property="have.dbdriver.oracle_11_rac" value="true"/>      
        <available file="${driver.home}/${driver.name.db2_9.7}" property="have.dbdriver.db2_9.7" value="true"/>      
        <available file="${driver.home}/${driver.name.mysql_5.0}" property="have.dbdriver.mysql_5.0" value="true"/>      
        <available file="${driver.home}/${driver.name.mysql_5.1}" property="have.dbdriver.mysql_5.1" value="true"/>      
        <available file="${driver.home}/${driver.name.mssql_2005}" property="have.dbdriver.mssql_2005" value="true"/>      
        <available file="${driver.home}/${driver.name.mssql_2008}" property="have.dbdriver.mssql_2008" value="true"/>
+       <condition property="want.dbdriver.sybase_15">
+          <or>
+             <istrue value="${want.sybase_15}"/>
+             <istrue value="${want.sybase_15.5}"/>
+          </or>
+       </condition>
        <condition property="want.dbdriver.oracle_11">
           <or>
              <istrue value="${want.oracle_11}"/>
              <istrue value="${want.oracle_11_r2}"/>
-             <istrue value="${want.oracle_rac}"/>
-             <istrue value="${want.oracle_rac_lb}"/>
-             <istrue value="${want.oracle_rac_r2}"/>
-             <istrue value="${want.oracle_rac_r2_lb}"/>
           </or>
        </condition>
+        <condition property="want.dbdriver.oracle_11_rac">
+           <or>
+              <istrue value="${want.oracle_rac}"/>
+              <istrue value="${want.oracle_rac_lb}"/>
+              <istrue value="${want.oracle_rac_r2}"/>
+              <istrue value="${want.oracle_rac_r2_lb}"/>
+           </or>
+        </condition>
        
        <mkdir dir="${driver.home}" />
        <antcall target="get.drivers" />
@@ -635,56 +684,69 @@
 
     <target name="get.drivers" 
     	depends="get.driver.oracle_10, 
-    	         get.driver.oracle_11,
+                 get.driver.oracle_11,
+                 get.driver.oracle_11_rac,
                  get.driver.mssql_2005,
-    	         get.driver.mssql_2008,
-    	         get.driver.psql_8.3,
-    	         get.driver.psql_8.2,
-    	         get.driver.mysql_5.1,
+                 get.driver.mssql_2008,
+                 get.driver.psql_9.0,
+                 get.driver.psql_8.4,
+                 get.driver.psql_8.3,
+                 get.driver.psql_8.2,
+                 get.driver.mysql_5.1,
                  get.driver.mysql_5.0,
-    	         get.driver.db2_9.7,
-    	         get.driver.sybase_15" />
+                 get.driver.db2_9.7,
+                 get.driver.sybase_15" />
     	
     <target name="get.driver.oracle_10" unless="have.dbdriver.oracle_10" if="want.oracle_10">
-        <get src="${driver.url}/maven2/com/oracle/ojdbc14/10.2.0.4/ojdbc14-10.2.0.4.jar"
+        <get src="${driver.url}/oracle10g/jdbc4/ojdbc14.jar"
              dest="${driver.home}/${driver.name.oracle_10}"/>
     </target>
     <target name="get.driver.oracle_11" unless="have.dbdriver.oracle_11" if="want.dbdriver.oracle_11">
-        <get src="${driver.url}/maven2/com/oracle/ojdbc6/11.2.0.1.0/ojdbc6-11.2.0.1.0.jar"
+        <get src="${driver.url}/oracle11gR1/jdbc4/ojdbc6.jar"
              dest="${driver.home}/${driver.name.oracle_11}"/>
     </target>
+    <target name="get.driver.oracle_11_rac" unless="have.dbdriver.oracle_11_rac" if="want.dbdriver.oracle_11_rac">
+        <get src="${driver.url}/oracle11gR1RAC/jdbc4/ojdbc6.jar"
+             dest="${driver.home}/${driver.name.oracle_11_rac}"/>
+    </target>
     <target name="get.driver.mssql_2005" unless="have.dbdriver.mssql_2005" if="want.mssql_2005">
-        <get src="${driver.url}/maven2/com/microsoft/sqlserver/msjdbc/2.0.1008.2/msjdbc-2.0.1008.2-4.jar"
+        <get src="${driver.url}/mssql2005/jdbc4/sqljdbc4.jar"
              dest="${driver.home}/${driver.name.mssql_2005}"/>
     </target>
     <target name="get.driver.mssql_2008" unless="have.dbdriver.mssql_2008" if="want.mssql_2008">
-        <get src="${driver.url}/maven2/com/microsoft/sqlserver/msjdbc/2.0.1008.2/msjdbc-2.0.1008.2-4.jar"
+        <get src="${driver.url}/mssql2008/jdbc4/sqljdbc4.jar"
              dest="${driver.home}/${driver.name.mssql_2008}"/>
     </target>
+    <target name="get.driver.psql_8.4" unless="have.dbdriver.psql_8.4" if="want.psql_8.4">
+        <get src="${driver.url}/postgresql84/jdbc4/postgresql-8.4-702.jdbc4.jar"
+             dest="${driver.home}/${driver.name.psql_8.4}"/>
+    </target>
+    <target name="get.driver.psql_9.0" unless="have.dbdriver.psql_9.0" if="want.psql_9.0">
+        <get src="${driver.url}/postgresql83/jdbc4/postgresql-8.3-605.jdbc4.jar"
+             dest="${driver.home}/${driver.name.psql_9.0}"/>
+    </target>
     <target name="get.driver.psql_8.3" unless="have.dbdriver.psql_8.3" if="want.psql_8.3">
-        <get src="${driver.url}/postgresql-8.3-605.jdbc4.jar"
+        <get src="${driver.url}/postgresql83/jdbc4/postgresql-8.3-605.jdbc4.jar"
              dest="${driver.home}/${driver.name.psql_8.3}"/>
     </target>
     <target name="get.driver.psql_8.2" unless="have.dbdriver.psql_8.2" if="want.psql_8.2">
-        <get src="${driver.url}/postgresql-8.2-510.jdbc4.jar"
+        <get src="${driver.url}/postgresql82/jdbc4/postgresql-8.2-510.jdbc4.jar"
              dest="${driver.home}/${driver.name.psql_8.2}"/>
     </target>
     <target name="get.driver.mysql_5.1" unless="have.dbdriver.mysql_5.1" if="want.mysql_5.1">
-        <get src="${driver.url}/maven2/mysql/mysql-connector-java/5.1.12/mysql-connector-java-5.1.12.jar"
+        <get src="${driver.url}/mysql51/jdbc4/mysql-connector-java-5.1.13-bin.jar"
              dest="${driver.home}/${driver.name.mysql_5.1}"/>
     </target>
     <target name="get.driver.mysql_5.0" unless="have.dbdriver.mysql_5.0" if="want.mysql_5.0">
-        <get src="${driver.url}/maven2/mysql/mysql-connector-java/5.0.8/mysql-connector-java-5.0.8.jar"
+        <get src="${driver.url}/mysql50/jdbc4/mysql-connector-java-5.0.8-bin.jar"
              dest="${driver.home}/${driver.name.mysql_5.0}"/>
     </target>
     <target name="get.driver.db2_9.7" unless="have.dbdriver.db2_9.7" if="want.db2_9.7">
-        <get src="${driver.url}/maven2/com/ibm/db2jcc/3.57.86/db2jcc-3.57.86.jar"
+        <get src="${driver.url}/db2-97/jdbc4/db2jcc4.jar"
              dest="${driver.home}/${driver.name.db2_9.7}"/>
-        <get src="${driver.url}/maven2/com/ibm/db2jcc_license_cu/3.57.86/db2jcc_license_cu-3.57.86.jar"
-             dest="${driver.home}/db2jcc_license_cu.jar"/>
     </target>
-    <target name="get.driver.sybase_15" unless="have.dbdriver.sybase_15" if="want.sybase_15">
-        <get src="${driver.url}/maven2/com/sybase/jconnect/6.0.5_26564/jconnect-6.0.5_26564.jar"
+    <target name="get.driver.sybase_15" unless="have.dbdriver.sybase_15" if="want.dbdriver.sybase_15">
+        <get src="${driver.url}/sybase15/jdbc4/jconn4-26502.jar"
              dest="${driver.home}/${driver.name.sybase_15}"/>
     </target>
 
@@ -805,15 +867,15 @@
     </condition>
     <property name="astest.app.jar.name" value="${astest.jar.name}" />
   	
+    <deploy-datasource-and-set-credentials from="${product.dir}/resources/${datasource}" to="${jboss.home}/server/jts-propagation-node0/deploy/${datasource}" />
     <astest:server method="start" serverName="jts-propagation-node0" >
       <deploy from="dbdrivers/${dbdriver}" to="lib/${dbdriver}" />
-      <deploy from="resources/${datasource}" to="deploy/${datasource}" />
       <deploy from="${astest.jar.deploy.dir}/${astest.app.jar.name}" to="deploy/${astest.jar.name}" />
       <deploy from="${astest.jar.deploy.dir}/${astest.ejb2.jar.name}" to="deploy/${astest.ejb2.jar.name}" />
     </astest:server>
+    <deploy-datasource-and-set-credentials from="${product.dir}/resources/${datasource}" to="${jboss.home}/server/jts-propagation-node1/deploy/${datasource}" />
     <astest:server method="start" serverName="jts-propagation-node1" >
       <deploy from="dbdrivers/${dbdriver}" to="lib/${dbdriver}" />
-      <deploy from="resources/${datasource}" to="deploy/${datasource}" />
       <deploy from="${astest.jar.deploy.dir}/${astest.app.jar.name}" to="deploy/${astest.jar.name}" />
       <deploy from="${astest.jar.deploy.dir}/${astest.ejb2.jar.name}" to="deploy/${astest.ejb2.jar.name}" />
     </astest:server>



More information about the jboss-cvs-commits mailing list