Version 14

    How to run the JBossJTS regression tests


    First of all, you need to get and build JBoss Application Server 5.0:

       cvs co jboss-head
       cd jboss-head/build                                            
       ./ -Dmodules=testsuite


    Then you can run the following tests:

    1. Stand-alone XA recoverability tests

    2. Distributed transaction tests

    3. Crash recovery tests


    Stand-alone XA recoverability tests


    To run the stand-alone XA recoverability tests:

       cd jboss-head/testsuite
       ./ -Dtest=org.jboss.test.recover.test.RecoverabilityTestCase one-test


    Non-stand-alone tests


    All the remaining tests are non-stand-alone tests that bring four JBoss server instances up, in order to test transactions distributed across multiple servers. Those tests must be run on a machine with four IP addresses.


    To run the non-stand-alone tests, you need to edit the file testsuite/ so that the properties , , , and  specify the four IP addresses of your machine. If you have access to the JBoss QA Lab and want to run the tests on some of its Linux boxes, then all you need is to uncomment the following definitions:


    (The Linux boxes of the JBoss QA Lab give each user four IP addresses specified by the environment variables MYTESTIP_1, ..., MYTESTIP_4.)


    Distributed transaction tests


    At this point you are ready to run the distributed transaction tests that do not test crash recovery:

       cd jboss-head/testsuite
       ./ dtm-tests

    The two DTM tests that need a XA resource manager are commented out in testsuite/build.xml because they use the Derby database engine, which is not included in JBoss. To run also those tests, you must put derby.jar in the lib directory in the default JBoss config (server/default/lib) and uncomment the following include elements in testsuite/build.xml:

       <include name="**/T09DTMXAUnitTestCase.class"></include>
       <include name="**/T10OTSXAUnitTestCase.class"></include>


    Crash recovery tests


    To run the crash recovery tests, edit the file conf/jboss-service.xml in the default JBoss config and uncomment the three transaction recovery MBeans: , , and . Also change the  MBean and uncomment the  element that specifies a dependency upon the  MBean. Some of the tests require a special failure-injecting logger, so you will also need change the element

       <mbean code=""


       <mbean code="org.jboss.test.recover.bean.MockLoggerService" 


    Moreover, there are tests that require the  and  attributes of the  MBean to be respectively set to 5 seconds and 1 second, so you will need to change the elements

          <attribute name="XARetryTimeout">60</attribute>
          <attribute name="PreparedTimeout">60</attribute>


          <attribute name="XARetryTimeout">5</attribute>
          <attribute name="PreparedTimeout">1</attribute>


    At this point you are ready to run the crash recovery tests:

       cd jboss-head/testsuite
       ./ xa-recovery-tests
       ./ dtm-recovery-tests
       ./ ots-recovery-tests
       ./ mixed-dtm-ots-recovery-tests
       ./ mixed-ots-dtm-recovery-tests

    Alternatively, you can run all the tests above with

       cd jboss-head/testsuite
       ./ all-xa-dtm-ots-recovery-tests

    The crash recovery tests use four JBoss server instances named "root-coordinator", "subordinate-coordinator-1", "subordinate-coordinator-2, and "xa-resource-manager". Each test consists of a pair of testcases, with names like  and . A  testcase forces a crash of some of the three coordinator servers at some specific point of a transaction run. The corresponding  testcase restarts the crashed server and checks if the recovery procedure brought the system to the expected state.


    Running a single crash recovery test


    To run a single crash recovery test, you need to manually start four JBoss server instances. Run each command below in its own window:

    cd $JBOSS_HOME/bin; ./ -c xa-resource-manager -b your_node1
    cd $JBOSS_HOME/bin; ./ -c subordinate-coordinator-1 -b your_node2
    cd $JBOSS_HOME/bin; ./ -c subordinate-coordinator-2 -b your_node3
    cd $JBOSS_HOME/bin; ./ -c root-coordinator -b your_node0

    You can now run a single test (e.g., ), starting with the part of the test that crashes a server (a  testcase):

    cd jboss-head/testsuite
    ./ -Dtest=org.jboss.test.recover.test.CrashAfterDistributedTxCommittedIIOPTestCase one-iiop-test

    One of the JBoss server instances will crash. (This particular testcase crashes the root-coordinator instance.) After restarting the crashed server, run the corresponding  testcase:

    ./ \
        -Dtest=org.jboss.test.recover.test.RecoveryFromCrashAfterDistributedTxCommittedIIOPTestCase \ 





    1. svn co
    2. cd trunk
    3. ./ install -Dskip-download-sources -U -B
    4. cd testsuite
    5. # modify the file src/resources/crashrecovery/resources/postgres83-xa-ds.xml to point to your DB
    6. ./
    7. ./ tests-ts-crash-recovery -Dcrash.db=psql_8.3 -Dcrash.tstype=jta
    8. ./ tests-ts-crash-recovery -Dcrash.db=psql_8.3 -Dcrash.tstype=jts





    1. svn co
    2. cd trunk
    3. ./ install -Dskip-download-sources -U -B
    4. cd testsuite
    5. # modify the file src/resources/jbossts/resources/postgres83-xa-ds.xml to point to your DB
    6. ./
    7. ./ tests-ts-crash-recovery -Djbossts.db=psql_8.3 -Djbossts.tstype=jta
    8. ./ tests-ts-crash-recovery -Djbossts.db=psql_8.3