[jboss-svn-commits] JBL Code SVN: r20207 - in labs/jbosstm/trunk/XTS/WSCF: classes11/com/arjuna/mw/wscf11/model/as and 7 other directories.

jboss-svn-commits at lists.jboss.org jboss-svn-commits at lists.jboss.org
Thu May 29 05:43:59 EDT 2008


Author: adinn
Date: 2008-05-29 05:43:59 -0400 (Thu, 29 May 2008)
New Revision: 20207

Added:
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/TestInitialisation.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestSuite.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddParticipant.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddSynchronization.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginCancel.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginConfirm.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyCancel.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyConfirm.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/StartEnd.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/Suspend.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendConfirm.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendParticipant.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendResume.java
   labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf11-tests_web-app.xml
Modified:
   labs/jbosstm/trunk/XTS/WSCF/build.xml
   labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/CoordinatorManagerFactory.java
   labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/TestInitialisation.java
   labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf-tests_application.xml
Log:
added unit tests for 1.1 code

Modified: labs/jbosstm/trunk/XTS/WSCF/build.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/build.xml	2008-05-29 08:49:48 UTC (rev 20206)
+++ labs/jbosstm/trunk/XTS/WSCF/build.xml	2008-05-29 09:43:59 UTC (rev 20207)
@@ -321,7 +321,9 @@
 	    <classpath>
 	      <pathelement path="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}.jar"/>
           <pathelement path="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}10.jar"/>
+          <pathelement path="${com.arjuna.mwlabs.wscf.jar.dest}/${com.arjuna.mwlabs.ts.modulename}11.jar"/>
           <pathelement path="${com.arjuna.mwlabs.wsc.jar.dest}/${wsc10.libs}"/>
+          <pathelement path="${com.arjuna.mwlabs.wsc.jar.dest}/${wsc11.libs}"/>
 	      <path refid="com.arjuna.mwlabs.wscf.tests.lib.path"/>
 	      <path refid="com.arjuna.mwlabs.wscf.lib.classpath"/>
 	    </classpath>
@@ -336,12 +338,28 @@
                 <filter token="port" value="${port}"/>
             </filterset>
         </copy>
-        <war warfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.war" webxml="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app.xml">
+        <copy file="${com.arjuna.mwlabs.wscf.tests.dd}/wscf11-tests_web-app.xml" tofile="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app11.xml">
+            <filterset>
+                <filter token="hostname" value="${hostname}"/>
+                <filter token="port" value="${port}"/>
+            </filterset>
+        </copy>
+        <jar jarfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.jar">
+            <fileset dir="${com.arjuna.mwlabs.wscf.tests.dest}"/>
             <manifest>
                 <attribute name="Class-Path" value="${tests.depend.libs}"/>
             </manifest>
-            <classes dir="${com.arjuna.mwlabs.wscf.tests.dest}"/>
+        </jar>
+        <war warfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.war" webxml="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app.xml">
+            <manifest>
+                <attribute name="Class-Path" value="wscf-tests.jar"/>
+            </manifest>
         </war>
+        <war warfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf11-tests.war" webxml="${com.arjuna.mwlabs.wscf.tests.dd.dest}/web-app11.xml">
+            <manifest>
+                <attribute name="Class-Path" value="wscf-tests.jar"/>
+            </manifest>
+        </war>
         <ear earfile="${com.arjuna.mwlabs.wscf.tests.webapps.dest}/wscf-tests.ear" appxml="${com.arjuna.mwlabs.wscf.tests.dd}/wscf-tests_application.xml">
             <!-- we only need to deploy the ext test libs (junit) and
 	         the tests war in JBoss AS 5.0. the rest of the XTS
@@ -349,7 +367,7 @@
 	         in the server lib
 	         -->
             <fileset dir="${com.arjuna.xts.ext}" includes="${tests.libs}"/>
-            <fileset dir="${com.arjuna.mwlabs.wscf.tests.webapps.dest}" includes="wscf-tests.war"/>
+            <fileset dir="${com.arjuna.mwlabs.wscf.tests.webapps.dest}" includes="wscf-tests.war wscf11-tests.war wscf-tests.jar"/>
         </ear>
     </target>
 

Modified: labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/CoordinatorManagerFactory.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/CoordinatorManagerFactory.java	2008-05-29 08:49:48 UTC (rev 20206)
+++ labs/jbosstm/trunk/XTS/WSCF/classes11/com/arjuna/mw/wscf11/model/as/CoordinatorManagerFactory.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -39,11 +39,12 @@
 
 import com.arjuna.mw.wscf.common.CoordinatorXSD;
 
-import com.arjuna.mw.wscf11.protocols.*;
 import com.arjuna.mw.wscf.utils.DomUtil;
 
 import com.arjuna.mw.wscf.exceptions.ProtocolNotRegisteredException;
 import com.arjuna.mw.wscf.model.as.CoordinatorManager;
+import com.arjuna.mw.wscf11.protocols.ProtocolManager;
+import com.arjuna.mw.wscf11.protocols.ProtocolRegistry;
 
 import com.arjuna.mw.wsas.exceptions.SystemException;
 

Modified: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/TestInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/TestInitialisation.java	2008-05-29 08:49:48 UTC (rev 20206)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf/tests/TestInitialisation.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -1,11 +1,7 @@
 package com.arjuna.wscf.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.
+ * perform any setup required for the 1.1 WSCF tests
  */
 public class TestInitialisation {
 }
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/TestInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/TestInitialisation.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/TestInitialisation.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -0,0 +1,7 @@
+package com.arjuna.wscf11.tests;
+
+/**
+ * perform any setup required for the 1.1 WSCF tests
+ */
+public class TestInitialisation {
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestSuite.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestSuite.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/WSCF11TestSuite.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -0,0 +1,52 @@
+/*
+ * 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.wscf11.tests;
+
+public class WSCF11TestSuite extends junit.framework.TestSuite
+{
+    public WSCF11TestSuite()
+    {
+        // wscf twophase tests
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.StartEnd.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.BeginConfirm.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.BeginCancel.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.Suspend.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.SuspendResume.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.SuspendConfirm.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.CancelOnlyCancel.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.CancelOnlyConfirm.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.AddParticipant.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.SuspendParticipant.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.AddSynchronization.class));
+        addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.ParticipantSynchronization.class));
+        // this test relies on an invalid, out of date DOM implementation
+        //addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.ContextOutput.class));
+        // TODO -- these tests break because ArjunaContextImple.toString() is broken. fix after 4.3.0 release
+        //addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.WscContext.class));
+        //addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.WscNestedContext.class));
+        // this test relies on an invalid, out of date DOM implementation
+        //addTest(new junit.framework.TestSuite(com.arjuna.wscf.tests.junit.model.twophase.WscTranslateContext.class));
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddParticipant.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddParticipant.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -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: AddParticipant.java,v 1.2 2005/01/15 21:21:03 kconner Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+
+import com.arjuna.mw.wscf11.model.twophase.CoordinatorManagerFactory;
+
+import com.arjuna.wscf.tests.TwoPhaseParticipant;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: AddParticipant.java,v 1.2 2005/01/15 21:21:03 kconner Exp $
+ * @since 1.0.
+ */
+
+public class AddParticipant extends TestCase
+{
+
+    public void testAddParticipant()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+	try
+	{
+	    cm.begin();
+
+	    cm.enlistParticipant(new TwoPhaseParticipant(null));
+
+	    System.out.println("Started: "+cm.identifier()+"\n");
+
+	    cm.confirm();
+	}
+	catch (Exception ex)
+	{
+	    WSCFTestUtils.cleanup(cm);
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddSynchronization.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/AddSynchronization.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -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: AddSynchronization.java,v 1.1 2003/01/07 10:34:00 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+
+import com.arjuna.mw.wscf11.model.twophase.CoordinatorManagerFactory;
+
+import com.arjuna.wscf.tests.TwoPhaseSynchronization;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: AddSynchronization.java,v 1.1 2003/01/07 10:34:00 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class AddSynchronization extends TestCase
+{
+
+    public void testAddSynchronization()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+	try
+	{
+	    cm.begin();
+
+	    cm.enlistSynchronization(new TwoPhaseSynchronization());
+
+	    System.out.println("Started: "+cm.identifier()+"\n");
+
+	    cm.confirm();
+	}
+	catch (Exception ex)
+	{
+        WSCFTestUtils.cleanup(cm);
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginCancel.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginCancel.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -0,0 +1,63 @@
+/*
+ * 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: BeginCancel.java,v 1.1 2003/01/07 10:34:00 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wscf11.model.twophase.UserCoordinatorFactory;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: BeginCancel.java,v 1.1 2003/01/07 10:34:00 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class BeginCancel extends TestCase
+{
+
+    public void testBeginCancel()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+	    ua.begin();
+
+	    System.out.println("Started: "+ua.identifier()+"\n");
+
+	    ua.cancel();
+
+        System.out.println("Cancelled");
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginConfirm.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/BeginConfirm.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -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: BeginConfirm.java,v 1.2 2003/01/17 15:39:35 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wscf11.model.twophase.UserCoordinatorFactory;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: BeginConfirm.java,v 1.2 2003/01/17 15:39:35 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class BeginConfirm extends TestCase
+{
+
+    public void testBeginConfirm()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+	try
+	{
+	    ua.begin();
+
+	    System.out.println("Started: "+ua.identifier()+"\n");
+
+	    ua.confirm();
+	}
+	catch (Exception ex)
+	{
+	    WSCFTestUtils.cleanup(ua);
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyCancel.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyCancel.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -0,0 +1,79 @@
+/*
+ * 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: CancelOnlyCancel.java,v 1.1 2003/01/07 10:34:00 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wscf11.model.twophase.UserCoordinatorFactory;
+
+import com.arjuna.mw.wscf.model.twophase.exceptions.*;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CancelOnlyCancel.java,v 1.1 2003/01/07 10:34:00 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CancelOnlyCancel extends TestCase
+{
+
+    public void testCancelOnlyCancel()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+	try
+	{
+	    ua.begin();
+
+	    System.out.println("Started: "+ua.identifier()+"\n");
+
+	    ua.setCancelOnly();
+
+	    ua.cancel();
+	}
+	catch (CoordinatorCancelledException ex)
+	{
+        // why is it ok to get here?
+        WSCFTestUtils.cleanup(ua);
+    }
+	catch (Exception ex)
+	{
+        WSCFTestUtils.cleanup(ua);
+        throw ex;
+	}
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyConfirm.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/CancelOnlyConfirm.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -0,0 +1,81 @@
+/*
+ * 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: CancelOnlyConfirm.java,v 1.1 2003/01/07 10:34:01 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wscf11.model.twophase.UserCoordinatorFactory;
+
+import com.arjuna.mw.wscf.model.twophase.exceptions.*;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: CancelOnlyConfirm.java,v 1.1 2003/01/07 10:34:01 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class CancelOnlyConfirm extends TestCase
+{
+
+    public void testCancelOnlyConfirm()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+	try
+	{
+	    ua.begin();
+
+	    System.out.println("Started: "+ua.identifier()+"\n");
+
+	    ua.setCancelOnly();
+
+	    ua.confirm();
+
+        fail("Confirm succeeded after setCancelOnly");
+    }
+	catch (CoordinatorCancelledException ex)
+	{
+	    // we should get here
+        WSCFTestUtils.cleanup(ua);
+    }
+	catch (Exception ex)
+	{
+	    WSCFTestUtils.cleanup(ua);
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/ParticipantSynchronization.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -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: ParticipantSynchronization.java,v 1.2 2005/01/15 21:21:03 kconner Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+
+import com.arjuna.mw.wscf11.model.twophase.CoordinatorManagerFactory;
+
+import com.arjuna.wscf.tests.TwoPhaseParticipant;
+import com.arjuna.wscf.tests.TwoPhaseSynchronization;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: ParticipantSynchronization.java,v 1.2 2005/01/15 21:21:03 kconner Exp $
+ * @since 1.0.
+ */
+
+public class ParticipantSynchronization extends TestCase
+{
+
+    public void testParticipantSynchronization()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+	try
+	{
+	    cm.begin();
+
+	    cm.enlistParticipant(new TwoPhaseParticipant(null));
+	    cm.enlistParticipant(new TwoPhaseParticipant(null));
+	    cm.enlistSynchronization(new TwoPhaseSynchronization());
+
+	    System.out.println("Started: "+cm.identifier()+"\n");
+
+	    cm.confirm();
+	}
+	catch (Exception ex)
+	{
+	    WSCFTestUtils.cleanup(cm);
+	}
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/StartEnd.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/StartEnd.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/StartEnd.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -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: StartEnd.java,v 1.3 2003/03/14 14:26:34 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mwlabs.wscf.utils.ProtocolLocator;
+
+import com.arjuna.mw.wscf.UserCoordinator;
+import com.arjuna.mw.wscf11.UserCoordinatorFactory;
+
+import com.arjuna.mw.wscf.model.twophase.common.*;
+import com.arjuna.mw.wscf.model.twophase.outcomes.*;
+
+import com.arjuna.mw.wsas.activity.*;
+
+import com.arjuna.mw.wsas.exceptions.NoActivityException;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: StartEnd.java,v 1.3 2003/03/14 14:26:34 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class StartEnd extends TestCase
+{
+
+    public  void testStartEnd()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+	String className = "com.arjuna.mwlabs.wscf.model.twophase.arjunacore.TwoPhase11HLSImple";
+	org.w3c.dom.Document implementationDoc = null;
+
+	//	System.setProperty("com.arjuna.mw.wscf.protocolImplementation", className);
+
+        Class clazz = this.getClass().getClassLoader().loadClass(className);
+	    ProtocolLocator pl = new ProtocolLocator(clazz);
+
+	    implementationDoc = pl.getProtocol();
+
+	    UserCoordinator ua = UserCoordinatorFactory.userCoordinator(implementationDoc);
+
+    try
+    {
+	    ua.start();
+
+	    System.out.println("Started: "+ua.activityName()+"\n");
+
+	    Outcome res = ua.end();
+
+	    if (res instanceof CoordinationOutcome)
+	    {
+		CoordinationOutcome co = (CoordinationOutcome) res;
+        int result = co.result();
+
+        if (result != TwoPhaseResult.CANCELLED)
+		    fail("expected result \"CANCELLED\" (" + TwoPhaseResult.CANCELLED + ") but got " + result);
+	    }
+	}
+	catch (NoActivityException ex)
+	{
+	    // why is it ok to get here?;
+	}
+    catch (Exception ex)
+    {
+        WSCFTestUtils.cleanup(ua);
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/Suspend.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/Suspend.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/Suspend.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -0,0 +1,85 @@
+/*
+ * 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: Suspend.java,v 1.1 2003/01/07 10:34:01 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wscf11.model.twophase.UserCoordinatorFactory;
+
+import com.arjuna.mw.wsas.activity.*;
+
+import com.arjuna.mw.wscf.exceptions.*;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: Suspend.java,v 1.1 2003/01/07 10:34:01 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class Suspend extends TestCase
+{
+
+    public void testSuspend()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+	try
+	{
+	    ua.begin();
+
+	    System.out.println("Started: "+ua.identifier()+"\n");
+
+	    ActivityHierarchy hier = ua.suspend();
+
+	    System.out.println("Suspended: "+hier+"\n");
+
+	    if (ua.currentActivity() != null) {
+            WSCFTestUtils.cleanup(ua);
+            fail("Hierarchy still active.");
+        }
+	}
+	catch (NoCoordinatorException ex)
+	{
+        // why is it ok to get here?
+    }
+	catch (Exception ex)
+	{
+        WSCFTestUtils.cleanup(ua);
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendConfirm.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendConfirm.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendConfirm.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -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: SuspendConfirm.java,v 1.1 2003/01/07 10:34:01 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wscf11.model.twophase.UserCoordinatorFactory;
+
+import com.arjuna.mw.wsas.activity.*;
+
+import com.arjuna.mw.wscf.exceptions.*;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendConfirm.java,v 1.1 2003/01/07 10:34:01 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class SuspendConfirm extends TestCase
+{
+
+    public void testSuspendConfirm()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+	try
+	{
+	    ua.begin();
+
+	    System.out.println("Started: "+ua.identifier()+"\n");
+
+	    ActivityHierarchy hier = ua.suspend();
+
+	    System.out.println("Suspended: "+hier+"\n");
+
+	    if (ua.currentActivity() != null) {
+            WSCFTestUtils.cleanup(ua);
+            fail("Hierarchy still active.");
+        }
+
+        ua.confirm();
+	}
+	catch (NoCoordinatorException ex)
+	{
+	    // why is it ok to get here?
+        WSCFTestUtils.cleanup(ua);
+    }
+	catch (Exception ex)
+	{
+	    WSCFTestUtils.cleanup(ua);
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendParticipant.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendParticipant.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -0,0 +1,94 @@
+/*
+ * 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: SuspendParticipant.java,v 1.2 2005/01/15 21:21:03 kconner Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.CoordinatorManager;
+
+import com.arjuna.mw.wscf11.model.twophase.CoordinatorManagerFactory;
+
+import com.arjuna.mw.wsas.activity.*;
+
+import com.arjuna.wscf.tests.TwoPhaseParticipant;
+import com.arjuna.wscf.tests.TwoPhaseSynchronization;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendParticipant.java,v 1.2 2005/01/15 21:21:03 kconner Exp $
+ * @since 1.0.
+ */
+
+public class SuspendParticipant extends TestCase
+{
+
+    public void testSuspendParticipant()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
+
+	try
+	{
+	    cm.begin();
+
+	    cm.enlistParticipant(new TwoPhaseParticipant("p1"));
+	    cm.enlistParticipant(new TwoPhaseParticipant("p2"));
+	    cm.enlistSynchronization(new TwoPhaseSynchronization());
+
+	    System.out.println("Started: "+cm.identifier()+"\n");
+
+	    ActivityHierarchy hier = cm.suspend();
+
+	    System.out.println("Suspended: "+hier+"\n");
+
+	    if (cm.currentActivity() != null)
+	    {
+            WSCFTestUtils.cleanup(cm);
+
+            fail("Hierarchy still active.");
+	    }
+		cm.resume(hier);
+
+        System.out.println("Resumed: "+hier+"\n");
+
+		cm.confirm();
+	}
+	catch (Exception ex)
+	{
+	    WSCFTestUtils.cleanup(cm);
+
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Added: labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendResume.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendResume.java	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/classes/com/arjuna/wscf11/tests/model/twophase/SuspendResume.java	2008-05-29 09:43:59 UTC (rev 20207)
@@ -0,0 +1,90 @@
+/*
+ * 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: SuspendResume.java,v 1.1 2003/01/07 10:34:01 nmcl Exp $
+ */
+
+package com.arjuna.wscf11.tests.model.twophase;
+
+import com.arjuna.mw.wscf.model.twophase.api.UserCoordinator;
+
+import com.arjuna.mw.wscf11.model.twophase.UserCoordinatorFactory;
+
+import com.arjuna.mw.wsas.activity.*;
+import com.arjuna.wscf.tests.WSCFTestUtils;
+import junit.framework.TestCase;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: SuspendResume.java,v 1.1 2003/01/07 10:34:01 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class SuspendResume extends TestCase
+{
+
+    public void testSuspendResume()
+            throws Exception
+    {
+        System.out.println("Running test : " + this.getClass().getName());
+
+        UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
+
+	try
+	{
+	    ua.begin();
+
+	    System.out.println("Started: "+ua.identifier()+"\n");
+
+	    ActivityHierarchy hier = ua.suspend();
+
+	    System.out.println("Suspended: "+hier+"\n");
+
+	    if (ua.currentActivity() != null)
+	    {
+            WSCFTestUtils.cleanup(ua);
+            fail("Hierarchy still active");
+        }
+	    else
+	    {
+            ua.resume(hier);
+
+            System.out.println("Resumed: "+hier+"\n");
+
+            ua.cancel();
+
+            System.out.println("Cancelled");
+	    }
+	}
+	catch (Exception ex)
+	{
+        WSCFTestUtils.cleanup(ua);
+        throw ex;
+    }
+    }
+}
\ No newline at end of file

Modified: labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf-tests_application.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf-tests_application.xml	2008-05-29 08:49:48 UTC (rev 20206)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf-tests_application.xml	2008-05-29 09:43:59 UTC (rev 20207)
@@ -32,4 +32,11 @@
             <context-root>/wscf-tests</context-root>
         </web>
     </module>
+
+    <module>
+        <web>
+            <web-uri>wscf11-tests.war</web-uri>
+            <context-root>/wscf11-tests</context-root>
+        </web>
+    </module>
 </application>

Copied: labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf11-tests_web-app.xml (from rev 19937, labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf-tests_web-app.xml)
===================================================================
--- labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf11-tests_web-app.xml	                        (rev 0)
+++ labs/jbosstm/trunk/XTS/WSCF/tests/dd/wscf11-tests_web-app.xml	2008-05-29 09:43:59 UTC (rev 20207)
@@ -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 WSCF 1.1 Tests</display-name>
+
+    <description>Arjuna WSCF 1.1 Tests</description>
+
+    <!--  Initialise the tests -->
+    <listener>
+        <listener-class>com.arjuna.wscf11.tests.TestInitialisation</listener-class>
+    </listener>
+    
+ <servlet>
+        <servlet-name>JUnit Tests Servlet</servlet-name>
+        <servlet-class>com.arjuna.qa.junit.WSCFTestRunnerServlet</servlet-class>
+        <init-param>
+            <param-name>TestSuiteClassName</param-name>
+            <param-value>com.arjuna.wscf11.tests.WSCF11TestSuite</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