Search in sources :

Example 6 with TransactionManagerImple

use of com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple in project narayana by jbosstm.

the class LastResourceAllowedTestCase method testAllowed.

@Test
public void testAllowed() throws SystemException, NotSupportedException, RollbackException {
    final LastOnePhaseResource firstResource = new LastOnePhaseResource();
    final LastOnePhaseResource secondResource = new LastOnePhaseResource();
    final LastOnePhaseResource thirdResource = new LastOnePhaseResource();
    final TransactionManager tm = new TransactionManagerImple();
    tm.begin();
    try {
        final Transaction tx = tm.getTransaction();
        assertTrue("First resource enlisted", tx.enlistResource(firstResource));
        assertTrue("Second resource enlisted", tx.enlistResource(secondResource));
        assertTrue("Third resource enlisted", tx.enlistResource(thirdResource));
    } finally {
        tm.rollback();
    }
}
Also used : TransactionManagerImple(com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple) Transaction(javax.transaction.Transaction) TransactionManager(javax.transaction.TransactionManager) Test(org.junit.Test)

Aggregations

TransactionManagerImple (com.arjuna.ats.internal.jta.transaction.jts.TransactionManagerImple)6 Test (org.junit.Test)4 Transaction (javax.transaction.Transaction)2 TransactionManager (javax.transaction.TransactionManager)2 Uid (com.arjuna.ats.arjuna.common.Uid)1 ObjStoreBrowser (com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser)1 UidWrapper (com.arjuna.ats.arjuna.tools.osb.mbean.UidWrapper)1 XARecoveryModule (com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule)1 TransactionImple (com.arjuna.ats.internal.jta.transaction.jts.TransactionImple)1 RecoveryEnablement (com.arjuna.ats.internal.jts.orbspecific.recovery.RecoveryEnablement)1 ArrayList (java.util.ArrayList)1 HashMap (java.util.HashMap)1 Properties (java.util.Properties)1 XAException (javax.transaction.xa.XAException)1 Before (org.junit.Before)1