[jboss-svn-commits] JBL Code SVN: r24225 - in labs/jbosstm/trunk/XTS: WS-T/dev/src10/com/arjuna/wst/stub and 11 other directories.
jboss-svn-commits at lists.jboss.org
jboss-svn-commits at lists.jboss.org
Wed Dec 3 05:18:01 EST 2008
Author: adinn
Date: 2008-12-03 05:18:01 -0500 (Wed, 03 Dec 2008)
New Revision: 24225
Added:
labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateDurable2PCStub.java
labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateVolatile2PCStub.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java
Removed:
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubTransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubTransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubTransaction.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubTransactionImple.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommit.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitFailInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionRollback.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommit.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitFailInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionRollback.java
Modified:
labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ActivationCoordinator.java
labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java
labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java
labs/jbosstm/trunk/XTS/WSTX/config/wst.xml
labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/FailureBusinessParticipant.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java
labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/WSTX11TestSuite.java
Log:
WS-AT 1.0 subtransaction implementation and accompanying test code - fixes for JBTM-409
Modified: labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ActivationCoordinator.java
===================================================================
--- labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ActivationCoordinator.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WS-C/dev/src10/com/arjuna/wsc/ActivationCoordinator.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -69,7 +69,7 @@
try
{
ActivationCoordinatorClient.getClient().sendCreateCoordination(addressingContext,
- coordinationTypeURI, expiresValue, null) ;
+ coordinationTypeURI, expiresValue, currentContext) ;
callback.waitUntilTriggered() ;
}
catch (final IOException ioe)
Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateDurable2PCStub.java (from rev 24206, labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/SubordinateDurable2PCStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateDurable2PCStub.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateDurable2PCStub.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,81 @@
+package com.arjuna.wst.stub;
+
+import com.arjuna.wst.*;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateCoordinator;
+import com.arjuna.ats.arjuna.coordinator.TwoPhaseOutcome;
+
+/**
+ * A durable participant registered on behalf of an interposed WS-AT coordinator in order to ensure that
+ * durable participants in the subtransaction prepared, committed and aborted at the right time.
+ */
+public class SubordinateDurable2PCStub implements Durable2PCParticipant
+{
+ public SubordinateDurable2PCStub(SubordinateCoordinator coordinator)
+ {
+ this.coordinator = coordinator;
+ }
+
+ /**
+ * This will be called when the parent coordinator is preparing its durable participants and should ensure
+ * that the interposed cooordinator does the same.
+ *
+ * @return the Vote returned by the subordinate coordinator.
+ * @throws com.arjuna.wst.WrongStateException if the subordinate coordinator does the same
+ * @throws com.arjuna.wst.SystemException if the subordinate coordinator does the same
+ */
+ public Vote prepare() throws WrongStateException, SystemException {
+ switch (coordinator.prepare())
+ {
+ case TwoPhaseOutcome.PREPARE_OK:
+ return new Prepared();
+ case TwoPhaseOutcome.PREPARE_READONLY:
+ return new ReadOnly();
+ case TwoPhaseOutcome.PREPARE_NOTOK:
+ default:
+ return new Aborted();
+ }
+ }
+
+ /**
+ * this will be called when the parent coordinator commits its durable participants and should ensure
+ * that the interposed cooordinator does the same
+ * @throws com.arjuna.wst.WrongStateException
+ * @throws com.arjuna.wst.SystemException
+ */
+
+ public void commit() throws WrongStateException, SystemException {
+ coordinator.commit();
+ }
+
+ /**
+ * this will be called when the parent coordinator rolls back its durable participants and should ensure
+ * that the interposed cooordinator does the same
+ * @throws com.arjuna.wst.WrongStateException
+ * @throws com.arjuna.wst.SystemException
+ */
+
+ public void rollback() throws WrongStateException, SystemException {
+ coordinator.rollback();
+ }
+
+ /**
+ * this should never get called
+ * @throws com.arjuna.wst.SystemException
+ */
+ public void unknown() throws SystemException {
+ coordinator.unknown();
+ }
+
+ /**
+ * this should never get called
+ * @throws com.arjuna.wst.SystemException
+ */
+ public void error() throws SystemException {
+ coordinator.error();
+ }
+
+ /**
+ * the interposed coordinator
+ */
+ private SubordinateCoordinator coordinator;
+}
\ No newline at end of file
Property changes on: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateDurable2PCStub.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateVolatile2PCStub.java (from rev 24206, labs/jbosstm/trunk/XTS/WS-T/dev/src11/com/arjuna/wst11/stub/SubordinateVolatile2PCStub.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateVolatile2PCStub.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateVolatile2PCStub.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,73 @@
+package com.arjuna.wst.stub;
+
+import com.arjuna.wst.*;
+import com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateCoordinator;
+
+/**
+ * A volatile participant registered on behalf of an interposed WS-AT coordinator in order to ensure that
+ * volatile participants in the subtransaction are prepared at the right time.
+ */
+public class SubordinateVolatile2PCStub implements Volatile2PCParticipant
+{
+ public SubordinateVolatile2PCStub(SubordinateCoordinator coordinator)
+ {
+ this.coordinator = coordinator;
+ }
+
+ /**
+ * This will be called when the parent coordinator is preparing its volatile participants and should ensure
+ * that the interposed cooordinator does the same.
+ *
+ * @return the Vote returned by the subordinate coordinator.
+ * @throws com.arjuna.wst.WrongStateException if the subordinate coordinator does the same
+ * @throws com.arjuna.wst.SystemException if the subordinate coordinator does the same
+ */
+ public Vote prepare() throws WrongStateException, SystemException {
+ if (coordinator.prepareVolatile()) {
+ return new Prepared();
+ } else {
+ return new Aborted();
+ }
+ }
+
+ /**
+ * this is called as part of the after completion processing and should ensure that the interposed
+ * coordinator performs its afterCompletion processing
+ * @throws com.arjuna.wst.WrongStateException
+ * @throws com.arjuna.wst.SystemException
+ */
+
+ public void commit() throws WrongStateException, SystemException {
+ coordinator.commitVolatile();
+ }
+
+ /**
+ * this is called as part of the after completion processing and should ensure that the interposed
+ * coordinator performs its afterCompletion processing
+ * @throws com.arjuna.wst.WrongStateException
+ * @throws com.arjuna.wst.SystemException
+ */
+
+ public void rollback() throws WrongStateException, SystemException {
+ coordinator.rollbackVolatile();
+ }
+
+ /**
+ * this should never get called
+ * @throws com.arjuna.wst.SystemException
+ */
+ public void unknown() throws SystemException {
+ }
+
+ /**
+ * this should never get called
+ * @throws com.arjuna.wst.SystemException
+ */
+ public void error() throws SystemException {
+ }
+
+ /**
+ * the interposed coordinator
+ */
+ private SubordinateCoordinator coordinator;
+}
\ No newline at end of file
Property changes on: labs/jbosstm/trunk/XTS/WS-T/dev/src10/com/arjuna/wst/stub/SubordinateVolatile2PCStub.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubTransaction.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubTransaction.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,62 +0,0 @@
-/*
- * 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.mw.wst;
-
-/**
- * This is the interface that allows transactions to be started and terminated.
- * The messaging layer converts the Commit, Rollback and Notify messages into
- * calls on this.
- * Importantly, a UserTransaction does not represent a specific transaction,
- * but rather is responsible for providing access to an implicit per-thread
- * transaction context; it is similar to the UserTransaction in the JTA
- * specification. Therefore, all of the UserTransaction methods implicitly act
- * on the current thread of control.
- *
- * @author Andrew Dinn
- * @version $Id:$
- */
-
-public abstract class UserSubTransaction extends UserTransaction
-{
- /**
- * The transaction.
- */
- private static UserTransaction USER_TRANSACTION ;
-
- /**
- * Get the user transaction.
- * @return the user transaction.
- */
- public static synchronized UserTransaction getUserTransaction()
- {
- return USER_TRANSACTION ;
- }
-
- /**
- * Set the user transaction.
- * @param userTransaction The user transaction.
- */
- public static synchronized void setUserTransaction(final UserTransaction userTransaction)
- {
- USER_TRANSACTION = userTransaction ;
- }
-}
\ No newline at end of file
Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,62 @@
+/*
+ * 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.mw.wst;
+
+/**
+ * This is the interface that allows transactions to be started and terminated.
+ * The messaging layer converts the Commit, Rollback and Notify messages into
+ * calls on this.
+ * Importantly, a UserTransaction does not represent a specific transaction,
+ * but rather is responsible for providing access to an implicit per-thread
+ * transaction context; it is similar to the UserTransaction in the JTA
+ * specification. Therefore, all of the UserTransaction methods implicitly act
+ * on the current thread of control.
+ *
+ * @author Andrew Dinn
+ * @version $Id:$
+ */
+
+public abstract class UserSubtransaction extends UserTransaction
+{
+ /**
+ * The transaction.
+ */
+ private static UserTransaction USER_TRANSACTION ;
+
+ /**
+ * Get the user transaction.
+ * @return the user transaction.
+ */
+ public static synchronized UserTransaction getUserTransaction()
+ {
+ return USER_TRANSACTION ;
+ }
+
+ /**
+ * Set the user transaction.
+ * @param userTransaction The user transaction.
+ */
+ public static synchronized void setUserTransaction(final UserTransaction userTransaction)
+ {
+ USER_TRANSACTION = userTransaction ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/UserSubtransaction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mw/wst/deploy/WSTXInitialisation.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -126,7 +126,7 @@
final Element docElem = doc.getDocumentElement() ;
final String userTx = getService(docElem, "UserTransaction") ;
- final String userSubTx = getService(docElem, "UserSubTransaction") ;
+ final String userSubTx = getService(docElem, "UserSubtransaction") ;
final String txManager = getService(docElem, "TransactionManager") ;
final String userBa = getService(docElem, "UserBusinessActivity") ;
final String baManager = getService(docElem, "BusinessActivityManager") ;
@@ -136,7 +136,7 @@
throw new FileNotFoundException(wstxLogger.log_mesg.getString("com.arjuna.mw.wst.deploy.WSTXI_23"));
}
UserTransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userTx).newInstance()) ;
- UserSubTransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userSubTx).newInstance()) ;
+ UserSubtransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userSubTx).newInstance()) ;
TransactionManager.setTransactionManager((TransactionManager)ClassLoaderHelper.forName(getClass(), txManager).newInstance()) ;
UserBusinessActivity.setUserBusinessActivity((UserBusinessActivity)ClassLoaderHelper.forName(getClass(), userBa).newInstance()) ;
BusinessActivityManager.setBusinessActivityManager((BusinessActivityManager)ClassLoaderHelper.forName(getClass(), baManager).newInstance()) ;
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubTransactionImple.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubTransactionImple.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,164 +0,0 @@
-package com.arjuna.mwlabs.wst.at.remote;
-
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mw.wsc.context.Context;
-import com.arjuna.mwlabs.wst.at.ContextImple;
-import com.arjuna.mwlabs.wst.at.context.TxContextImple;
-import com.arjuna.webservices.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.webservices.wscoor.CoordinationContextType;
-import com.arjuna.wsc.ActivationCoordinator;
-import com.arjuna.wsc.InvalidCreateParametersException;
-import com.arjuna.wsc.messaging.MessageId;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-
-/**
- * @message com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1
- * [com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1] - Received
- * context is null!
- */
-public class UserSubTransactionImple extends UserTransactionImple
-{
-
- public UserSubTransactionImple()
- {
- super();
- }
-
- public void begin () throws WrongStateException, SystemException
- {
- begin(0);
- }
-
- public void begin (int timeout) throws WrongStateException, SystemException
- {
- try
- {
- if (_ctxManager.currentTransaction() == null)
- throw new WrongStateException();
-
- Context ctx = startTransaction(timeout);
-
- _ctxManager.resume(new TxContextImple(ctx));
- }
- catch (InvalidCreateParametersException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (UnknownTransactionException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (SystemException ex)
- {
- tidyup();
-
- throw ex;
- }
- }
-
- public void commit () throws TransactionRolledBackException,
- UnknownTransactionException, SecurityException, SystemException, WrongStateException
- {
- tidyup();
- throw new WrongStateException();
- }
-
- public void rollback () throws UnknownTransactionException, SecurityException, SystemException, WrongStateException
- {
- tidyup();
- throw new WrongStateException();
- }
-
- public String transactionIdentifier ()
- {
- try
- {
- return _ctxManager.currentTransaction().toString();
- }
- catch (SystemException ex)
- {
- return "Unknown";
- }
- catch (NullPointerException ex)
- {
- return "Unknown";
- }
- }
-
- public String toString ()
- {
- return transactionIdentifier();
- }
-
- /*
- * Not sure if this is right as it doesn't map to registering a participant
- * with the coordinator.
- */
-
- private final Context startTransaction(int timeout)
- throws InvalidCreateParametersException,
- SystemException
- {
- try
- {
- // TODO: tricks for per app _activationCoordinatorService config, perhaps:
- //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
-
-
-
- final CoordinationContextType current = currentCoordinationContext();
- final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
- final String messageId = MessageId.getMessageId() ;
- final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
- _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, current) ;
- if (coordinationContext == null)
- {
- throw new SystemException(
- wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1"));
- }
- return new ContextImple(coordinationContext) ;
- }
- catch (final InvalidCreateParametersException icpe)
- {
- throw icpe ;
- }
- catch (final SoapFault sf)
- {
- throw new SystemException(sf.getMessage()) ;
- }
- catch (final Exception ex)
- {
- throw new SystemException(ex.toString());
- }
- }
-
- /**
- * get a CoordinationContext based on the one stasahed away in the current TxContext
- */
- public CoordinationContextType currentCoordinationContext() throws SystemException
- {
- final TxContextImple txContext = (TxContextImple)_ctxManager.currentTransaction();
- final CoordinationContextType current = txContext.context().getCoordinationContext();
- return current;
- }
-
- private final void tidyup ()
- {
- try
- {
- _ctxManager.suspend();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
\ No newline at end of file
Copied: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubTransactionImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,164 @@
+package com.arjuna.mwlabs.wst.at.remote;
+
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mw.wsc.context.Context;
+import com.arjuna.mwlabs.wst.at.ContextImple;
+import com.arjuna.mwlabs.wst.at.context.TxContextImple;
+import com.arjuna.webservices.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.webservices.wscoor.CoordinationContextType;
+import com.arjuna.wsc.ActivationCoordinator;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wsc.messaging.MessageId;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * @message com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1
+ * [com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1] - Received
+ * context is null!
+ */
+public class UserSubtransactionImple extends UserTransactionImple
+{
+
+ public UserSubtransactionImple()
+ {
+ super();
+ }
+
+ public void begin () throws WrongStateException, SystemException
+ {
+ begin(0);
+ }
+
+ public void begin (int timeout) throws WrongStateException, SystemException
+ {
+ try
+ {
+ if (_ctxManager.currentTransaction() == null)
+ throw new WrongStateException();
+
+ Context ctx = startTransaction(timeout);
+
+ _ctxManager.resume(new TxContextImple(ctx));
+ }
+ catch (InvalidCreateParametersException ex)
+ {
+ tidyup();
+
+ throw new SystemException(ex.toString());
+ }
+ catch (UnknownTransactionException ex)
+ {
+ tidyup();
+
+ throw new SystemException(ex.toString());
+ }
+ catch (SystemException ex)
+ {
+ tidyup();
+
+ throw ex;
+ }
+ }
+
+ public void commit () throws TransactionRolledBackException,
+ UnknownTransactionException, SecurityException, SystemException, WrongStateException
+ {
+ tidyup();
+ throw new WrongStateException();
+ }
+
+ public void rollback () throws UnknownTransactionException, SecurityException, SystemException, WrongStateException
+ {
+ tidyup();
+ throw new WrongStateException();
+ }
+
+ public String transactionIdentifier ()
+ {
+ try
+ {
+ return _ctxManager.currentTransaction().toString();
+ }
+ catch (SystemException ex)
+ {
+ return "Unknown";
+ }
+ catch (NullPointerException ex)
+ {
+ return "Unknown";
+ }
+ }
+
+ public String toString ()
+ {
+ return transactionIdentifier();
+ }
+
+ /*
+ * Not sure if this is right as it doesn't map to registering a participant
+ * with the coordinator.
+ */
+
+ private final Context startTransaction(int timeout)
+ throws InvalidCreateParametersException,
+ SystemException
+ {
+ try
+ {
+ // TODO: tricks for per app _activationCoordinatorService config, perhaps:
+ //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
+
+
+
+ final CoordinationContextType current = currentCoordinationContext();
+ final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
+ final String messageId = MessageId.getMessageId() ;
+ final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
+ _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, current) ;
+ if (coordinationContext == null)
+ {
+ throw new SystemException(
+ wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple_1"));
+ }
+ return new ContextImple(coordinationContext) ;
+ }
+ catch (final InvalidCreateParametersException icpe)
+ {
+ throw icpe ;
+ }
+ catch (final SoapFault sf)
+ {
+ throw new SystemException(sf.getMessage()) ;
+ }
+ catch (final Exception ex)
+ {
+ throw new SystemException(ex.toString());
+ }
+ }
+
+ /**
+ * get a CoordinationContext based on the one stasahed away in the current TxContext
+ */
+ public CoordinationContextType currentCoordinationContext() throws SystemException
+ {
+ final TxContextImple txContext = (TxContextImple)_ctxManager.currentTransaction();
+ final CoordinationContextType current = txContext.context().getCoordinationContext();
+ return current;
+ }
+
+ private final void tidyup ()
+ {
+ try
+ {
+ _ctxManager.suspend();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/trunk/XTS/WSTX/classes10/com/arjuna/mwlabs/wst/at/remote/UserSubtransactionImple.java
___________________________________________________________________
Name: svn:mergeinfo
+
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubTransaction.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubTransaction.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubTransaction.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,67 +0,0 @@
-/*
- * 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.mw.wst11;
-
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-
-/**
- * This is the interface that allows transactions to be started and terminated.
- * The messaging layer converts the Commit, Rollback and Notify messages into
- * calls on this.
- * Importantly, a UserTransaction does not represent a specific transaction,
- * but rather is responsible for providing access to an implicit per-thread
- * transaction context; it is similar to the UserTransaction in the JTA
- * specification. Therefore, all of the UserTransaction methods implicitly act
- * on the current thread of control.
- *
- * @author Andrew Dinn
- * @version $Id:$
- */
-
-public abstract class UserSubTransaction extends UserTransaction
-{
- /**
- * The transaction.
- */
- private static UserTransaction USER_TRANSACTION ;
-
- /**
- * Get the user transaction.
- * @return the user transaction.
- */
- public static synchronized UserTransaction getUserTransaction()
- {
- return USER_TRANSACTION ;
- }
-
- /**
- * Set the user transaction.
- * @param userTransaction The user transaction.
- */
- public static synchronized void setUserTransaction(final UserTransaction userTransaction)
- {
- USER_TRANSACTION = userTransaction ;
- }
-}
\ No newline at end of file
Copied: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubTransaction.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,67 @@
+/*
+ * 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.mw.wst11;
+
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+
+/**
+ * This is the interface that allows transactions to be started and terminated.
+ * The messaging layer converts the Commit, Rollback and Notify messages into
+ * calls on this.
+ * Importantly, a UserTransaction does not represent a specific transaction,
+ * but rather is responsible for providing access to an implicit per-thread
+ * transaction context; it is similar to the UserTransaction in the JTA
+ * specification. Therefore, all of the UserTransaction methods implicitly act
+ * on the current thread of control.
+ *
+ * @author Andrew Dinn
+ * @version $Id:$
+ */
+
+public abstract class UserSubtransaction extends UserTransaction
+{
+ /**
+ * The transaction.
+ */
+ private static UserTransaction USER_TRANSACTION ;
+
+ /**
+ * Get the user transaction.
+ * @return the user transaction.
+ */
+ public static synchronized UserTransaction getUserTransaction()
+ {
+ return USER_TRANSACTION ;
+ }
+
+ /**
+ * Set the user transaction.
+ * @param userTransaction The user transaction.
+ */
+ public static synchronized void setUserTransaction(final UserTransaction userTransaction)
+ {
+ USER_TRANSACTION = userTransaction ;
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/UserSubtransaction.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mw/wst11/deploy/WSTXInitialisation.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -117,7 +117,7 @@
final Element docElem = doc.getDocumentElement() ;
final String userTx = getService(docElem, "UserTransaction") ;
- final String userSubTx = getService(docElem, "UserSubTransaction") ;
+ final String userSubTx = getService(docElem, "UserSubtransaction") ;
final String txManager = getService(docElem, "TransactionManager") ;
final String userBa = getService(docElem, "UserBusinessActivity") ;
final String baManager = getService(docElem, "BusinessActivityManager") ;
@@ -127,7 +127,7 @@
throw new FileNotFoundException(wstxLogger.log_mesg.getString("com.arjuna.mw.wst11.deploy.WSTXI_23"));
}
UserTransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userTx).newInstance()) ;
- UserSubTransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userSubTx).newInstance()) ;
+ UserSubtransaction.setUserTransaction((UserTransaction)ClassLoaderHelper.forName(getClass(), userSubTx).newInstance()) ;
TransactionManager.setTransactionManager((TransactionManager)ClassLoaderHelper.forName(getClass(), txManager).newInstance()) ;
UserBusinessActivity.setUserBusinessActivity((UserBusinessActivity)ClassLoaderHelper.forName(getClass(), userBa).newInstance()) ;
// we only have one choice for the 1.1 business activity manager
Deleted: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubTransactionImple.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubTransactionImple.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubTransactionImple.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,170 +0,0 @@
-package com.arjuna.mwlabs.wst11.at.remote;
-
-import com.arjuna.mw.wstx.logging.wstxLogger;
-import com.arjuna.mw.wsc11.context.Context;
-import com.arjuna.mwlabs.wst11.at.ContextImple;
-import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
-import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
-import com.arjuna.webservices.SoapFault;
-import com.arjuna.wsc11.ActivationCoordinator;
-import com.arjuna.wsc.InvalidCreateParametersException;
-import com.arjuna.wsc11.messaging.MessageId;
-import com.arjuna.wst.SystemException;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.UnknownTransactionException;
-import com.arjuna.wst.WrongStateException;
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
-import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
-
-/**
- * @message com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1
- * [com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1] - Received
- * context is null!
- */
-public class UserSubTransactionImple extends UserTransactionImple
-{
-
- public UserSubTransactionImple()
- {
- super();
- }
-
- public void begin () throws WrongStateException, SystemException
- {
- begin(0);
- }
-
- public void begin (int timeout) throws WrongStateException, SystemException
- {
- try
- {
- if (_ctxManager.currentTransaction() == null)
- throw new WrongStateException();
-
- Context ctx = startTransaction(timeout);
-
- _ctxManager.resume(new TxContextImple(ctx));
- }
- catch (InvalidCreateParametersException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (UnknownTransactionException ex)
- {
- tidyup();
-
- throw new SystemException(ex.toString());
- }
- catch (SystemException ex)
- {
- tidyup();
-
- throw ex;
- }
- }
-
- public void commit () throws TransactionRolledBackException,
- UnknownTransactionException, SecurityException, SystemException, WrongStateException
- {
- tidyup();
- throw new WrongStateException();
- }
-
- public void rollback () throws UnknownTransactionException, SecurityException, SystemException, WrongStateException
- {
- tidyup();
- throw new WrongStateException();
- }
-
- public String transactionIdentifier ()
- {
- try
- {
- return _ctxManager.currentTransaction().toString();
- }
- catch (SystemException ex)
- {
- return "Unknown";
- }
- catch (NullPointerException ex)
- {
- return "Unknown";
- }
- }
-
- public String toString ()
- {
- return transactionIdentifier();
- }
-
- /*
- * Not sure if this is right as it doesn't map to registering a participant
- * with the coordinator.
- */
-
- private final Context startTransaction(int timeout)
- throws InvalidCreateParametersException,
- SystemException
- {
- try
- {
- // TODO: tricks for per app _activationCoordinatorService config, perhaps:
- //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
-
-
-
- final CoordinationContext current = currentCoordinationContext();
- final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
- final String messageId = MessageId.getMessageId() ;
- final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
- _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, current) ;
- if (coordinationContext == null)
- {
- throw new SystemException(
- wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1"));
- }
- return new ContextImple(coordinationContext) ;
- }
- catch (final InvalidCreateParametersException icpe)
- {
- throw icpe ;
- }
- catch (final SoapFault sf)
- {
- throw new SystemException(sf.getMessage()) ;
- }
- catch (final Exception ex)
- {
- throw new SystemException(ex.toString());
- }
- }
-
- /**
- * get a CoordinationContext based on the one stasahed away in the current TxContext
- */
- public CoordinationContext currentCoordinationContext() throws SystemException
- {
- final TxContextImple txContext = (TxContextImple)_ctxManager.currentTransaction();
- final CoordinationContextType savedContext = txContext.context().getCoordinationContext();
- final CoordinationContext current = new CoordinationContext();
- current.setCoordinationType(savedContext.getCoordinationType());
- current.setExpires(savedContext.getExpires());
- current.setIdentifier(savedContext.getIdentifier());
- current.setRegistrationService(savedContext.getRegistrationService());
- return current;
- }
-
- private final void tidyup ()
- {
- try
- {
- _ctxManager.suspend();
- }
- catch (Exception ex)
- {
- ex.printStackTrace();
- }
- }
-}
\ No newline at end of file
Copied: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubTransactionImple.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,170 @@
+package com.arjuna.mwlabs.wst11.at.remote;
+
+import com.arjuna.mw.wstx.logging.wstxLogger;
+import com.arjuna.mw.wsc11.context.Context;
+import com.arjuna.mwlabs.wst11.at.ContextImple;
+import com.arjuna.mwlabs.wst11.at.context.TxContextImple;
+import com.arjuna.webservices11.wsat.AtomicTransactionConstants;
+import com.arjuna.webservices.SoapFault;
+import com.arjuna.wsc11.ActivationCoordinator;
+import com.arjuna.wsc.InvalidCreateParametersException;
+import com.arjuna.wsc11.messaging.MessageId;
+import com.arjuna.wst.SystemException;
+import com.arjuna.wst.TransactionRolledBackException;
+import com.arjuna.wst.UnknownTransactionException;
+import com.arjuna.wst.WrongStateException;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType;
+import org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext;
+
+/**
+ * @message com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1
+ * [com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1] - Received
+ * context is null!
+ */
+public class UserSubtransactionImple extends UserTransactionImple
+{
+
+ public UserSubtransactionImple()
+ {
+ super();
+ }
+
+ public void begin () throws WrongStateException, SystemException
+ {
+ begin(0);
+ }
+
+ public void begin (int timeout) throws WrongStateException, SystemException
+ {
+ try
+ {
+ if (_ctxManager.currentTransaction() == null)
+ throw new WrongStateException();
+
+ Context ctx = startTransaction(timeout);
+
+ _ctxManager.resume(new TxContextImple(ctx));
+ }
+ catch (InvalidCreateParametersException ex)
+ {
+ tidyup();
+
+ throw new SystemException(ex.toString());
+ }
+ catch (UnknownTransactionException ex)
+ {
+ tidyup();
+
+ throw new SystemException(ex.toString());
+ }
+ catch (SystemException ex)
+ {
+ tidyup();
+
+ throw ex;
+ }
+ }
+
+ public void commit () throws TransactionRolledBackException,
+ UnknownTransactionException, SecurityException, SystemException, WrongStateException
+ {
+ tidyup();
+ throw new WrongStateException();
+ }
+
+ public void rollback () throws UnknownTransactionException, SecurityException, SystemException, WrongStateException
+ {
+ tidyup();
+ throw new WrongStateException();
+ }
+
+ public String transactionIdentifier ()
+ {
+ try
+ {
+ return _ctxManager.currentTransaction().toString();
+ }
+ catch (SystemException ex)
+ {
+ return "Unknown";
+ }
+ catch (NullPointerException ex)
+ {
+ return "Unknown";
+ }
+ }
+
+ public String toString ()
+ {
+ return transactionIdentifier();
+ }
+
+ /*
+ * Not sure if this is right as it doesn't map to registering a participant
+ * with the coordinator.
+ */
+
+ private final Context startTransaction(int timeout)
+ throws InvalidCreateParametersException,
+ SystemException
+ {
+ try
+ {
+ // TODO: tricks for per app _activationCoordinatorService config, perhaps:
+ //InputStream inputStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("/foo.properties");
+
+
+
+ final CoordinationContext current = currentCoordinationContext();
+ final Long expires = (timeout > 0 ? new Long(timeout) : null) ;
+ final String messageId = MessageId.getMessageId() ;
+ final CoordinationContextType coordinationContext = ActivationCoordinator.createCoordinationContext(
+ _activationCoordinatorService, messageId, AtomicTransactionConstants.WSAT_PROTOCOL, expires, current) ;
+ if (coordinationContext == null)
+ {
+ throw new SystemException(
+ wstxLogger.log_mesg.getString("com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple_1"));
+ }
+ return new ContextImple(coordinationContext) ;
+ }
+ catch (final InvalidCreateParametersException icpe)
+ {
+ throw icpe ;
+ }
+ catch (final SoapFault sf)
+ {
+ throw new SystemException(sf.getMessage()) ;
+ }
+ catch (final Exception ex)
+ {
+ throw new SystemException(ex.toString());
+ }
+ }
+
+ /**
+ * get a CoordinationContext based on the one stasahed away in the current TxContext
+ */
+ public CoordinationContext currentCoordinationContext() throws SystemException
+ {
+ final TxContextImple txContext = (TxContextImple)_ctxManager.currentTransaction();
+ final CoordinationContextType savedContext = txContext.context().getCoordinationContext();
+ final CoordinationContext current = new CoordinationContext();
+ current.setCoordinationType(savedContext.getCoordinationType());
+ current.setExpires(savedContext.getExpires());
+ current.setIdentifier(savedContext.getIdentifier());
+ current.setRegistrationService(savedContext.getRegistrationService());
+ return current;
+ }
+
+ private final void tidyup ()
+ {
+ try
+ {
+ _ctxManager.suspend();
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ }
+ }
+}
\ No newline at end of file
Property changes on: labs/jbosstm/trunk/XTS/WSTX/classes11/com/arjuna/mwlabs/wst11/at/remote/UserSubtransactionImple.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: labs/jbosstm/trunk/XTS/WSTX/config/wst.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/config/wst.xml 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/config/wst.xml 2008-12-03 10:18:01 UTC (rev 24225)
@@ -26,9 +26,9 @@
<!-- <parameter name="className"
value="com.arjuna.mwlabs.wst.at.local.UserTransactionImple"/ -->
</service>
- <service name="UserSubTransaction">
+ <service name="UserSubtransaction">
<parameter name="className"
- value="com.arjuna.mwlabs.wst.at.remote.UserSubTransactionImple"/>
+ value="com.arjuna.mwlabs.wst.at.remote.UserSubtransactionImple"/>
</service>
<service name="TransactionManager">
<parameter name="className"
Modified: labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/config/wst11.xml 2008-12-03 10:18:01 UTC (rev 24225)
@@ -24,9 +24,9 @@
<parameter name="className"
value="com.arjuna.mwlabs.wst11.at.remote.UserTransactionImple"/>
</service>
- <service name="UserSubTransaction">
+ <service name="UserSubtransaction">
<parameter name="className"
- value="com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple"/>
+ value="com.arjuna.mwlabs.wst11.at.remote.UserSubtransactionImple"/>
</service>
<service name="TransactionManager">
<parameter name="className"
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/FailureBusinessParticipant.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/FailureBusinessParticipant.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/FailureBusinessParticipant.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -31,8 +31,6 @@
package com.arjuna.wst.tests;
-import com.arjuna.ats.arjuna.common.Uid;
-
import com.arjuna.wst.*;
/**
@@ -59,12 +57,30 @@
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;
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/WSTXTestSuite.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -24,6 +24,11 @@
package com.arjuna.wst.tests;
+import com.arjuna.wst.tests.junit.basic.SubtransactionCommit;
+import com.arjuna.wst.tests.junit.basic.SubtransactionCommitFailInPrepare;
+import com.arjuna.wst.tests.junit.basic.SubtransactionCommitRollbackInPrepare;
+import com.arjuna.wst.tests.junit.basic.SubtransactionRollback;
+
public class WSTXTestSuite extends junit.framework.TestSuite
{
public WSTXTestSuite()
@@ -50,10 +55,10 @@
addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.ThreadedTransaction.class));
// subtransaction tests
- addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SubTransactionCommit.class));
- addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SubTransactionRollback.class));
- addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SubTransactionCommitRollbackInPrepare.class));
- addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.basic.SubTransactionCommitFailInPrepare.class));
+ addTest(new junit.framework.TestSuite(SubtransactionCommit.class));
+ addTest(new junit.framework.TestSuite(SubtransactionRollback.class));
+ addTest(new junit.framework.TestSuite(SubtransactionCommitRollbackInPrepare.class));
+ addTest(new junit.framework.TestSuite(SubtransactionCommitFailInPrepare.class));
// wst BA tests
addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.Cancel.class));
addTest(new junit.framework.TestSuite(com.arjuna.wst.tests.junit.ba.Close.class));
Deleted: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommit.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommit.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommit.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,71 +0,0 @@
-/*
- * 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.wst.tests.junit.basic;
-
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserSubTransaction;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.wst.tests.DemoDurableParticipant;
-import com.arjuna.wst.tests.DemoVolatileParticipant;
-import junit.framework.TestCase;
-
-/**
- * @author Andrew Dinn
- * @version $Id:$
- */
-
-public class SubTransactionCommit extends TestCase
-{
-
- public static void testSubTransactionCommit()
- throws Exception
- {
- final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubTransaction.getUserTransaction();
- 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
Deleted: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitFailInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitFailInPrepare.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitFailInPrepare.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,77 +0,0 @@
-/*
- * 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.wst.tests.junit.basic;
-
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserSubTransaction;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.wst.tests.DemoDurableParticipant;
-import com.arjuna.wst.tests.DemoVolatileParticipant;
-import com.arjuna.wst.tests.FailureParticipant;
-import com.arjuna.wst.TransactionRolledBackException;
-import junit.framework.TestCase;
-
-/**
- * @author Andrew Dinn
- * @version $Id:$
- */
-
-public class SubTransactionCommitFailInPrepare extends TestCase
-{
-
- public static void testSubTransactionCommitFailInPrepare()
- throws Exception
- {
- final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubTransaction.getUserTransaction();
- 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
Deleted: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,77 +0,0 @@
-/*
- * 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.wst.tests.junit.basic;
-
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserSubTransaction;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.wst.tests.DemoDurableParticipant;
-import com.arjuna.wst.tests.DemoVolatileParticipant;
-import com.arjuna.wst.tests.FailureParticipant;
-import com.arjuna.wst.TransactionRolledBackException;
-import junit.framework.TestCase;
-
-/**
- * @author Andrew Dinn
- * @version $Id: $
- */
-
-public class SubTransactionCommitRollbackInPrepare extends TestCase
-{
-
- public static void testSubTransactionCommitRollbackInPrepare()
- throws Exception
- {
- final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubTransaction.getUserTransaction();
- 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
Deleted: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionRollback.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionRollback.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionRollback.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,71 +0,0 @@
-/*
- * 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.wst.tests.junit.basic;
-
-import com.arjuna.mw.wst.TransactionManager;
-import com.arjuna.mw.wst.UserTransaction;
-import com.arjuna.mw.wst.UserSubTransaction;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.wst.tests.DemoDurableParticipant;
-import com.arjuna.wst.tests.DemoVolatileParticipant;
-import junit.framework.TestCase;
-
-/**
- * @author Andrew Dinn
- * @version $Id: $
- */
-
-public class SubTransactionRollback extends TestCase
-{
-
- public static void testSubTransactionRollback()
- throws Exception
- {
- final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubTransaction.getUserTransaction();
- 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
Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommit.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,71 @@
+/*
+ * 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.wst.tests.junit.basic;
+
+import com.arjuna.mw.wst.TransactionManager;
+import com.arjuna.mw.wst.UserTransaction;
+import com.arjuna.mw.wst.UserSubtransaction;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.DemoVolatileParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id:$
+ */
+
+public class SubtransactionCommit extends TestCase
+{
+
+ public static void testSubTransactionCommit()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ust = UserSubtransaction.getUserTransaction();
+ 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
Property changes on: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommit.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitFailInPrepare.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,77 @@
+/*
+ * 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.wst.tests.junit.basic;
+
+import com.arjuna.mw.wst.TransactionManager;
+import com.arjuna.mw.wst.UserTransaction;
+import com.arjuna.mw.wst.UserSubtransaction;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.DemoVolatileParticipant;
+import com.arjuna.wst.tests.FailureParticipant;
+import com.arjuna.wst.TransactionRolledBackException;
+import junit.framework.TestCase;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id:$
+ */
+
+public class SubtransactionCommitFailInPrepare extends TestCase
+{
+
+ public static void testSubTransactionCommitFailInPrepare()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ust = UserSubtransaction.getUserTransaction();
+ 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
Property changes on: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitFailInPrepare.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,77 @@
+/*
+ * 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.wst.tests.junit.basic;
+
+import com.arjuna.mw.wst.TransactionManager;
+import com.arjuna.mw.wst.UserTransaction;
+import com.arjuna.mw.wst.UserSubtransaction;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.DemoVolatileParticipant;
+import com.arjuna.wst.tests.FailureParticipant;
+import com.arjuna.wst.TransactionRolledBackException;
+import junit.framework.TestCase;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id: $
+ */
+
+public class SubtransactionCommitRollbackInPrepare extends TestCase
+{
+
+ public static void testSubTransactionCommitRollbackInPrepare()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ust = UserSubtransaction.getUserTransaction();
+ 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
Property changes on: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubTransactionRollback.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,71 @@
+/*
+ * 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.wst.tests.junit.basic;
+
+import com.arjuna.mw.wst.TransactionManager;
+import com.arjuna.mw.wst.UserTransaction;
+import com.arjuna.mw.wst.UserSubtransaction;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.DemoVolatileParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id: $
+ */
+
+public class SubtransactionRollback extends TestCase
+{
+
+ public static void testSubTransactionRollback()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ust = UserSubtransaction.getUserTransaction();
+ 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
Property changes on: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst/tests/junit/basic/SubtransactionRollback.java
___________________________________________________________________
Name: svn:mergeinfo
+
Modified: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/WSTX11TestSuite.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/WSTX11TestSuite.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/WSTX11TestSuite.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -24,6 +24,11 @@
package com.arjuna.wst11.tests;
+import com.arjuna.wst11.tests.junit.basic.SubtransactionCommit;
+import com.arjuna.wst11.tests.junit.basic.SubtransactionCommitFailInPrepare;
+import com.arjuna.wst11.tests.junit.basic.SubtransactionCommitRollbackInPrepare;
+import com.arjuna.wst11.tests.junit.basic.SubtransactionRollback;
+
public class WSTX11TestSuite extends junit.framework.TestSuite
{
public WSTX11TestSuite()
@@ -50,10 +55,10 @@
addTest(new junit.framework.TestSuite(com.arjuna.wst11.tests.junit.basic.SuspendTransaction.class));
addTest(new junit.framework.TestSuite(com.arjuna.wst11.tests.junit.basic.ThreadedTransaction.class));
// subtransaction tests
- addTest(new junit.framework.TestSuite(com.arjuna.wst11.tests.junit.basic.SubTransactionCommit.class));
- addTest(new junit.framework.TestSuite(com.arjuna.wst11.tests.junit.basic.SubTransactionRollback.class));
- addTest(new junit.framework.TestSuite(com.arjuna.wst11.tests.junit.basic.SubTransactionCommitRollbackInPrepare.class));
- addTest(new junit.framework.TestSuite(com.arjuna.wst11.tests.junit.basic.SubTransactionCommitFailInPrepare.class));
+ addTest(new junit.framework.TestSuite(SubtransactionCommit.class));
+ addTest(new junit.framework.TestSuite(SubtransactionRollback.class));
+ addTest(new junit.framework.TestSuite(SubtransactionCommitRollbackInPrepare.class));
+ addTest(new junit.framework.TestSuite(SubtransactionCommitFailInPrepare.class));
// wst BA tests
Deleted: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommit.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommit.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommit.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,70 +0,0 @@
-/*
- * 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.junit.basic;
-
-import com.arjuna.mw.wst11.TransactionManager;
-import com.arjuna.mw.wst11.UserTransaction;
-import com.arjuna.mw.wst11.UserSubTransaction;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.wst.tests.DemoDurableParticipant;
-import com.arjuna.wst.tests.DemoVolatileParticipant;
-import junit.framework.TestCase;
-
-/**
- * @author Andrew Dinn
- * @version $Id: $
- */
-
-public class SubTransactionCommit extends TestCase
-{
-
- public static void testSubTransactionCommit()
- throws Exception
- {
- final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubTransaction.getUserTransaction();
- 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
Deleted: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitFailInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitFailInPrepare.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitFailInPrepare.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,80 +0,0 @@
-/*
- * 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.junit.basic;
-
-import com.arjuna.mw.wst11.TransactionManager;
-import com.arjuna.mw.wst11.UserTransaction;
-import com.arjuna.mw.wst11.UserSubTransaction;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.wst.tests.DemoDurableParticipant;
-import com.arjuna.wst.tests.DemoVolatileParticipant;
-import com.arjuna.wst.tests.FailureParticipant;
-import com.arjuna.wst.TransactionRolledBackException;
-import com.arjuna.wst.WrongStateException;
-import com.arjuna.mwlabs.wst11.at.remote.UserSubTransactionImple;
-import junit.framework.TestCase;
-
-/**
- * @author Andrew Dinn
- * @version $Id:$
- * @since 1.0.
- */
-
-public class SubTransactionCommitFailInPrepare extends TestCase
-{
-
- public static void testSubTransactionCommitFailInPrepare()
- throws Exception
- {
- final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubTransaction.getUserTransaction();
- 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
Deleted: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,77 +0,0 @@
-/*
- * 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.junit.basic;
-
-import com.arjuna.mw.wst11.TransactionManager;
-import com.arjuna.mw.wst11.UserTransaction;
-import com.arjuna.mw.wst11.UserSubTransaction;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.wst.tests.DemoDurableParticipant;
-import com.arjuna.wst.tests.DemoVolatileParticipant;
-import com.arjuna.wst.tests.FailureParticipant;
-import com.arjuna.wst.TransactionRolledBackException;
-import junit.framework.TestCase;
-
-/**
- * @author Andrew Dinn
- * @version $Id:$
- */
-
-public class SubTransactionCommitRollbackInPrepare extends TestCase
-{
-
- public static void testSubTransactionCommitRollbackInPrepare()
- throws Exception
- {
- final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubTransaction.getUserTransaction();
- 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
Deleted: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionRollback.java
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionRollback.java 2008-12-03 08:21:33 UTC (rev 24224)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionRollback.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -1,71 +0,0 @@
-/*
- * 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.junit.basic;
-
-import com.arjuna.mw.wst11.TransactionManager;
-import com.arjuna.mw.wst11.UserTransaction;
-import com.arjuna.mw.wst11.UserSubTransaction;
-import com.arjuna.mw.wst.TxContext;
-import com.arjuna.wst.tests.DemoDurableParticipant;
-import com.arjuna.wst.tests.DemoVolatileParticipant;
-import junit.framework.TestCase;
-
-/**
- * @author Andrew Dinn
- * @version $Id:$
- */
-
-public class SubTransactionRollback extends TestCase
-{
-
- public static void testSubTransactionRollback()
- throws Exception
- {
- final UserTransaction ut = UserTransaction.getUserTransaction();
- final UserTransaction ust = UserSubTransaction.getUserTransaction();
- 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
Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommit.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,70 @@
+/*
+ * 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.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserSubtransaction;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.DemoVolatileParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id: $
+ */
+
+public class SubtransactionCommit extends TestCase
+{
+
+ public static void testSubTransactionCommit()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ust = UserSubtransaction.getUserTransaction();
+ 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
Property changes on: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommit.java
___________________________________________________________________
Name: svn:mergeinfo
+
Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitFailInPrepare.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitFailInPrepare.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,78 @@
+/*
+ * 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.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserSubtransaction;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.DemoVolatileParticipant;
+import com.arjuna.wst.tests.FailureParticipant;
+import com.arjuna.wst.TransactionRolledBackException;
+import junit.framework.TestCase;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id:$
+ * @since 1.0.
+ */
+
+public class SubtransactionCommitFailInPrepare extends TestCase
+{
+
+ public static void testSubTransactionCommitFailInPrepare()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ust = UserSubtransaction.getUserTransaction();
+ 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
Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionCommitRollbackInPrepare.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionCommitRollbackInPrepare.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,77 @@
+/*
+ * 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.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserSubtransaction;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.DemoVolatileParticipant;
+import com.arjuna.wst.tests.FailureParticipant;
+import com.arjuna.wst.TransactionRolledBackException;
+import junit.framework.TestCase;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id:$
+ */
+
+public class SubtransactionCommitRollbackInPrepare extends TestCase
+{
+
+ public static void testSubTransactionCommitRollbackInPrepare()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ust = UserSubtransaction.getUserTransaction();
+ 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
Copied: labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java (from rev 24215, labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubTransactionRollback.java)
===================================================================
--- labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java (rev 0)
+++ labs/jbosstm/trunk/XTS/WSTX/tests/classes/com/arjuna/wst11/tests/junit/basic/SubtransactionRollback.java 2008-12-03 10:18:01 UTC (rev 24225)
@@ -0,0 +1,71 @@
+/*
+ * 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.junit.basic;
+
+import com.arjuna.mw.wst11.TransactionManager;
+import com.arjuna.mw.wst11.UserTransaction;
+import com.arjuna.mw.wst11.UserSubtransaction;
+import com.arjuna.mw.wst.TxContext;
+import com.arjuna.wst.tests.DemoDurableParticipant;
+import com.arjuna.wst.tests.DemoVolatileParticipant;
+import junit.framework.TestCase;
+
+/**
+ * @author Andrew Dinn
+ * @version $Id:$
+ */
+
+public class SubtransactionRollback extends TestCase
+{
+
+ public static void testSubTransactionRollback()
+ throws Exception
+ {
+ final UserTransaction ut = UserTransaction.getUserTransaction();
+ final UserTransaction ust = UserSubtransaction.getUserTransaction();
+ 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
More information about the jboss-svn-commits
mailing list