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();
}
}
Aggregations