[jboss-cvs] JBossAS SVN: r104297 - in branches/JBPAPP_5_1/testsuite/src: resources/crashrecovery/resources and 1 other directories.
jboss-cvs-commits at lists.jboss.org
jboss-cvs-commits at lists.jboss.org
Wed Apr 28 15:37:05 EDT 2010
Author: smarlow at redhat.com
Date: 2010-04-28 15:37:04 -0400 (Wed, 28 Apr 2010)
New Revision: 104297
Added:
branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/resources/postgres84-xa-ds.xml
branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/resources/postgres90-xa-ds.xml
Modified:
branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/crashrecovery/ASCrashRecovery01/TestWithJPA.java
branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/scripts/as-tests.xml
Log:
JBPAPP-3638 XA resource recovery. Postgress 8.4, 9.0 partial support. Added a few prints to the unit test to show more of what is going on.
Modified: branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/crashrecovery/ASCrashRecovery01/TestWithJPA.java
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/crashrecovery/ASCrashRecovery01/TestWithJPA.java 2010-04-28 17:05:00 UTC (rev 104296)
+++ branches/JBPAPP_5_1/testsuite/src/main/org/jboss/test/crashrecovery/ASCrashRecovery01/TestWithJPA.java 2010-04-28 19:37:04 UTC (rev 104297)
@@ -137,7 +137,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)
@@ -445,16 +445,21 @@
}
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;
@@ -466,6 +471,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
try
{
Added: branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/resources/postgres84-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/resources/postgres84-xa-ds.xml (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/resources/postgres84-xa-ds.xml 2010-04-28 19:37:04 UTC (rev 104297)
@@ -0,0 +1,23 @@
+<?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>
+ <xa-datasource-property name="User">crashrec</xa-datasource-property>
+ <xa-datasource-property name="Password">crashrec</xa-datasource-property>
+-->
+
+
+ <xa-datasource-property name="ServerName">localhost</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">jboss</xa-datasource-property>
+ <xa-datasource-property name="Password">jboss</xa-datasource-property>
+ </xa-datasource>
+</datasources>
Added: branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/resources/postgres90-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/resources/postgres90-xa-ds.xml (rev 0)
+++ branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/resources/postgres90-xa-ds.xml 2010-04-28 19:37:04 UTC (rev 104297)
@@ -0,0 +1,13 @@
+<?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">localhost</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">jboss</xa-datasource-property>
+ <xa-datasource-property name="Password">jboss</xa-datasource-property>
+ </xa-datasource>
+</datasources>
Modified: branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/scripts/as-tests.xml
===================================================================
--- branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/scripts/as-tests.xml 2010-04-28 17:05:00 UTC (rev 104296)
+++ branches/JBPAPP_5_1/testsuite/src/resources/crashrecovery/scripts/as-tests.xml 2010-04-28 19:37:04 UTC (rev 104297)
@@ -65,6 +65,12 @@
<condition property="want.psql_8.3">
<equals arg1="${crash.db}" arg2="psql_8.3"/>
</condition>
+ <condition property="want.psql_8.4">
+ <equals arg1="${crash.db}" arg2="psql_8.4"/>
+ </condition>
+ <condition property="want.psql_9.0">
+ <equals arg1="${crash.db}" arg2="psql_9.0"/>
+ </condition>
<condition property="want.sybase_15">
<equals arg1="${crash.db}" arg2="sybase_15"/>
</condition>
@@ -109,6 +115,8 @@
<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.oracle_10" value="true" />
<property name="want.oracle_11" value="true" />
@@ -199,6 +207,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"/>
@@ -230,6 +240,22 @@
</antcall>
</target>
+ <target name="call-tests-for-psql_8.4" if="want.psql_8.4">
+ <antcall target="${call.target}">
+ <param name="dbdriver" value="postgresql-8.3.jar"/>
+ <param name="datasource" value="postgres83-xa-ds.xml" />
+ <param name="dbname" value="psql83" />
+ </antcall>
+ </target>
+
+ <target name="call-tests-for-psql_9.0" if="want.psql_9.0">
+ <antcall target="${call.target}">
+ <param name="dbdriver" value="postgresql-9.0.jar"/>
+ <param name="datasource" value="postgres83-xa-ds.xml" />
+ <param name="dbname" value="psql83" />
+ </antcall>
+ </target>
+
<target name="call-tests-for-oracle_10" if="want.oracle_10">
<antcall target="${call.target}">
<param name="dbdriver" value="ojdbc14.jar"/>
@@ -628,6 +654,11 @@
dest="${driver.home}/sqljdbc4.jar"/>
<get src="${driver.url}/postgresql-8.3-605.jdbc4.jar"
+ dest="${driver.home}/postgresql-8.4.jar"/>
+ <get src="${driver.url}/postgresql-8.3-605.jdbc4.jar"
+ dest="${driver.home}/postgresql-9.0.jar"/>
+
+ <get src="${driver.url}/postgresql-8.3-605.jdbc4.jar"
dest="${driver.home}/postgresql-8.3.jar"/>
<get src="${driver.url}/postgresql-8.2-510.jdbc4.jar"
dest="${driver.home}/postgresql-8.2.jar"/>
More information about the jboss-cvs-commits
mailing list