From: Francisco R. <rev...@im...> - 2005-08-29 16:11:06
|
User: reverbel Date: 05/08/29 12:10:52 Modified: jbosstest build.xml Log: XA recovery tests that start a server, crash the server in the middle of a transaction, restart the server, and check if the transaction was recovered correcly. Revision Changes Path 1.499 +204 -1 jbosstest/build.xml (In the diff below, changes in quantity of whitespace are not shown.) Index: build.xml =================================================================== RCS file: /cvsroot/jboss/jbosstest/build.xml,v retrieving revision 1.498 retrieving revision 1.499 diff -u -b -r1.498 -r1.499 --- build.xml 29 Aug 2005 15:59:28 -0000 1.498 +++ build.xml 29 Aug 2005 16:10:52 -0000 1.499 @@ -10,7 +10,7 @@ <!-- See terms of license at http://www.gnu.org. --> <!-- ============================================================ --> -<!-- $Id: build.xml,v 1.498 2005/08/29 15:59:28 rloehr Exp $ --> +<!-- $Id: build.xml,v 1.499 2005/08/29 16:10:52 reverbel Exp $ --> <project default="main" name="JBoss/Testsuite" xmlns:server="http://jboss.org/ns/test/ant/server"> @@ -138,6 +138,7 @@ <path refid="jboss.cluster.classpath"/> <path refid="jboss.common.classpath"/> <path refid="jboss.deployment.classpath"/> + <path refid="jboss.ejb3x.classpath"/> <path refid="jboss.hibernate.classpath"/> <path refid="jboss.iiop.classpath"/> <path refid="jboss.internal-server.classpath"/> @@ -222,6 +223,8 @@ <pathelement path="${local.classpath}"/> <pathelement path="${project.tools}/lib/ant.jar"/> <pathelement path="${project.tools}/lib/ant-junit.jar"/> + <path refid="jboss.ejb3.classpath"/> + <path refid="jboss.ejb3x.classpath"/> <path refid="jboss.jmx.classpath"/> <path refid="jboss.jmx-remoting.classpath"/> <path refid="thirdparty.classpath"/> @@ -907,6 +910,206 @@ <server:stop name="tomcat-sso-cluster1"/> </target> + + <!-- DTM recovery tests --> + <target name="dtm-recovery-tests" description="DTM two-phase commit tests"> + <!-- Create configs dtmrec0 and dtmrec1 with EJB3, DTM, and OTS --> + <create-ejb3-dtm-config conf="dtmrec0"/> + <copy todir="${jboss.dist}/server/dtmrec0/conf" overwrite="true" + file="${source.resources}/dtm/jacorb.properties"> + <filterset> + <filter token="HOST" value="${node0}"/> + </filterset> + </copy> + <create-ejb3-dtm-config conf="dtmrec1"/> + <copy todir="${jboss.dist}/server/dtmrec1/conf" overwrite="true" + file="${source.resources}/dtm/jacorb.properties"> + <filterset> + <filter token="HOST" value="${node1}"/> + </filterset> + </copy> + + <!-- make jndi.properties files available to clients of node0 --> + <copy todir="${build.resources}" overwrite="true"> + <fileset dir="${source.resources}/recover"> + <include name="host0.jndi.properties"/> + <include name="host0.cosnaming.jndi.properties"/> + </fileset> + <filterset> + <filter token="HOST0" value="${node0}"/> + </filterset> + </copy> + + <copy todir="${jboss.dist}/server/dtmrec0/lib" overwrite="true" + file="${build.lib}/recover-dummyrecoverableproxy.jar"/> + + <copy todir="${jboss.dist}/server/dtmrec0/deploy" overwrite="true" + file="${build.resources}/recover/dummyrecoverableproxy-service.xml"> + <filterset> + <filter token="HOST1" value="${node1}"/> + </filterset> + </copy> + + <copy todir="${jboss.dist}/server/dtmrec1/deploy" overwrite="true" + file="${build.lib}/recover-dummyrecoverable.sar"/> + + <!-- Deploy EJB that will be used across server restarts --> + <copy todir="${jboss.dist}/server/dtmrec0/deploy" overwrite="true"> + <fileset dir="${build.lib}"> + <include name="recover-stateless.ejb3"/> + </fileset> + </copy> + + <!-- Start DTM nodes --> + <server:start name="dtmrec1"/> + <server:start name="dtmrec0"/> + + <echo message="Nodes have started, waiting for node set to stablize..."/> + <sleep seconds="2" /> + + <!-- Run DTM recovery unit tests --> + <run-dtm-recovery-test test="CrashBeforeTxCommitted"/> + <run-dtm-recovery-test test="CrashAfterTxCommitted"/> + <run-dtm-recovery-test test="CrashAfterOneResourceButNotAllHavePrepared"/> + <run-dtm-recovery-test test="CrashAfterOneResourceButNotAllHaveCommitted"/> + <run-dtm-recovery-test test="CrashAfterTxCommittedWithSuccessfulXARetryAtRecoveryTime"/> + <run-dtm-recovery-test test="CrashAfterTxCommittedWithFailedXARetryAtRecoveryTime"/> + + <!-- Stop DTM nodes --> + <server:stop name="dtmrec0"/> + <server:stop name="dtmrec1"/> + </target> + + <macrodef name="run-dtm-recovery-test"> + <attribute name="test" description="the name of the test to run"/> + <sequential> + <run-dtm-test test="@{test}TestCase"/> + <echo message="Server crashed as expected. Restarting it..."/> + <server:start name="dtmrec0"/> + <echo message="Waiting for restarted server to perform transaction recovery..."/> + <sleep seconds="1" /> + <run-dtm-test test="RecoveryFrom@{test}TestCase"/> + </sequential> + </macrodef> + + <macrodef name="run-dtm-test" + description="run a dtm test given its name"> + <attribute name="test" description="the name of the test to run"/> + <sequential> + <mkdir dir="${build.reports}"/> + <mkdir dir="${build.testlog}"/> + <junit dir="${module.output}" + printsummary="${junit.printsummary}" + haltonerror="${junit.haltonerror}" + haltonfailure="${junit.haltonfailure}" + fork="${junit.fork}" + timeout="${junit.timeout}" + jvm="${junit.jvm}"> + + <jvmarg value="${junit.jvm.options}"/> + <jvmarg value="-Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB"/> + <jvmarg value="-Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton"/> + <jvmarg value="-Djacorb.orb.print_version=off"/> + <jvmarg value="-Djacorb.log.default.verbosity=0"/> + <jvmarg value="-Djacorb.interop.strict_check_on_tc_creation=off"/> + <jvmarg value="-Djacorb.log.loggerFactory=org.jboss.util.Log4jLoggerFactory"/> + <jvmarg value="-Djacorb.security.ssl.client.supported_options=0"/> + <jvmarg value="-Djacorb.security.ssl.client.required_options=0"/> + <jvmarg value="-DORBInitRef.NameService=corbaloc::${node0}:3528/NameService"/> + <jvmarg value="-Dorg.omg.PortableInterceptor.ORBInitializerClass.org.jboss.tm.iiop.TxClientInterceptorInitializer"/> + <jvmarg value="-Djava.security.manager"/> + <sysproperty key="java.security.policy" + value="${build.resources}/security/tst.policy"/> + <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/> + <sysproperty key="build.testlog" value="${build.testlog}"/> + <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/> + <!-- Pass along any jbosstest.* system properties --> + <syspropertyset> + <propertyref prefix="jbosstest."/> + </syspropertyset> + <classpath> + <pathelement location="${build.classes}"/> + <pathelement location="${build.resources}"/> + <path refid="tests.classpath"/> + <path refid="jboss.iiop.classpath"/> + </classpath> + + <formatter type="xml" usefile="${junit.formatter.usefile}"/> + + <batchtest todir="${build.reports}" + haltonerror="${junit.batchtest.haltonerror}" + haltonfailure="${junit.batchtest.haltonfailure}" + fork="${junit.batchtest.fork}"> + + <fileset dir="${build.classes}"> + <include name="**/@{test}.class"/> + </fileset> + </batchtest> + </junit> + </sequential> + </macrodef> + + <!-- DTM recovery unit tests --> + <target name="tests-dtm-recovery-unit"> + <echo><![CDATA[ + junit.timeout: ${junit.timeout} + jbosstest.iterationcount: ${jbosstest.iterationcount} + jbosstest.threadcount: ${jbosstest.threadcount} + jbosstest.beancount: ${jbosstest.beancount} + ]]></echo> + <mkdir dir="${build.reports}"/> + <mkdir dir="${build.testlog}"/> + <junit dir="${module.output}" + printsummary="${junit.printsummary}" + haltonerror="${junit.haltonerror}" + haltonfailure="${junit.haltonfailure}" + fork="${junit.fork}" + timeout="${junit.timeout}" + jvm="${junit.jvm}"> + + <jvmarg value="${junit.jvm.options}"/> + <jvmarg value="-Dorg.omg.CORBA.ORBClass=org.jacorb.orb.ORB"/> + <jvmarg value="-Dorg.omg.CORBA.ORBSingletonClass=org.jacorb.orb.ORBSingleton"/> + <jvmarg value="-Djacorb.orb.print_version=off"/> + <jvmarg value="-Djacorb.log.default.verbosity=0"/> + <jvmarg value="-Djacorb.interop.strict_check_on_tc_creation=off"/> + <jvmarg value="-Djacorb.log.loggerFactory=org.jboss.util.Log4jLoggerFactory"/> + <jvmarg value="-Djacorb.security.ssl.client.supported_options=0"/> + <jvmarg value="-Djacorb.security.ssl.client.required_options=0"/> + <jvmarg value="-DORBInitRef.NameService=corbaloc::${node0}:3528/NameService"/> + <jvmarg value="-Dorg.omg.PortableInterceptor.ORBInitializerClass.org.jboss.tm.iiop.TxClientInterceptorInitializer"/> + <jvmarg value="-Djava.security.manager"/> + <sysproperty key="java.security.policy" + value="${build.resources}/security/tst.policy"/> + <sysproperty key="jbosstest.deploy.dir" file="${build.lib}"/> + <sysproperty key="build.testlog" value="${build.testlog}"/> + <sysproperty key="log4j.configuration" value="file:${build.resources}/log4j.xml"/> + <!-- Pass along any jbosstest.* system properties --> + <syspropertyset> + <propertyref prefix="jbosstest."/> + </syspropertyset> + <classpath> + <pathelement location="${build.classes}"/> + <pathelement location="${build.resources}"/> + <path refid="tests.classpath"/> + <path refid="jboss.iiop.classpath"/> + </classpath> + + <formatter type="xml" usefile="${junit.formatter.usefile}"/> + + <batchtest todir="${build.reports}" + haltonerror="${junit.batchtest.haltonerror}" + haltonfailure="${junit.batchtest.haltonfailure}" + fork="${junit.batchtest.fork}"> + + <fileset dir="${build.classes}"> + <include name="**/StatelessEJB3TestCase.class"/> + </fileset> + </batchtest> + </junit> + </target> + + <!-- DTM two-phase commit tests --> <target name="dtm-tests" description="DTM two-phase commit tests"> <!-- Create configs dtm0-dtm3 with DTM and OTS --> |