[jboss-svn-commits] JBL Code SVN: r37714 - in labs/jbosstm/trunk/XTS/localjunit/WSTX/src: main/java/com/arjuna/wst and 10 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Thu Nov 10 01:37:17 EST 2011
Author: zhfeng
Date: 2011-11-10 01:37:16 -0500 (Thu, 10 Nov 2011)
New Revision: 37714
Added:
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoBusinessParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoBusinessParticipantWithComplete.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoDurableParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoVolatileParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/FailureBusinessParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/FailureParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Cancel.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Close.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Compensate.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/ConfirmWithComplete.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Exit.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiCancel.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiClose.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiCompensate.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/CommitExceptionInPrepare.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/CommitRollbackInPrepare.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/MultiParticipants.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NestedTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NullCommitTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NullRollbackTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/PrintTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/ResumeNullTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/RollbackExceptionInRollback.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SingleParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommit.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitFailInPrepare.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitRollbackInPrepare.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionRollback.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendCommitTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendNullTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeCommitTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeParticipants.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeSingleParticipant.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/ThreadedTransaction.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/WarDeployment.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CancelTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CloseTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CompensateTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/ConfirmWithCompleteTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/ExitTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCancelTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCloseTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCompensateTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/CommitExceptionInPrepareTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/CommitRollbackInPrepareTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/MultiParticipantsTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NestedTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NullCommitTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NullRollbackTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/PrintTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/ResumeNullTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/RollbackExceptionInRollbackTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SingleParticipantTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitFailInPrepareTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitRollbackInPrepareTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionRollbackTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendCommitTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendNullTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeCommitTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeParticipantsTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeSingleParticipantTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendTransactionTest.java
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/ThreadedTransactionTest.java
Removed:
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/junit/
labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/junit/
Log:
JBTM-954 convert all wst11 tests to use arquillian
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoBusinessParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoBusinessParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoBusinessParticipant.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,146 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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: DemoBusinessParticipant.java,v 1.5 2004/09/09 08:48:39 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.*;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: DemoBusinessParticipant.java,v 1.5 2004/09/09 08:48:39 kconner Exp $
+ * @since 1.0.
+ */
+
+public class DemoBusinessParticipant implements com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant
+{
+
+ public static final int COMPENSATE = 0;
+ public static final int CANCEL = 1;
+ public static final int CLOSE = 2;
+ public static final int EXIT = 3;
+
+ /*
+ * TODO does EXIT imply a memory leak? How does the participant
+ * get unregistered from the dispatcher if it isn't called during
+ * termination?
+ */
+
+ public DemoBusinessParticipant (int outcome, String id)
+ {
+ _outcome = outcome;
+ _id = id;
+ }
+
+ public final boolean passed ()
+ {
+ /*
+ * If we get a passed result and our status was EXIT then this
+ * means that one of our methods was called, which is wrong if
+ * we exited!
+ */
+
+ switch (_outcome)
+ {
+ case EXIT:
+ return !_passed;
+ default:
+ return _passed;
+ }
+ }
+
+ public void close () throws WrongStateException, SystemException
+ {
+ System.out.println(this.getClass().getName()+".close for "+this);
+
+ if (_outcome == CLOSE)
+ _passed = true;
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ System.out.println(this.getClass().getName()+".cancel for "+this);
+
+ if (_outcome == CANCEL)
+ _passed = true;
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ System.out.println(this.getClass().getName()+".compensate for "+this);
+
+ if (_outcome == COMPENSATE)
+ _passed = true;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+ public String toString ()
+ {
+ try
+ {
+ return identifier();
+ }
+ catch (SystemException ex)
+ {
+ return "Unknown";
+ }
+ }
+
+ public String identifier () throws SystemException
+ {
+ return _id;
+ }
+
+ /**
+ * @return the status value.
+ */
+
+ public String status () throws SystemException
+ {
+ return "Unknown";
+ }
+
+ protected boolean _passed = false;
+ protected String _id = null;
+ protected int _outcome;
+
+}
+
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoBusinessParticipantWithComplete.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoBusinessParticipantWithComplete.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoBusinessParticipantWithComplete.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,100 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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, 2003, 2004,
+ *
+ * Arjuna Technologies Limited,
+ * Newcastle upon Tyne,
+ * Tyne and Wear,
+ * UK.
+ *
+ * $Id: DemoBusinessParticipantWithComplete.java,v 1.5 2004/09/09 08:48:40 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.*;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: DemoBusinessParticipantWithComplete.java,v 1.5 2004/09/09 08:48:40 kconner Exp $
+ * @since 1.0.
+ *
+ * Requires complete to be sent before the transaction terminates.
+ */
+
+public class DemoBusinessParticipantWithComplete extends DemoBusinessParticipant implements com.arjuna.wst.BusinessAgreementWithCoordinatorCompletionParticipant
+{
+
+ public static final int COMPLETE = 4;
+
+ public DemoBusinessParticipantWithComplete (int outcome, String id)
+ {
+ super(outcome, id);
+ }
+
+ public void close () throws WrongStateException, SystemException
+ {
+ System.out.println(this.getClass().getName()+".close for "+this);
+
+ if (!_completed)
+ throw new SystemException();
+
+ if (_outcome == CLOSE)
+ _passed = true;
+ }
+
+ public void cancel () throws WrongStateException, SystemException
+ {
+ System.out.println(this.getClass().getName()+".cancel for "+this);
+
+ if (!_completed)
+ throw new SystemException();
+
+ if (_outcome == CANCEL)
+ _passed = true;
+ }
+
+ public void compensate () throws FaultedException, WrongStateException, SystemException
+ {
+ System.out.println(this.getClass().getName()+".compensate for "+this);
+
+ if (!_completed)
+ throw new SystemException();
+
+ if (_outcome == COMPENSATE)
+ _passed = true;
+ }
+
+ public void complete () throws WrongStateException, SystemException
+ {
+ System.out.println(this.getClass().getName()+".complete for "+this);
+
+ if (_outcome == COMPLETE)
+ _passed = true;
+
+ _completed = true;
+ }
+
+ private boolean _completed = false;
+
+}
+
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoDurableParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoDurableParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoDurableParticipant.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,121 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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: DemoDurableParticipant.java,v 1.1.2.1 2004/08/09 12:34:30 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.ats.arjuna.common.Uid;
+
+import com.arjuna.wst.*;
+
+//import com.arjuna.mw.wst.vote.*;
+
+//import com.arjuna.mw.wst.exceptions.*;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: DemoDurableParticipant.java,v 1.1.2.1 2004/08/09 12:34:30 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class DemoDurableParticipant implements Durable2PCParticipant
+{
+
+ public DemoDurableParticipant ()
+ {
+ _passed = false;
+ _prepared = false;
+ _resolved = false;
+ }
+
+ public final boolean resolved ()
+ {
+ return _resolved;
+ }
+
+ public final boolean prepared ()
+ {
+ return _prepared;
+ }
+
+ public final boolean passed ()
+ {
+ return _passed;
+ }
+
+ public Vote prepare () throws WrongStateException, SystemException
+ {
+ System.out.println("DemoDurableParticipant.prepare for "+this);
+
+ _prepared = true;
+ return new Prepared();
+ }
+
+ public void commit () throws WrongStateException, SystemException
+ {
+ System.out.println("DemoDurableParticipant.commit for "+this);
+
+ _resolved = true;
+ _passed = true;
+ }
+
+ public void rollback () throws WrongStateException, SystemException
+ {
+ System.out.println("DemoDurableParticipant.rollback for "+this);
+
+ _resolved = true;
+ _passed = false;
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+ public String toString ()
+ {
+ return identifier();
+ }
+
+ public String identifier ()
+ {
+ return _id.stringForm();
+ }
+
+ private boolean _passed;
+ private boolean _prepared;
+ private boolean _resolved;
+ private Uid _id = new Uid();
+
+}
+
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoVolatileParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoVolatileParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/DemoVolatileParticipant.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,120 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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: DemoVolatileParticipant.java,v 1.1.2.1 2004/08/09 12:34:30 nmcl Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.ats.arjuna.common.Uid;
+
+import com.arjuna.wst.*;
+
+//import com.arjuna.mw.wst.vote.*;
+
+//import com.arjuna.mw.wst.exceptions.*;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: DemoVolatileParticipant.java,v 1.1.2.1 2004/08/09 12:34:30 nmcl Exp $
+ * @since 1.0.
+ */
+
+public class DemoVolatileParticipant implements Volatile2PCParticipant
+{
+ public DemoVolatileParticipant ()
+ {
+ _passed = false;
+ _prepared = false;
+ _resolved = false;
+ }
+
+ public final boolean resolved ()
+ {
+ return _resolved;
+ }
+
+ public final boolean prepared ()
+ {
+ return _prepared;
+ }
+
+ public final boolean passed ()
+ {
+ return _passed;
+ }
+
+ public Vote prepare () throws WrongStateException, SystemException
+ {
+ System.out.println("DemoVolatileParticipant.prepare for "+this);
+
+ _prepared = true;
+ return new Prepared();
+ }
+
+ public void commit () throws WrongStateException, SystemException
+ {
+ System.out.println("DemoVolatileParticipant.commit for "+this);
+
+ _resolved = true;
+ _passed = true;
+ }
+
+ public void rollback () throws WrongStateException, SystemException
+ {
+ System.out.println("DemoVolatileParticipant.rollback for "+this);
+
+ _resolved = true;
+ _passed = false;
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+ public String toString ()
+ {
+ return identifier();
+ }
+
+ public String identifier ()
+ {
+ return _id.stringForm();
+ }
+
+ private boolean _passed;
+ private boolean _prepared;
+ private boolean _resolved;
+ private Uid _id = new Uid();
+
+}
+
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/FailureBusinessParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/FailureBusinessParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/FailureBusinessParticipant.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,149 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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: FailureBusinessParticipant.java,v 1.4 2004/09/09 08:48:39 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.*;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: FailureBusinessParticipant.java,v 1.4 2004/09/09 08:48:39 kconner Exp $
+ * @since 1.0.
+ */
+
+public class FailureBusinessParticipant implements com.arjuna.wst.BusinessAgreementWithParticipantCompletionParticipant
+{
+
+ public static final int FAIL_IN_CLOSE = 0;
+ public static final int FAIL_IN_CANCEL = 1;
+ public static final int FAIL_IN_COMPENSATE = 2;
+
+ public FailureBusinessParticipant (int failurePoint, String id)
+ {
+ _failurePoint = failurePoint;
+ _id = id;
+ }
+
+ public final boolean passed ()
+ {
+ return _passed;
+ }
+
+ /**
+ * we use this to time out the failure behaviour for close because otherwise the transaction will keep
+ * retrying -- that's as per the sepc but a pain in the proverbial
+ */
+ private static long closeFirstCalledTime = 0;
+
+ /**
+ * timeout for the close failure in milliseconds. this must be bigger than the BA coordinator
+ * wait timeout and any timeout used by a test when it waits for the transaction to complete.
+ * A few minutes should be adequate.
+ */
+ private final long CLOSE_FAIL_TIMEOUT = (3 * 60 * 1000);
+
+ public void close () throws WrongStateException, SystemException
+ {
+ System.out.println("FailureBusinessParticipant.close for "+this);
+ if (closeFirstCalledTime == 0) {
+ closeFirstCalledTime = System.currentTimeMillis();
+ }
+ if (_failurePoint == FAIL_IN_CLOSE) {
+ long timeNow = System.currentTimeMillis();
+ if ((timeNow - closeFirstCalledTime) < CLOSE_FAIL_TIMEOUT) {
+ throw new WrongStateException();
+ }
+ }
+
+ _passed = true;
+ }
+
+ public void cancel () throws WrongStateException, SystemException, FaultedException
+ {
+ System.out.println("FailureBusinessParticipant.cancel for "+this);
+
+ if (_failurePoint == FAIL_IN_CANCEL)
+ throw new FaultedException();
+
+ _passed = true;
+ }
+
+ public void compensate () throws WrongStateException, SystemException, FaultedException
+ {
+ System.out.println("FailureBusinessParticipant.compensate for "+this);
+
+ if (_failurePoint == FAIL_IN_COMPENSATE)
+ throw new FaultedException();
+
+ _passed = true;
+ }
+
+ public void forget () throws WrongStateException, SystemException
+ {
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+ public String status () throws SystemException
+ {
+ return "Unknown";
+ }
+
+ public String toString ()
+ {
+ try
+ {
+ return identifier();
+ }
+ catch (SystemException ex)
+ {
+ return "Unknown";
+
+ }
+ }
+
+ public String identifier () throws SystemException
+ {
+ return _id;
+ }
+
+ private boolean _passed = false;
+ private String _id = null;
+ private int _failurePoint;
+
+}
+
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/FailureParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/FailureParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst/tests/common/FailureParticipant.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,155 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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: FailureParticipant.java,v 1.5 2004/09/09 08:48:40 kconner Exp $
+ */
+
+package com.arjuna.wst.tests.common;
+
+import com.arjuna.wst.*;
+
+/**
+ * @author Mark Little (mark.little at arjuna.com)
+ * @version $Id: FailureParticipant.java,v 1.5 2004/09/09 08:48:40 kconner Exp $
+ * @since 1.0.
+ */
+
+public class FailureParticipant implements Durable2PCParticipant
+{
+
+ public static final int FAIL_IN_PREPARE = 0;
+ public static final int FAIL_IN_ROLLBACK = 1;
+ public static final int FAIL_IN_COMMIT = 2;
+ public static final int FAIL_IN_ONE_PHASE = 3;
+
+ public static final int WRONG_STATE = 20;
+ public static final int SYSTEM = 21;
+ public static final int NONE = 22;
+
+ public FailureParticipant (int failurePoint, int failureType)
+ {
+ _failurePoint = failurePoint;
+ _failureType = failureType;
+ _prepared = false;
+ _resolved = false;
+ }
+
+ public final boolean passed ()
+ {
+ return _passed;
+ }
+
+ public final boolean prepared ()
+ {
+ return _prepared;
+ }
+
+ public final boolean resolved ()
+ {
+ return _resolved;
+ }
+
+ public Vote prepare () throws WrongStateException, SystemException
+ {
+ System.out.println("FailureParticipant.prepare");
+
+ _prepared = true;
+ if (_failurePoint == FAIL_IN_PREPARE)
+ {
+ generateException();
+
+ return new Aborted();
+ }
+ else
+ return new Prepared();
+ }
+
+ public void commit () throws WrongStateException, SystemException
+ {
+ System.out.println("FailureParticipant.commit");
+
+ _resolved = true;
+ if (_failurePoint == FAIL_IN_COMMIT)
+ generateException();
+
+ if (_failurePoint == FAIL_IN_PREPARE)
+ _passed = false;
+ }
+
+ public void rollback () throws WrongStateException, SystemException
+ {
+ _resolved = true;
+ System.out.println("FailureParticipant.rollback");
+
+ if (_failurePoint == FAIL_IN_ROLLBACK)
+ generateException();
+
+ if (_failurePoint == FAIL_IN_PREPARE)
+ _passed = true;
+ }
+
+ public void commitOnePhase () throws WrongStateException, SystemException
+ {
+ _resolved = true;
+ System.out.println("FailureParticipant.commitOnePhase");
+
+ if (_failurePoint == FAIL_IN_ONE_PHASE)
+ generateException();
+
+ _passed = true;
+ }
+
+ public void unknown () throws SystemException
+ {
+ }
+
+ public void error () throws SystemException
+ {
+ }
+
+ private void generateException () throws WrongStateException, SystemException
+ {
+ switch (_failureType)
+ {
+ case WRONG_STATE:
+ throw new WrongStateException();
+ case SYSTEM:
+ throw new SystemException();
+ default:
+ break;
+ }
+ }
+
+ private int _failurePoint;
+ private int _failureType;
+ private boolean _passed;
+ private boolean _prepared;
+ private boolean _resolved;
+
+}
+
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Cancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Cancel.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Cancel.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.ba;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class Cancel
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Close.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Close.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Close.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.ba;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class Close
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Compensate.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Compensate.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Compensate.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.ba;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class Compensate
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/ConfirmWithComplete.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/ConfirmWithComplete.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/ConfirmWithComplete.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.ba;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.common.DemoBusinessParticipantWithComplete;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class ConfirmWithComplete
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Exit.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Exit.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/Exit.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.ba;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class Exit
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiCancel.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiCancel.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiCancel.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.ba;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst.tests.common.FailureBusinessParticipant;
+import com.arjuna.wst.SystemException;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class MultiCancel
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiClose.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiClose.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiClose.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.ba;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst.tests.common.FailureBusinessParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class MultiClose
+{
+ public 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;
+ }
+ // the close should succeed even though the participant fails
+ uba.close();
+ assertTrue(p.passed());
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiCompensate.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiCompensate.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/ba/MultiCompensate.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.ba;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.BusinessActivityManager;
+import com.arjuna.mw.wst11.UserBusinessActivity;
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst.tests.common.FailureBusinessParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class MultiCompensate
+{
+ public 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;
+ }
+ // the cancel/compensate should succeed even though the participant fails to compensate
+ uba.cancel();
+ assertTrue(p.passed());
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/CommitExceptionInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/CommitExceptionInPrepare.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/CommitExceptionInPrepare.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,86 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class CommitExceptionInPrepare
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/CommitRollbackInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/CommitRollbackInPrepare.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/CommitRollbackInPrepare.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class CommitRollbackInPrepare
+{
+
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/MultiParticipants.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/MultiParticipants.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/MultiParticipants.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class MultiParticipants
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NestedTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NestedTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NestedTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,86 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.UserTransaction;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class NestedTransaction
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NullCommitTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NullCommitTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NullCommitTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,56 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.UserTransaction;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class NullCommitTransaction
+{
+ public void testNullCommitTransaction()
+ throws Exception
+ {
+ UserTransaction ut = UserTransaction.getUserTransaction();
+
+ ut.begin();
+
+ ut.commit();
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NullRollbackTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NullRollbackTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/NullRollbackTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,57 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.UserTransaction;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class NullRollbackTransaction
+{
+
+ public void testNullRollbackTransaction()
+ throws Exception
+ {
+ UserTransaction ut = UserTransaction.getUserTransaction();
+
+ ut.begin();
+
+ ut.rollback();
+ }
+}
\ No newline at end of file
Copied: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/PrintTransaction.java (from rev 37713, labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/junit/basic/PrintTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/PrintTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/PrintTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,61 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.UserTransaction;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class PrintTransaction
+{
+
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/ResumeNullTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/ResumeNullTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/ResumeNullTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class ResumeNullTransaction
+{
+
+ public void testResumeNullTransaction()
+ throws Exception
+ {
+ TransactionManager ut = TransactionManager.getTransactionManager();
+
+ ut.resume(null);
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/RollbackExceptionInRollback.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/RollbackExceptionInRollback.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/RollbackExceptionInRollback.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class RollbackExceptionInRollback
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SingleParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SingleParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SingleParticipant.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,69 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class SingleParticipant
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommit.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommit.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommit.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,73 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2008,
+ * @author JBoss Inc.
+ */
+
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.DemoVolatileParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id: $
+ */
+
+ at Named
+public class SubtransactionCommit
+{
+
+ public void testSubTransactionCommit()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
+ final TransactionManager tm = TransactionManager.getTransactionManager();
+
+ final DemoDurableParticipant p1 = new DemoDurableParticipant();
+ final DemoVolatileParticipant p2 = new DemoVolatileParticipant();
+ final DemoDurableParticipant p3 = new DemoDurableParticipant();
+ final DemoVolatileParticipant p4 = new DemoVolatileParticipant();
+
+ ut.begin();
+ final TxContext tx = tm.suspend();
+ tm.resume(tx);
+ tm.enlistForDurableTwoPhase(p1, p1.identifier());
+ tm.enlistForVolatileTwoPhase(p2, p2.identifier());
+ ust.begin();
+ final TxContext stx = tm.suspend();
+ tm.resume(stx);
+ tm.enlistForDurableTwoPhase(p3, p3.identifier());
+ tm.enlistForVolatileTwoPhase(p4, p4.identifier());
+
+ tm.resume(tx);
+ ut.commit();
+ assertTrue(p1.prepared() && p1.resolved() && p1.passed());
+ assertTrue(p2.prepared() && p2.resolved() && p2.passed());
+ assertTrue(p3.prepared() && p3.resolved() && p3.passed());
+ assertTrue(p4.prepared() && p4.resolved() && p4.passed());
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitFailInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitFailInPrepare.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitFailInPrepare.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,81 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2008,
+ * @author JBoss Inc.
+ */
+
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.DemoVolatileParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import com.arjuna.wst.TransactionRolledBackException;
+import static org.junit.Assert.*;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id:$
+ * @since 1.0.
+ */
+
+ at Named
+public class SubtransactionCommitFailInPrepare
+{
+
+ public void testSubTransactionCommitFailInPrepare()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
+ final TransactionManager tm = TransactionManager.getTransactionManager();
+
+ final DemoDurableParticipant p1 = new DemoDurableParticipant();
+ final DemoVolatileParticipant p2 = new DemoVolatileParticipant();
+ final FailureParticipant p3 = new FailureParticipant(FailureParticipant.FAIL_IN_PREPARE, FailureParticipant.WRONG_STATE);
+ final DemoVolatileParticipant p4 = new DemoVolatileParticipant();
+
+ ut.begin();
+ final TxContext tx = tm.suspend();
+ tm.resume(tx);
+ tm.enlistForDurableTwoPhase(p1, p1.identifier());
+ tm.enlistForVolatileTwoPhase(p2, p2.identifier());
+ ust.begin();
+ final TxContext stx = tm.suspend();
+ tm.resume(stx);
+ tm.enlistForDurableTwoPhase(p3, "failure in prepare");
+ tm.enlistForVolatileTwoPhase(p4, p4.identifier());
+
+ tm.resume(tx);
+ try {
+ ut.commit();
+ fail("expecting TransactionRolledBackException");
+ } catch (TransactionRolledBackException wse) {
+ // expect this
+ }
+ assertTrue(p1.prepared() && p1.resolved() && !p1.passed());
+ assertTrue(p2.prepared() && p2.resolved() && !p2.passed());
+ assertTrue(!p3.passed());
+ assertTrue(p4.prepared() && p4.resolved() && !p4.passed());
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitRollbackInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitRollbackInPrepare.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitRollbackInPrepare.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,80 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2008,
+ * @author JBoss Inc.
+ */
+
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.DemoVolatileParticipant;
+import com.arjuna.wst.TransactionRolledBackException;
+import static org.junit.Assert.*;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id:$
+ */
+
+ at Named
+public class SubtransactionCommitRollbackInPrepare
+{
+
+ public void testSubTransactionCommitRollbackInPrepare()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
+ final TransactionManager tm = TransactionManager.getTransactionManager();
+
+ final DemoDurableParticipant p1 = new DemoDurableParticipant();
+ final DemoVolatileParticipant p2 = new DemoVolatileParticipant();
+ final FailureParticipant p3 = new FailureParticipant(FailureParticipant.FAIL_IN_PREPARE, FailureParticipant.NONE);
+ final DemoVolatileParticipant p4 = new DemoVolatileParticipant();
+
+ ut.begin();
+ final TxContext tx = tm.suspend();
+ tm.resume(tx);
+ tm.enlistForDurableTwoPhase(p1, p1.identifier());
+ tm.enlistForVolatileTwoPhase(p2, p2.identifier());
+ ust.begin();
+ final TxContext stx = tm.suspend();
+ tm.resume(stx);
+ tm.enlistForDurableTwoPhase(p3, "failure in prepare");
+ tm.enlistForVolatileTwoPhase(p4, p4.identifier());
+
+ tm.resume(tx);
+ try {
+ ut.commit();
+ fail("expecting TransactionRolledBackException");
+ } catch (TransactionRolledBackException trbe) {
+ // expect this
+ }
+ assertTrue(p1.prepared() && p1.resolved() && !p1.passed());
+ assertTrue(p2.prepared() && p2.resolved() && !p2.passed());
+ assertTrue(!p3.passed());
+ assertTrue(p4.prepared() && p4.resolved() && !p4.passed());
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionRollback.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionRollback.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SubtransactionRollback.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,74 @@
+/*
+ * JBoss, Home of Professional Open Source
+ * Copyright 2008, 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 along with this distribution; if not, write to the Free Software
+ * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+ * MA 02110-1301, USA.
+ *
+ * (C) 2008,
+ * @author JBoss Inc.
+ */
+
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserTransactionFactory;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.DemoVolatileParticipant;
+import static org.junit.Assert.*;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id:$
+ */
+
+ at Named
+public class SubtransactionRollback
+{
+
+ public void testSubTransactionRollback()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransactionFactory.userTransaction();
+ final UserTransaction ust = UserTransactionFactory.userSubordinateTransaction();
+ final TransactionManager tm = TransactionManager.getTransactionManager();
+
+ final DemoDurableParticipant p1 = new DemoDurableParticipant();
+ final DemoVolatileParticipant p2 = new DemoVolatileParticipant();
+ final DemoDurableParticipant p3 = new DemoDurableParticipant();
+ final DemoVolatileParticipant p4 = new DemoVolatileParticipant();
+
+ ut.begin();
+ final TxContext tx = tm.suspend();
+ tm.resume(tx);
+ tm.enlistForDurableTwoPhase(p1, p1.identifier());
+ tm.enlistForVolatileTwoPhase(p2, p2.identifier());
+ ust.begin();
+ final TxContext stx = tm.suspend();
+ tm.resume(stx);
+ tm.enlistForDurableTwoPhase(p3, p3.identifier());
+ tm.enlistForVolatileTwoPhase(p4, p4.identifier());
+
+ tm.resume(tx);
+ ut.rollback();
+
+ assertTrue(p1.resolved() && !p1.passed());
+ assertTrue(p2.resolved() && !p2.passed());
+ assertTrue(p3.resolved() && !p3.passed());
+ assertTrue(p4.resolved() && !p4.passed());
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendCommitTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendCommitTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendCommitTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class SuspendCommitTransaction
+{
+
+ public 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 (WrongStateException ex)
+ {
+ // we should arrive here
+ }
+ }
+}
\ No newline at end of file
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendNullTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendNullTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendNullTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import static org.junit.Assert.*;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class SuspendNullTransaction
+{
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeCommitTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeCommitTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeCommitTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class SuspendResumeCommitTransaction
+{
+
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeParticipants.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeParticipants.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeParticipants.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class SuspendResumeParticipants
+{
+
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeSingleParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeSingleParticipant.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeSingleParticipant.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,78 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class SuspendResumeSingleParticipant
+{
+
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/SuspendTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,62 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.mw.wst11.UserTransaction;
+
+/**
+ * @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.
+ */
+
+ at Named
+public class SuspendTransaction
+{
+
+ public 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/ThreadedTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/ThreadedTransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/main/java/com/arjuna/wst11/tests/arq/basic/ThreadedTransaction.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.arq.basic;
+
+import javax.inject.Named;
+
+import com.arjuna.mw.wst11.UserTransaction;
+
+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;
+ }
+ }
+
+}
+
+ at Named
+public class ThreadedTransaction
+{
+
+ public void testThreadedTransaction()
+ throws Exception
+ {
+ 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
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/WarDeployment.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/WarDeployment.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/WarDeployment.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,24 @@
+package com.arjuna.wst11.tests.arq;
+
+import org.jboss.shrinkwrap.api.ArchivePaths;
+import org.jboss.shrinkwrap.api.ShrinkWrap;
+import org.jboss.shrinkwrap.api.asset.EmptyAsset;
+import org.jboss.shrinkwrap.api.asset.StringAsset;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+
+public class WarDeployment {
+ public static WebArchive getDeployment(Class<?>...args){
+ WebArchive archive = ShrinkWrap
+ .create(WebArchive.class, "test.war")
+ .addClasses(args)
+ .addAsWebInfResource(EmptyAsset.INSTANCE, "beans.xml");
+
+ archive.delete(ArchivePaths.create("META-INF/MANIFEST.MF"));
+
+ final String ManifestMF = "Manifest-Version: 1.0\n"
+ + "Dependencies: org.jboss.modules,deployment.arquillian-service,org.jboss.msc,org.jboss.jts,org.jboss.xts\n";
+ archive.setManifest(new StringAsset(ManifestMF));
+
+ return archive;
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CancelTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CancelTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CancelTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,30 @@
+package com.arjuna.wst11.tests.arq.ba;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class CancelTest {
+ @Inject
+ Cancel test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ Cancel.class,
+ DemoBusinessParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testCancel();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CloseTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CloseTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CloseTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,30 @@
+package com.arjuna.wst11.tests.arq.ba;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class CloseTest {
+ @Inject
+ Close test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ Close.class,
+ DemoBusinessParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testClose();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CompensateTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CompensateTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/CompensateTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,30 @@
+package com.arjuna.wst11.tests.arq.ba;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class CompensateTest {
+ @Inject
+ Compensate test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ Compensate.class,
+ DemoBusinessParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testCompensate();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/ConfirmWithCompleteTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/ConfirmWithCompleteTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/ConfirmWithCompleteTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,33 @@
+package com.arjuna.wst11.tests.arq.ba;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst.tests.common.DemoBusinessParticipantWithComplete;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class ConfirmWithCompleteTest {
+ @Inject
+ ConfirmWithComplete test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ ConfirmWithComplete.class,
+ DemoBusinessParticipant.class,
+ DemoBusinessParticipantWithComplete.class);
+ }
+
+
+ @Test
+ public void test() throws Exception {
+ test.testConfirmWithComplete();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/ExitTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/ExitTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/ExitTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,30 @@
+package com.arjuna.wst11.tests.arq.ba;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class ExitTest {
+ @Inject
+ Exit test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ Exit.class,
+ DemoBusinessParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testExit();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCancelTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCancelTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCancelTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,32 @@
+package com.arjuna.wst11.tests.arq.ba;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst.tests.common.FailureBusinessParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class MultiCancelTest {
+ @Inject
+ MultiCancel test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ MultiCancel.class,
+ DemoBusinessParticipant.class,
+ FailureBusinessParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testMultiCancel();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCloseTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCloseTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCloseTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,32 @@
+package com.arjuna.wst11.tests.arq.ba;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst.tests.common.FailureBusinessParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class MultiCloseTest {
+ @Inject
+ MultiClose test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ MultiClose.class,
+ DemoBusinessParticipant.class,
+ FailureBusinessParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testMultiClose();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCompensateTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCompensateTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/ba/MultiCompensateTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,32 @@
+package com.arjuna.wst11.tests.arq.ba;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoBusinessParticipant;
+import com.arjuna.wst.tests.common.FailureBusinessParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class MultiCompensateTest {
+ @Inject
+ MultiCompensate test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ MultiCompensate.class,
+ DemoBusinessParticipant.class,
+ FailureBusinessParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testMultiCompensate();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/CommitExceptionInPrepareTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/CommitExceptionInPrepareTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/CommitExceptionInPrepareTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,32 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class CommitExceptionInPrepareTest {
+ @Inject
+ CommitExceptionInPrepare test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ CommitExceptionInPrepare.class,
+ DemoDurableParticipant.class,
+ FailureParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testCommitExceptionInPrepare();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/CommitRollbackInPrepareTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/CommitRollbackInPrepareTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/CommitRollbackInPrepareTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,32 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class CommitRollbackInPrepareTest {
+ @Inject
+ CommitRollbackInPrepare test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ CommitRollbackInPrepare.class,
+ DemoDurableParticipant.class,
+ FailureParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testCommitRollbackInPrepare();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/MultiParticipantsTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/MultiParticipantsTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/MultiParticipantsTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,30 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class MultiParticipantsTest {
+ @Inject
+ MultiParticipants test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ MultiParticipants.class,
+ DemoDurableParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testMultiParticipants();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NestedTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NestedTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NestedTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,27 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class NestedTransactionTest {
+ @Inject
+ NestedTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(NestedTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testNestedTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NullCommitTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NullCommitTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NullCommitTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,27 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class NullCommitTransactionTest {
+ @Inject
+ NullCommitTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(NullCommitTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testNullCommitTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NullRollbackTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NullRollbackTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/NullRollbackTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,27 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class NullRollbackTransactionTest {
+ @Inject
+ NullRollbackTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(NullRollbackTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testNullRollbackTransaction();
+ }
+}
Copied: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/PrintTransactionTest.java (from rev 37713, labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/junit/basic/PrintTransactionTest.java)
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/PrintTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/PrintTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,48 @@
+/*
+ * 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 Lesser General Public License, v. 2.1.
+ * 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 Lesser General Public License for more details.
+ * You should have received a copy of the GNU Lesser General Public License,
+ * v.2.1 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.
+ */
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.junit.Test;
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class PrintTransactionTest
+{
+ @Inject
+ PrintTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(PrintTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testPrintTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/ResumeNullTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/ResumeNullTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/ResumeNullTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,27 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class ResumeNullTransactionTest {
+ @Inject
+ ResumeNullTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(ResumeNullTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testResumeNullTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/RollbackExceptionInRollbackTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/RollbackExceptionInRollbackTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/RollbackExceptionInRollbackTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,32 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class RollbackExceptionInRollbackTest {
+ @Inject
+ RollbackExceptionInRollback test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ RollbackExceptionInRollback.class,
+ DemoDurableParticipant.class,
+ FailureParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testRollbackExceptionInRollback();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SingleParticipantTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SingleParticipantTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SingleParticipantTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,30 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SingleParticipantTest {
+ @Inject
+ SingleParticipant test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ SingleParticipant.class,
+ DemoDurableParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSingleParticipant();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitFailInPrepareTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitFailInPrepareTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitFailInPrepareTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,34 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.DemoVolatileParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SubtransactionCommitFailInPrepareTest {
+ @Inject
+ SubtransactionCommitFailInPrepare test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ SubtransactionCommitFailInPrepare.class,
+ DemoDurableParticipant.class,
+ DemoVolatileParticipant.class,
+ FailureParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSubTransactionCommitFailInPrepare();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitRollbackInPrepareTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitRollbackInPrepareTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitRollbackInPrepareTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,34 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.DemoVolatileParticipant;
+import com.arjuna.wst.tests.common.FailureParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SubtransactionCommitRollbackInPrepareTest {
+ @Inject
+ SubtransactionCommitRollbackInPrepare test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ SubtransactionCommitRollbackInPrepare.class,
+ FailureParticipant.class,
+ DemoDurableParticipant.class,
+ DemoVolatileParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSubTransactionCommitRollbackInPrepare();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionCommitTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,32 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.DemoVolatileParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SubtransactionCommitTest {
+ @Inject
+ SubtransactionCommit test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ SubtransactionCommit.class,
+ DemoDurableParticipant.class,
+ DemoVolatileParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSubTransactionCommit();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionRollbackTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionRollbackTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SubtransactionRollbackTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,32 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst.tests.common.DemoVolatileParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SubtransactionRollbackTest {
+ @Inject
+ SubtransactionRollback test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ SubtransactionRollback.class,
+ DemoDurableParticipant.class,
+ DemoVolatileParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSubTransactionRollback();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendCommitTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendCommitTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendCommitTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,27 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SuspendCommitTransactionTest {
+ @Inject
+ SuspendCommitTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(SuspendCommitTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSuspendCommitTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendNullTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendNullTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendNullTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,27 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SuspendNullTransactionTest {
+ @Inject
+ SuspendNullTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(SuspendNullTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSuspendNullTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeCommitTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeCommitTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeCommitTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,27 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SuspendResumeCommitTransactionTest {
+ @Inject
+ SuspendResumeCommitTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(SuspendResumeCommitTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSuspendResumeCommitTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeParticipantsTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeParticipantsTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeParticipantsTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,30 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SuspendResumeParticipantsTest {
+ @Inject
+ SuspendResumeParticipants test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ SuspendResumeParticipants.class,
+ DemoDurableParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSuspendResumeParticipants();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeSingleParticipantTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeSingleParticipantTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendResumeSingleParticipantTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,30 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst.tests.common.DemoDurableParticipant;
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SuspendResumeSingleParticipantTest {
+ @Inject
+ SuspendResumeSingleParticipant test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ SuspendResumeSingleParticipant.class,
+ DemoDurableParticipant.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSuspendResumeSingleParticipant();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/SuspendTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,27 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class SuspendTransactionTest {
+ @Inject
+ SuspendTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(SuspendTransaction.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testSuspendTransaction();
+ }
+}
Added: labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/ThreadedTransactionTest.java
===================================================================
--- labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/ThreadedTransactionTest.java (rev 0)
+++ labs/jbosstm/trunk/XTS/localjunit/WSTX/src/test/java/com/arjuna/wst11/tests/arq/basic/ThreadedTransactionTest.java 2011-11-10 06:37:16 UTC (rev 37714)
@@ -0,0 +1,29 @@
+package com.arjuna.wst11.tests.arq.basic;
+
+import javax.inject.Inject;
+
+import org.jboss.arquillian.container.test.api.Deployment;
+import org.jboss.arquillian.junit.Arquillian;
+import org.jboss.shrinkwrap.api.spec.WebArchive;
+import org.junit.Test;
+import org.junit.runner.RunWith;
+
+import com.arjuna.wst11.tests.arq.WarDeployment;
+
+ at RunWith(Arquillian.class)
+public class ThreadedTransactionTest {
+ @Inject
+ ThreadedTransaction test;
+
+ @Deployment
+ public static WebArchive createDeployment() {
+ return WarDeployment.getDeployment(
+ ThreadedTransaction.class,
+ ThreadedObject.class);
+ }
+
+ @Test
+ public void test() throws Exception {
+ test.testThreadedTransaction();
+ }
+}
More information about the jboss-svn-commits
mailing list