[jboss-cvs] JBossAS SVN: r92004 - in branches/JBPAPP_5_0/testsuite: src/resources/crashrecovery/resources and 1 other directories.

jboss-cvs-commits at lists.jboss.org jboss-cvs-commits at lists.jboss.org
Wed Aug 5 04:55:55 EDT 2009


Author: istudens at redhat.com
Date: 2009-08-05 04:55:54 -0400 (Wed, 05 Aug 2009)
New Revision: 92004

Modified:
   branches/JBPAPP_5_0/testsuite/imports/config/tests-crash-recovery.xml
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_97-xa-ds.xml
   branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/scripts/as-tests.xml
Log:
fixed the XAER_OUTSIDE exception issue with DB2 v9, JBPAPP-2372

Modified: branches/JBPAPP_5_0/testsuite/imports/config/tests-crash-recovery.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/imports/config/tests-crash-recovery.xml	2009-08-05 08:27:24 UTC (rev 92003)
+++ branches/JBPAPP_5_0/testsuite/imports/config/tests-crash-recovery.xml	2009-08-05 08:55:54 UTC (rev 92004)
@@ -27,6 +27,8 @@
     |     
     |  or for a selective test scenario:
     |    ./build.sh tests-ts-crash-recovery -Dcrash.db=psql_8.3 -Dcrash.tstype=jts -Dcrash.tsdemarc=bmt -Dcrash.testcase=none.rev -Dcrash.target=crash-tests-single
+    |
+    | Note: If you want to force the wiping out any txs in doubt from DB before the test run you can use the property -DwipeOutTxsInDoubt=true. 
     -->
    <target name="tests-ts-crash-recovery"
    	     description="Runs JBossTS crash recovery tests">

Modified: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_97-xa-ds.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_97-xa-ds.xml	2009-08-05 08:27:24 UTC (rev 92003)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/resources/db2_97-xa-ds.xml	2009-08-05 08:55:54 UTC (rev 92004)
@@ -24,9 +24,10 @@
 		<xa-datasource-property name="DriverType">4</xa-datasource-property>
         
 	    <!-- If driverType 4 is used, the following two tags are needed -->     
-    	<!--track-connection-by-tx></track-connection-by-tx-->
+    	<track-connection-by-tx></track-connection-by-tx>
         <!-- Must be set if using multiple DB2 XA resources in same transaction -->
         <isSameRM-override-value>false</isSameRM-override-value>
+        <no-tx-separate-pools></no-tx-separate-pools>
             
         <!-- uncomment to enable interleaving <interleaving/> -->
         

Modified: branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/scripts/as-tests.xml
===================================================================
--- branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/scripts/as-tests.xml	2009-08-05 08:27:24 UTC (rev 92003)
+++ branches/JBPAPP_5_0/testsuite/src/resources/crashrecovery/scripts/as-tests.xml	2009-08-05 08:55:54 UTC (rev 92004)
@@ -371,11 +371,12 @@
         </antcall>
   </target>
 
-
+  <target name="execute-crash-recovery-test" depends="hack-before-astest-run, crash-recovery-test, hack-after-astest-run" />
+  
   <!--
     Note: If you want to wipe out txs in doubt before and after test you have to set property 'wipeOutTxsInDoubt' to true.
     -->
-  <target name="execute-crash-recovery-test">
+  <target name="crash-recovery-test">
 <!--    <attribute name="specs"/>
     <attribute name="datasource"/>
     <attribute name="dbdriver"/>
@@ -393,12 +394,16 @@
         <istrue value="${reverseOrder}"/>
       </condition>
       <property name="testname" value="${tstype}-${specs}-${test.name.cmt}${test.name.reverseOrder}"/>
-    	
-      <antcall target="hack-before-astest-run" />
+
+      <condition property="astest.app.jar.name" value="${astest.alternative.jar.name}">
+        <isset property="astest.alternative.jar.name"/>
+      </condition>
+      <property name="astest.app.jar.name" value="${astest.jar.name}" />
+
       <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.jar.name}" to="deploy/${astest.jar.name}" />
+        <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.crashrecovery.taskdefs.JUnitClientAction">
         <param key="testClass" value="org.jboss.test.crashrecovery.ASCrashRecovery01.TestWithJPA" />
@@ -411,10 +416,10 @@
         <param key="wipeOutTxsInDoubtBeforeTest" value="${wipeOutTxsInDoubtBeforeTest}" />
         <param key="wipeOutTxsInDoubt" value="${wipeOutTxsInDoubt}" />
         <param key="debug" value="true" />
-        <param key="reportFile" value="${build.reports}/TEST-org.jboss.test.crashrecovery.ASCrashRecovery01.JUnitTestWithJPA-${dbname}-${testname}.xml" />
+        <param key="reportFile" value="${build.reports}/TEST-org.jboss.test.crashrecovery.ASCrashRecovery01.TestWithJPA-${dbname}-${testname}.xml" />
       </astest:action>
       <astest:server method="stop" serverName="crashrecovery-${tstype}" >
-        <undeploy from="deploy/${astest.jar.name}" />
+        <undeploy from="deploy/${astest.app.jar.name}" />
         <undeploy from="deploy/${datasource}" />
         <undeploy from="lib/${dbdriver}" />    	
       </astest:server>
@@ -428,54 +433,56 @@
         <fileset dir="${jboss.home}/server/crashrecovery-${tstype}/data/tx-object-store" />
       </copy>
       <delete dir="${jboss.home}/server/crashrecovery-${tstype}/data/tx-object-store"/>
-      <!-- delete work and tmp dirs otherwise tests failed due to permgen space -->
+      <!-- delete 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"/>
       
-      <antcall target="hack-after-astest-run" />
     </sequential>
   </target>
 
-  <target name="hack-before-astest-run">
-  	<antcall target="hack-before-astest-run-for-oracle_10"/>
-  	<antcall target="hack-before-astest-run-for-oracle_11"/>
-  	<antcall target="hack-before-astest-run-for-db2_9.7"/>
-  </target>
+  <target name="hack-before-astest-run" depends="hack-before-astest-run-for-db2_9.7" />
   
-  <target name="hack-after-astest-run">
-  	<antcall target="hack-after-astest-run-for-oracle_10"/>
-  	<antcall target="hack-after-astest-run-for-oracle_11"/>
-  	<antcall target="hack-after-astest-run-for-db2_9.7"/>
-  </target>
+  <target name="hack-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}" />
+  	
+  	<available file="${astest.jar.dir}/${astest.alternative.jar.name}" 
+  	    property="have.db2.astest.alternative.jar" />
+    <antcall target="prepare-db2-alternative-jar" />
+  	    
   </target>
   
-  <target name="hack-after-astest-run-for-db2_9.7" if="want.db2_9.7">
-  	<!-- undeploy license .jar file  -->
-  	<delete file="${jboss.home}/server/crashrecovery-${tstype}/lib/db2jcc_license_cu.jar" />
+  <target name="prepare-db2-alternative-jar" unless="have.db2.astest.alternative.jar">
+  	<mkdir dir="${astest.jar.dir}/${astest.alternative.jar.name}_content"/>
+  	<unjar src="${astest.jar.dir}/${astest.jar.name}" dest="${astest.jar.dir}/${astest.alternative.jar.name}_content" />
+  	<available file="${astest.jar.dir}/${astest.alternative.jar.name}_content/META-INF/persistence.xml" 
+  	    property="have.persistence.xml" />
+  	<antcall target="change-hbm2ddl-update-to-none" />
+  	<jar destfile="${astest.jar.dir}/${astest.alternative.jar.name}">
+        <fileset dir="${astest.jar.dir}/${astest.alternative.jar.name}_content"/>
+  	</jar>
+  	<delete dir="${astest.jar.dir}/${astest.alternative.jar.name}_content" />
   </target>
   
-  <target name="hack-before-astest-run-for-oracle_10" if="want.oracle_10">
-  	<!-- TODO setting pad to true -->
+  <target name="change-hbm2ddl-update-to-none" if="have.persistence.xml">
+  	<replace file="${astest.jar.dir}/${astest.alternative.jar.name}_content/META-INF/persistence.xml" summary="true">
+  		<replacetoken><![CDATA[name="hibernate.hbm2ddl.auto" value="update"]]></replacetoken>
+  		<replacevalue><![CDATA[name="hibernate.hbm2ddl.auto" value="none"  ]]></replacevalue> 
+  	</replace>
   </target>
   
-  <target name="hack-after-astest-run-for-oracle_10" if="want.oracle_10">
-  	<!-- TODO  -->
+  <target name="hack-after-astest-run-for-db2_9.7" if="want.db2_9.7">
+  	<!-- undeploy license .jar file  -->
+  	<delete file="${jboss.home}/server/crashrecovery-${tstype}/lib/db2jcc_license_cu.jar" />
   </target>
   
-  <target name="hack-before-astest-run-for-oracle_11" if="want.oracle_11">
-  	<!-- TODO setting pad to true -->
-  </target>
   
-  <target name="hack-after-astest-run-for-oracle_11" if="want.oracle_11">
-  	<!-- TODO  -->
-  </target>
   
-  
-  
   <!-- 
     Do use this target if you want to wipe out txs in doubt in all databases. 
     -->




More information about the jboss-cvs-commits mailing list