[jboss-svn-commits] JBL Code SVN: r20206 - in labs/jbosstm/trunk/XTS/WSTX: tests/classes/com/arjuna and 9 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu May 29 04:49:48 EDT 2008


Author: adinn
Date: 2008-05-29 04:49:48 -0400 (Thu, 29 May 2008)
New Revision: 20206

Added:
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/WSTX11TestSuite.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Cancel.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Close.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Compensate.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/ConfirmWithComplete.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Exit.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiCancel.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiClose.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiCompensate.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/CommitExceptionInPrepare.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/CommitRollbackInPrepare.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/MultiParticipants.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NestedTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NullCommitTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NullRollbackTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/ResumeNullTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/RollbackExceptionInRollback.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SingleParticipant.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendCommitTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendNullTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeCommitTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeParticipants.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeSingleParticipant.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/ThreadedTransaction.java
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wstx11/
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wstx11/tests/
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wstx11/tests/TestInitialisation.java
   labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx11-tests_web-app.xml
Modified:
   labs/jbosstm/trunk/XTS/WSTX/build.xml
   labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java
   labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx-tests_application.xml
Log:
added unit tests for 1.1 WSTX code

Modified: labs/jbosstm/trunk/XTS/WSTX/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/build.xml	2008-05-29 08:45:01 UTC (rev 20205)
+++ labs/jbosstm/trunk/XTS/WSTX/build.xml	2008-05-29 08:49:48 UTC (rev 20206)
@@ -80,19 +80,25 @@
     <property name="wsc.libs" value="ws-c.jar"/>
     <property name="wsc10.libs" value="ws-c10.jar"/>
     <property name="wsc11.libs" value="ws-c11.jar"/>
+    <property name="wsc.all.libs" value="${wsc.libs} ${wsc10.libs} ${wsc11.libs}"/>
     <property name="wscf.libs" value="wscf.jar"/>
     <property name="wscf10.libs" value="wscf10.jar"/>
     <property name="wscf11.libs" value="wscf11.jar"/>
+    <property name="wscf.all.libs" value="${wscf.libs} ${wscf10.libs} ${wscf11.libs}"/>
     <property name="wst.libs" value="ws-t.jar"/>
     <property name="wst10.libs" value="ws-t10.jar"/>
     <property name="wst11.libs" value="ws-t11.jar"/>
+    <property name="wst.all.libs" value="${wst.libs} ${wst10.libs} ${wst11.libs}"/>
     <property name="wstx.libs" value="${com.arjuna.mwlabs.ts.modulename}.jar"/>
+    <property name="wstx10.libs" value="${com.arjuna.mwlabs.ts.modulename}10.jar"/>
+    <property name="wstx11.libs" value="${com.arjuna.mwlabs.ts.modulename}11.jar"/>
+    <property name="wstx.all.libs" value="${wstx.libs} ${wstx10.libs} ${wstx11.libs}"/>
 
+    <!--
     <property name="tests.libs" value="junit.jar"/>
-    <!-- can we not just get away with wstx and junit?
-    <property name="tests.all.libs" value="${wsas.libs} ${wsc.libs} ${wscf.libs} ${wst.libs} ${wstx.libs} ${tests.libs} "/>
     -->
-    <property name="tests.all.libs" value="${wsas.libs} ${wsc.libs} ${wscf.libs} ${wst.libs} ${wstx.libs} ${tests.libs} "/>
+    <property name="tests.libs" value="junit.jar"/>
+    <property name="tests.all.libs" value="${wsas.libs} ${wsc.all.libs} ${wscf.all.libs} ${wst.all.libs} ${wstx.all.libs} ${tests.libs}"/>
 
     <path id="com.arjuna.mwlabs.wstx.tests.lib.path">
         <fileset dir="${com.arjuna.xts.ext}" includes="${tests.libs}"/>
@@ -336,8 +342,10 @@
 	    <classpath>
             <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"/>
             <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}10.jar"/>
+            <pathelement path="${com.arjuna.mwlabs.wstx.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11.jar"/>
             <path refid="com.arjuna.mwlabs.wstx.tests.lib.path"/>
             <path refid="com.arjuna.mwlabs.wstx.lib.classpath10"/>
+            <path refid="com.arjuna.mwlabs.wstx.lib.classpath11"/>
             <path refid="com.arjuna.mwlabs.wstx.lib.classpath"/>
 	    </classpath>
 	    <src path="${com.arjuna.mwlabs.wstx.tests.src}"/>
@@ -351,12 +359,29 @@
 	      <filter token="port" value="${port}"/>
 	    </filterset>
 	  </copy>
-	  <war warfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.war" webxml="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app.xml">
+	  <copy file="${com.arjuna.mwlabs.wstx.tests.dd}/wstx11-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app11.xml">
+	    <filterset>
+	      <filter token="hostname" value="${hostname}"/>
+	      <filter token="port" value="${port}"/>
+	    </filterset>
+	  </copy>
+	  <jar jarfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.jar">
 	    <manifest>
 	      <attribute name="Class-Path" value="${tests.all.libs}"/>
 	    </manifest>
+	    <fileset dir="${com.arjuna.mwlabs.wstx.tests.dest}"/>
+	  </jar>
+	  <war warfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.war" webxml="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app.xml">
+	    <manifest>
+	      <attribute name="Class-Path" value="wstx-tests.jar"/>
+	    </manifest>
 	    <classes dir="${com.arjuna.mwlabs.wstx.tests.dest}"/>
 	  </war>
+	  <war warfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx11-tests.war" webxml="${com.arjuna.mwlabs.wstx.tests.dd.dest}/web-app11.xml">
+	    <manifest>
+	      <attribute name="Class-Path" value="wstx-tests.jar"/>
+	    </manifest>
+	  </war>
 	  <ear earfile="${com.arjuna.mwlabs.wstx.tests.webapps.dest}/wstx-tests.ear" appxml="${com.arjuna.mwlabs.wstx.tests.dd}/wstx-tests_application.xml">
         <!--
 	    <fileset dir="${com.arjuna.jta.install.ext}" includes="${jta.ext.jars}"/>
@@ -375,7 +400,7 @@
 	    <fileset dir="${com.arjuna.mwlabs.wst.jar.dest}" includes="${wst.libs}"/>
 	    <fileset dir="${com.arjuna.mwlabs.wstx.jar.dest}" includes="${wstx.libs}"/>
 	    -->
-	    <fileset dir="${com.arjuna.mwlabs.wstx.tests.webapps.dest}" includes="wstx-tests.war"/>
+	    <fileset dir="${com.arjuna.mwlabs.wstx.tests.webapps.dest}" includes="wstx-tests.war wstx11-tests.war wstx-tests.jar"/>
 	  </ear>
 	</target>
 

Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java	2008-05-29 08:45:01 UTC (rev 20205)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -39,7 +39,6 @@
         addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.NullRollbackTransaction.class));
         addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.PrintTransaction.class));
         addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.ResumeNullTransaction.class));
-        // this test fails because the rollback is tried forever instead of an exception being generated
         addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.RollbackExceptionInRollback.class));
         addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SingleParticipant.class));
         addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SuspendCommitTransaction.class));

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/WSTX11TestSuite.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/WSTX11TestSuite.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/WSTX11TestSuite.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,75 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2008,
+ * @author JBoss Inc.
+ */
+/*
+ * TestSuite.java
+ */
+
+package com.arjuna.wst11.tests;
+
+public class WSTX11TestSuite extends junit.framework.TestSuite
+{
+    public WSTX11TestSuite()
+    {
+        // wst basic tests
+        // this test fails because the commit is retried forever instead of an exception being generated
+        //addTest(new junit.framework.TestSuite(CommitExceptionInCommit.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.CommitExceptionInPrepare.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.CommitRollbackInPrepare.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.MultiParticipants.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.NestedTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.NullCommitTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.NullRollbackTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.PrintTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.ResumeNullTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.RollbackExceptionInRollback.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SingleParticipant.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SuspendCommitTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SuspendNullTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SuspendResumeCommitTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SuspendResumeParticipants.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SuspendResumeSingleParticipant.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SuspendTransaction.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.ThreadedTransaction.class));
+
+        // wst BA tests
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.Cancel.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.Close.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.Compensate.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.ConfirmWithComplete.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.Exit.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.MultiCancel.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.MultiClose.class));
+        // this test fails because the compensate is retried forever instead of an exception being generated
+        //addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.MultiCompensate.class));
+
+        // wstx basic tests
+        // these don't run at present because the WSCF protocol manager code cannot process the xml
+        // in UserTwoPhaseTx.xml and TwoPhaseTxManager.xml and wstx.UserTransactionFactory tries to
+        // use these documents to identify the transaction protocol it is meant to support
+        //addTest(new junit.framework.TestSuite(com.arjuna.wstx.tests.junit.basic.NullCommitTransaction.class));
+        //addTest(new junit.framework.TestSuite(com.arjuna.wstx.tests.junit.basic.NullNestedCommit.class));
+        //addTest(new junit.framework.TestSuite(com.arjuna.wstx.tests.junit.basic.NullNestedRollback.class));
+        //addTest(new junit.framework.TestSuite(com.arjuna.wstx.tests.junit.basic.NullRollbackOnly.class));
+        //addTest(new junit.framework.TestSuite(com.arjuna.wstx.tests.junit.basic.NullRollbackTransaction.class));
+        //addTest(new junit.framework.TestSuite(com.arjuna.wstx.tests.junit.basic.SingleParticipant.class));
+        //addTest(new junit.framework.TestSuite(com.arjuna.wstx.tests.junit.basic.SynchronizationParticipant.class));
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Cancel.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/ba/Cancel.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Cancel.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Cancel.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Cancel.java,v 1.3.8.1 2005/11/22 10:36:18 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.ba;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.DemoBusinessParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Cancel.java,v 1.3.8.1 2005/11/22 10:36:18 kconner Exp $
+ * @since 1.0.
+ */
+
+public class Cancel extends TestCase
+{
+    public static void testCancel()
+            throws Exception
+    {
+        UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
+        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
+	    String participantId = "1234";
+	    DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CANCEL, participantId);
+        try {
+
+	    uba.begin();
+
+	    bam.enlistForBusinessAgreementWithParticipantCompletion(p, participantId);
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+	    uba.cancel();
+
+	    assertTrue(p.passed());
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Close.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/ba/Close.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Close.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Close.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,71 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Close.java,v 1.3.8.1 2005/11/22 10:36:17 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.ba;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.DemoBusinessParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Close.java,v 1.3.8.1 2005/11/22 10:36:17 kconner Exp $
+ * @since 1.0.
+ */
+
+public class Close extends TestCase
+{
+    public static void testClose()
+            throws Exception
+    {
+	    UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
+        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
+	    com.arjuna.wst11.BAParticipantManager bpm = null;
+        DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CLOSE, "1235");
+	    try {
+	    uba.begin();
+
+	    bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, p.identifier());
+        bpm.completed();
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+
+	    uba.close();
+
+	    assertTrue(p.passed());
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Compensate.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/ba/Compensate.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Compensate.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Compensate.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Compensate.java,v 1.3.8.1 2005/11/22 10:36:17 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.ba;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.DemoBusinessParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Compensate.java,v 1.3.8.1 2005/11/22 10:36:17 kconner Exp $
+ * @since 1.0.
+ */
+
+public class Compensate extends TestCase
+{
+    public static void testCompensate()
+            throws Exception
+    {
+	    UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
+        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
+	    com.arjuna.wst11.BAParticipantManager bpm = null;
+	    String participantId = "1236";
+	    DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.COMPENSATE, participantId);
+	    try {
+	    uba.begin();
+
+	    bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, participantId);
+
+	    bpm.completed();
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+
+	    uba.cancel();
+
+        assertTrue(p.passed());
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/ConfirmWithComplete.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/ba/ConfirmWithComplete.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/ConfirmWithComplete.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/ConfirmWithComplete.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ConfirmWithComplete.java,v 1.3.8.1 2005/11/22 10:36:17 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.ba;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.DemoBusinessParticipantWithComplete;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: ConfirmWithComplete.java,v 1.3.8.1 2005/11/22 10:36:17 kconner Exp $
+ * @since 1.0.
+ */
+
+public class ConfirmWithComplete extends TestCase
+{
+
+    public static void testConfirmWithComplete()
+            throws Exception
+    {
+	    UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
+        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
+	    DemoBusinessParticipantWithComplete p = new DemoBusinessParticipantWithComplete(DemoBusinessParticipantWithComplete.COMPLETE, "1234");
+	    try {
+	    uba.begin();
+
+	    bam.enlistForBusinessAgreementWithCoordinatorCompletion(p, "1237");
+
+	    uba.complete();
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+
+	    uba.cancel();
+
+	    assertTrue(p.passed());
+	}
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Exit.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/ba/Exit.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Exit.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/Exit.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,72 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: Exit.java,v 1.3.8.1 2005/11/22 10:36:17 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.ba;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.DemoBusinessParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Exit.java,v 1.3.8.1 2005/11/22 10:36:17 kconner Exp $
+ * @since 1.0.
+ */
+
+public class Exit extends TestCase
+{
+    public static void testExit()
+            throws Exception
+    {
+	    UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
+        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
+	    com.arjuna.wst11.BAParticipantManager bpm = null;
+	    DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.EXIT, "1238");
+	    try {
+	    uba.begin();
+
+	    bpm = bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1238");
+
+	    bpm.exit();
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+
+	    uba.close();
+
+	    assertTrue(p.passed());
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiCancel.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/ba/MultiCancel.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiCancel.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiCancel.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,82 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: MultiCancel.java,v 1.3.8.1 2005/11/22 10:36:18 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.ba;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.DemoBusinessParticipant;
+import com.arjuna.wst.tests.FailureBusinessParticipant;
+import com.arjuna.wst.SystemException;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: MultiCancel.java,v 1.3.8.1 2005/11/22 10:36:18 kconner Exp $
+ * @since 1.0.
+ */
+
+public class MultiCancel extends TestCase
+{
+    public static void testMultiCancel()
+            throws Exception
+    {
+	    UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
+        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
+	    DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CANCEL, "1239");
+	    FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_CANCEL, "5678");
+	    try {
+	    uba.begin();
+
+	    bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1239");
+	    bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5678");
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+	    try {
+	    uba.cancel();
+        } catch (SystemException ex) {
+            // failure will result in heuristic hazard warning message but wil not throw an exception
+            throw ex;
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+        assertTrue(p.passed());
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiClose.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/ba/MultiClose.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiClose.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiClose.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,89 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: MultiClose.java,v 1.3.8.1 2005/11/22 10:36:18 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.ba;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.DemoBusinessParticipant;
+import com.arjuna.wst.tests.FailureBusinessParticipant;
+import com.arjuna.wst.SystemException;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: MultiClose.java,v 1.3.8.1 2005/11/22 10:36:18 kconner Exp $
+ * @since 1.0.
+ */
+
+public class MultiClose extends TestCase
+{
+    public static void testMultiClose()
+            throws Exception
+    {
+	    UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
+
+        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
+        com.arjuna.wst11.BAParticipantManager bpm1 = null;
+        com.arjuna.wst11.BAParticipantManager bpm2 = null;
+        DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.CLOSE, "1240");
+	    FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_CLOSE, "5679");
+
+        try {
+	    uba.begin();
+
+	    bpm1 = bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1240");
+	    bpm2 = bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5679");
+        bpm1.completed();
+        bpm2.completed();
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+	    try {
+	    uba.close();
+        } catch (SystemException ex) {
+            // we should get here
+            assertTrue(p.passed());
+            return;
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+        fail("expected SystemError");
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiCompensate.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/ba/MultiCompensate.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiCompensate.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/ba/MultiCompensate.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,87 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: MultiCompensate.java,v 1.3.8.1 2005/11/22 10:36:18 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.ba;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.DemoBusinessParticipant;
+import com.arjuna.wst.tests.FailureBusinessParticipant;
+import com.arjuna.wst.SystemException;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: MultiCompensate.java,v 1.3.8.1 2005/11/22 10:36:18 kconner Exp $
+ * @since 1.0.
+ */
+
+public class MultiCompensate extends TestCase
+{
+    public static void testMultiCompensate()
+            throws Exception
+    {
+	    UserBusinessActivity uba = UserBusinessActivity.getUserBusinessActivity();
+        BusinessActivityManager bam = BusinessActivityManager.getBusinessActivityManager();
+	    com.arjuna.wst11.BAParticipantManager bpm1 = null;
+	    com.arjuna.wst11.BAParticipantManager bpm2 = null;
+	    DemoBusinessParticipant p = new DemoBusinessParticipant(DemoBusinessParticipant.COMPENSATE, "1241");
+	    FailureBusinessParticipant fp = new FailureBusinessParticipant(FailureBusinessParticipant.FAIL_IN_COMPENSATE, "5680");
+	    try {
+	    uba.begin();
+
+	    bpm1 = bam.enlistForBusinessAgreementWithParticipantCompletion(p, "1241");
+	    bpm2 = bam.enlistForBusinessAgreementWithParticipantCompletion(fp, "5680");
+
+	    bpm1.completed();
+	    bpm2.completed();
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+	    try {
+	    uba.cancel();
+        } catch (SystemException ex) {
+            // we should get here
+            assertTrue(p.passed());
+        } catch (Exception eouter) {
+            try {
+                uba.cancel();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+        fail("expected SystemError");
+	}
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/CommitExceptionInPrepare.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/CommitExceptionInPrepare.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/CommitExceptionInPrepare.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/CommitExceptionInPrepare.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,83 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CommitExceptionInPrepare.java,v 1.9.8.1 2005/11/22 10:36:11 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.FailureParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CommitExceptionInPrepare.java,v 1.9.8.1 2005/11/22 10:36:11 kconner Exp $
+ * @since 1.0.
+ */
+
+public class CommitExceptionInPrepare extends TestCase
+{
+    public static void testCommitExceptionInPrepare()
+            throws Exception
+    {
+        UserTransaction ut = UserTransaction.getUserTransaction();
+	try
+	{
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+	    FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_PREPARE, FailureParticipant.WRONG_STATE);
+	    DemoDurableParticipant p2 = new DemoDurableParticipant();
+
+	    ut.begin();
+
+	    tm.enlistForDurableTwoPhase(p1, "failure");
+	    tm.enlistForDurableTwoPhase(p2, p2.identifier());
+    } catch (Exception eouter) {
+        try {
+            ut.rollback();
+        } catch(Exception einner) {
+        }
+        throw eouter;
+    }
+	try {
+	    ut.commit();
+
+	    fail("expected SystemException");
+	}
+	catch (com.arjuna.wst.SystemException ex)
+	{
+	    // we should arrive here
+	}
+	catch (com.arjuna.wst.TransactionRolledBackException ex)
+	{
+	    // or if not we should arrive here
+	}
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/CommitRollbackInPrepare.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/CommitRollbackInPrepare.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/CommitRollbackInPrepare.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/CommitRollbackInPrepare.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: CommitRollbackInPrepare.java,v 1.6.8.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.FailureParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CommitRollbackInPrepare.java,v 1.6.8.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class CommitRollbackInPrepare extends TestCase
+{
+
+    public static void testCommitRollbackInPrepare()
+            throws Exception
+    {
+        UserTransaction ut = UserTransaction.getUserTransaction();
+	try
+	{
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+	    FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_PREPARE, FailureParticipant.NONE);
+	    DemoDurableParticipant p2 = new DemoDurableParticipant();
+
+	    ut.begin();
+
+	    tm.enlistForDurableTwoPhase(p1, "failure");
+	    tm.enlistForDurableTwoPhase(p2, p2.identifier());
+    }  catch (Exception eouter) {
+        try {
+            ut.rollback();
+        } catch(Exception einner) {
+        }
+        throw eouter;
+    }
+	try {
+	    ut.commit();
+
+	    fail("expected TransactionRolledBackException");
+	}
+	catch (com.arjuna.wst.TransactionRolledBackException ex)
+	{
+	    // we should arrive here
+    }
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/MultiParticipants.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/MultiParticipants.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/MultiParticipants.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/MultiParticipants.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: MultiParticipants.java,v 1.6.8.1 2005/11/22 10:36:11 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: MultiParticipants.java,v 1.6.8.1 2005/11/22 10:36:11 kconner Exp $
+ * @since 1.0.
+ */
+
+public class MultiParticipants extends TestCase
+{
+
+    public static void testMultiParticipants()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+        TransactionManager tm = TransactionManager.getTransactionManager();
+	    DemoDurableParticipant p1 = new DemoDurableParticipant();
+	    DemoDurableParticipant p2 = new DemoDurableParticipant();
+	    DemoDurableParticipant p3 = new DemoDurableParticipant();
+	    DemoDurableParticipant p4 = new DemoDurableParticipant();
+
+	    ut.begin();
+	    try {
+	    tm.enlistForDurableTwoPhase(p1, p1.identifier());
+	    tm.enlistForDurableTwoPhase(p2, p2.identifier());
+	    tm.enlistForDurableTwoPhase(p3, p3.identifier());
+	    tm.enlistForDurableTwoPhase(p4, p4.identifier());
+        }  catch (Exception eouter) {
+            try {
+                ut.rollback();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+
+	    ut.commit();
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NestedTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/NestedTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NestedTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NestedTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,84 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: NestedTransaction.java,v 1.3.24.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.UserTransaction;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: NestedTransaction.java,v 1.3.24.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class NestedTransaction extends TestCase
+{
+
+    public static void testNestedTransaction()
+            throws Exception
+    {
+        UserTransaction ut = UserTransaction.getUserTransaction();
+	try
+	{
+
+	    // nesting not supported, so each is a separate top-level tx.
+
+	    ut.begin();
+
+	    ut.begin();
+
+	    ut.commit();
+
+	    ut.commit();
+
+        fail("expected WrongStateException");
+    }
+	catch (com.arjuna.wst.WrongStateException ex)
+	{
+        // original test was expecting UnknownTransactionException
+        // we should get here;
+        try {
+            ut.rollback();
+        } catch(Exception einner) {
+        }
+	}
+    catch (Exception eouter)
+    {
+        try {
+            ut.rollback();
+            ut.rollback();
+        } catch(Exception einner) {
+        }
+        throw eouter;
+    }
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NullCommitTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/NullCommitTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NullCommitTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NullCommitTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: NullCommitTransaction.java,v 1.3.24.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.UserTransaction;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: NullCommitTransaction.java,v 1.3.24.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class NullCommitTransaction extends TestCase
+{
+
+    public static void testNullCommitTransaction()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+
+	    ut.begin();
+
+	    ut.commit();
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NullRollbackTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/NullRollbackTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NullRollbackTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/NullRollbackTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,55 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: NullRollbackTransaction.java,v 1.3.24.1 2005/11/22 10:36:11 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.UserTransaction;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: NullRollbackTransaction.java,v 1.3.24.1 2005/11/22 10:36:11 kconner Exp $
+ * @since 1.0.
+ */
+
+public class NullRollbackTransaction extends TestCase
+{
+
+    public static void testNullRollbackTransaction()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+
+	    ut.begin();
+
+	    ut.rollback();
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/PrintTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,59 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: PrintTransaction.java,v 1.1.24.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.UserTransaction;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: PrintTransaction.java,v 1.1.24.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class PrintTransaction extends TestCase
+{
+
+    public static void testPrintTransaction()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+
+	    ut.begin();
+
+	    System.out.println("Started: "+ut);
+
+	    ut.commit();
+
+	    System.out.println("\nCurrent: "+ut);
+	}
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/ResumeNullTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/ResumeNullTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/ResumeNullTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/ResumeNullTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,53 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ResumeNullTransaction.java,v 1.2.24.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: ResumeNullTransaction.java,v 1.2.24.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class ResumeNullTransaction extends TestCase
+{
+
+    public static void testResumeNullTransaction()
+            throws Exception
+    {
+	    TransactionManager ut = TransactionManager.getTransactionManager();
+
+	    ut.resume(null);
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/RollbackExceptionInRollback.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/RollbackExceptionInRollback.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/RollbackExceptionInRollback.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/RollbackExceptionInRollback.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,70 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: RollbackExceptionInRollback.java,v 1.6.8.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.FailureParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: RollbackExceptionInRollback.java,v 1.6.8.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class RollbackExceptionInRollback extends TestCase
+{
+    public static void testRollbackExceptionInRollback()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+	    FailureParticipant p1 = new FailureParticipant(FailureParticipant.FAIL_IN_ROLLBACK, FailureParticipant.WRONG_STATE);
+	    DemoDurableParticipant p2 = new DemoDurableParticipant();
+
+	    ut.begin();
+	    try {
+	    tm.enlistForDurableTwoPhase(p1, "failure");
+	    tm.enlistForDurableTwoPhase(p2, p2.identifier());
+        }  catch (Exception eouter) {
+            try {
+                ut.rollback();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+
+	    ut.rollback();
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SingleParticipant.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SingleParticipant.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SingleParticipant.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SingleParticipant.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,68 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SingleParticipant.java,v 1.7.8.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SingleParticipant.java,v 1.7.8.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SingleParticipant extends TestCase
+{
+
+    public static void testSingleParticipant()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+	    DemoDurableParticipant p = new DemoDurableParticipant();
+
+	    ut.begin();
+	    try {
+	    tm.enlistForDurableTwoPhase(p, p.identifier());
+        }  catch (Exception eouter) {
+            try {
+                ut.rollback();
+            } catch(Exception einner) {
+            }
+            throw eouter;
+        }
+
+	    ut.commit();
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendCommitTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SuspendCommitTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendCommitTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendCommitTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,77 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SuspendCommitTransaction.java,v 1.2.24.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.UnknownTransactionException;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendCommitTransaction.java,v 1.2.24.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SuspendCommitTransaction extends TestCase
+{
+
+    public static void testSuspendCommitTransaction()
+            throws Exception
+    {
+        UserTransaction ut = UserTransaction.getUserTransaction();
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+
+	    ut.begin();
+
+    try {
+	    TxContext ctx = tm.suspend();
+
+	    System.out.println("Suspended: "+ctx);
+    }  catch (Exception eouter) {
+        try {
+            ut.rollback();
+        } catch(Exception einner) {
+        }
+        throw eouter;
+    }
+
+    try {
+	    ut.commit();
+	}
+	catch (UnknownTransactionException ex)
+	{
+	    // we should arrive here
+	}
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendNullTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SuspendNullTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendNullTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendNullTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,58 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SuspendNullTransaction.java,v 1.2.24.1 2005/11/22 10:36:11 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendNullTransaction.java,v 1.2.24.1 2005/11/22 10:36:11 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SuspendNullTransaction extends TestCase
+{
+
+    public static void testSuspendNullTransaction()
+            throws Exception
+    {
+	    TransactionManager ut = TransactionManager.getTransactionManager();
+
+	    TxContext ctx = ut.suspend();
+
+	    System.out.println("Suspended: "+ctx);
+
+	    assertTrue(ctx == null);
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeCommitTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SuspendResumeCommitTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeCommitTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeCommitTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,66 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SuspendResumeCommitTransaction.java,v 1.2.24.1 2005/11/22 10:36:11 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendResumeCommitTransaction.java,v 1.2.24.1 2005/11/22 10:36:11 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SuspendResumeCommitTransaction extends TestCase
+{
+
+    public static void testSuspendResumeCommitTransaction()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+
+	    ut.begin();
+
+	    TxContext ctx = tm.suspend();
+
+	    System.out.println("Suspended: "+ctx);
+
+	    tm.resume(ctx);
+
+	    System.out.println("\nResumed");
+
+	    ut.commit();
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeParticipants.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SuspendResumeParticipants.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeParticipants.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeParticipants.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,88 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SuspendResumeParticipants.java,v 1.6.8.1 2005/11/22 10:36:12 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendResumeParticipants.java,v 1.6.8.1 2005/11/22 10:36:12 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SuspendResumeParticipants extends TestCase
+{
+
+    public static void testSuspendResumeParticipants()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+	    DemoDurableParticipant p1 = new DemoDurableParticipant();
+	    DemoDurableParticipant p2 = new DemoDurableParticipant();
+	    DemoDurableParticipant p3 = new DemoDurableParticipant();
+	    DemoDurableParticipant p4 = new DemoDurableParticipant();
+
+	    System.out.println("Starting first transaction.\n");
+
+	    ut.begin();
+    try {
+	    tm.enlistForDurableTwoPhase(p1, p1.identifier());
+	    tm.enlistForDurableTwoPhase(p2, p2.identifier());
+	    tm.enlistForDurableTwoPhase(p3, p3.identifier());
+	    tm.enlistForDurableTwoPhase(p4, p4.identifier());
+
+	    TxContext ctx = tm.suspend();
+
+	    System.out.println("Suspended: "+ctx);
+
+	    ut.begin();
+
+	    System.out.println("\nStarted second transaction.");
+
+	    tm.resume(ctx);
+
+	    System.out.println("\nCommitting first transaction.\n");
+    }  catch (Exception eouter) {
+        try {
+            ut.rollback();
+        } catch(Exception einner) {
+        }
+        throw eouter;
+    }
+	    ut.commit();
+	}
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeSingleParticipant.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SuspendResumeSingleParticipant.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeSingleParticipant.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendResumeSingleParticipant.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,76 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SuspendResumeSingleParticipant.java,v 1.6.8.1 2005/11/22 10:36:11 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendResumeSingleParticipant.java,v 1.6.8.1 2005/11/22 10:36:11 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SuspendResumeSingleParticipant extends TestCase
+{
+
+    public static void testSuspendResumeSingleParticipant()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+	    DemoDurableParticipant p = new DemoDurableParticipant();
+	try {
+	    ut.begin();
+
+	    tm.enlistForDurableTwoPhase(p, p.identifier());
+
+	    TxContext ctx = tm.suspend();
+
+	    System.out.println("Suspended: "+ctx);
+
+	    tm.resume(ctx);
+
+	    System.out.println("\nResumed\n");
+    }  catch (Exception eouter) {
+        try {
+            ut.rollback();
+        } catch(Exception einner) {
+        }
+        throw eouter;
+    }
+	    ut.commit();
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SuspendTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SuspendTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,60 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: SuspendTransaction.java,v 1.2.24.1 2005/11/22 10:36:11 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendTransaction.java,v 1.2.24.1 2005/11/22 10:36:11 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SuspendTransaction extends TestCase
+{
+
+    public static void testSuspendTransaction()
+            throws Exception
+    {
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+	    TransactionManager tm = TransactionManager.getTransactionManager();
+
+	    ut.begin();
+
+	    TxContext ctx = tm.suspend();
+
+	    System.out.println("Suspended: "+ctx);
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/ThreadedTransaction.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/ThreadedTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/ThreadedTransaction.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/ThreadedTransaction.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,101 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2006, 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 General Public License, v. 2.0.
+ * 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 General Public License for more details.
+ * You should have received a copy of the GNU General Public License,
+ * v. 2.0 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+ * MA  02110-1301, USA.
+ * 
+ * (C) 2005-2006,
+ * @author JBoss Inc.
+ */
+/*
+ * Copyright (C) 2002,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: ThreadedTransaction.java,v 1.1.24.1 2005/11/22 10:36:11 kconner Exp $
+ */
+
+package com.arjuna.wst11.tests.junit.basic;
+
+import com.arjuna.mw.wst11.UserTransaction;
+import junit.framework.TestCase;
+
+
+class ThreadedObject extends Thread
+{
+    Exception exception;
+
+    public ThreadedObject ()
+    {
+        exception = null;
+    }
+
+    public void run ()
+    {
+	try
+	{
+	    UserTransaction ut = UserTransaction.getUserTransaction();
+
+	    ut.begin();
+
+	    System.out.println("Thread "+Thread.currentThread()+" started "+ut);
+
+	    Thread.yield();
+
+	    System.out.println("\nThread "+Thread.currentThread()+" committing "+ut);
+
+	    ut.commit();
+
+
+
+	    Thread.yield();
+	}
+	catch (Exception ex)
+	{
+        ex.printStackTrace();
+        exception = ex;
+	}
+    }
+
+}
+
+public class ThreadedTransaction extends TestCase
+{
+
+    public static void testThreadedTransaction()
+            throws Exception
+    {
+        boolean passed = false;
+        int size = 10;
+        ThreadedObject objs[] = new ThreadedObject[size];
+
+        for (int i = 0; i < size; i++)
+            objs[i] = new ThreadedObject();
+
+        for (int j = 0; j < size; j++)
+            objs[j].start();
+
+        for (int k = 0; k < size; k++)
+            objs[k].join();
+
+        for (int k = 0; k < size; k++) {
+            if (objs[k].exception != null) {
+                throw objs[k].exception;
+            }
+        }
+    }
+}
\ No newline at end of file

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wstx11/tests/TestInitialisation.java (from rev 19937, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wstx/tests/TestInitialisation.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wstx11/tests/TestInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wstx11/tests/TestInitialisation.java	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,11 @@
+package com.arjuna.wstx11.tests;
+
+/**
+ * Created by IntelliJ IDEA.
+ * User: adinn
+ * Date: Mar 7, 2008
+ * Time: 1:50:50 PM
+ * To change this template use File | Settings | File Templates.
+ */
+public class TestInitialisation {
+}
\ No newline at end of file

Modified: labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx-tests_application.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx-tests_application.xml	2008-05-29 08:45:01 UTC (rev 20205)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx-tests_application.xml	2008-05-29 08:49:48 UTC (rev 20206)
@@ -32,4 +32,11 @@
             <context-root>/wstx-tests</context-root>
         </web>
     </module>
+
+    <module>
+        <web>
+            <web-uri>wstx11-tests.war</web-uri>
+            <context-root>/wstx11-tests</context-root>
+        </web>
+    </module>
 </application>

Copied: labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx11-tests_web-app.xml (from rev 20019, labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx-tests_web-app.xml)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx11-tests_web-app.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/dd/wstx11-tests_web-app.xml	2008-05-29 08:49:48 UTC (rev 20206)
@@ -0,0 +1,53 @@
+<!--
+  JBoss, Home of Professional Open Source
+  Copyright 2006, 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 General Public License, v. 2.0.
+  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 General Public License for more details.
+  You should have received a copy of the GNU General Public License,
+  v. 2.0 along with this distribution; if not, write to the Free Software
+  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, 
+  MA  02110-1301, USA.
+  
+  (C) 2005-2006,
+  @author JBoss Inc.
+-->
+
+<!DOCTYPE web-app PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" "http://java.sun.com/j2ee/dtds/web-app_2_3.dtd">
+
+<web-app>
+    <display-name>Arjuna WSTX 1.1 Tests</display-name>
+
+    <description>Arjuna WSTX 1.1 Tests</description>
+
+    <!--  Initialise the tests -->
+    <listener>
+        <listener-class>com.arjuna.wstx11.tests.TestInitialisation</listener-class>
+    </listener>
+    
+    <servlet>
+        <servlet-name>JUnit Tests Servlet</servlet-name>
+        <servlet-class>com.arjuna.qa.junit.WSTXTestRunnerServlet</servlet-class>
+        <init-param>
+            <param-name>TestSuiteClassName</param-name>
+            <param-value>com.arjuna.wst11.tests.WSTX11TestSuite</param-value>
+        </init-param>
+        <load-on-startup>4</load-on-startup>
+    </servlet>
+
+	<!-- servlet mappings -->
+    <servlet-mapping>
+        <servlet-name>JUnit Tests Servlet</servlet-name>
+        <url-pattern>/index.html</url-pattern>
+    </servlet-mapping>
+    
+    <welcome-file-list>
+        <welcome-file>index.html</welcome-file>
+    </welcome-file-list>
+</web-app>




More information about the jboss-svn-commits mailing list