use of com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple in project narayana by jbosstm.
the class UserTransactionUnitTest method testRollbackOnly.
@Test
public void testRollbackOnly() throws Exception {
ThreadActionData.purgeActions();
UserTransactionImple ut = new UserTransactionImple();
ut.begin();
ut.setRollbackOnly();
try {
ut.commit();
fail();
} catch (final RollbackException ex) {
}
}
use of com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple in project narayana by jbosstm.
the class UserTransactionUnitTest method testSubordinate.
@Test
public void testSubordinate() throws Exception {
ThreadActionData.purgeActions();
UserTransactionImple ut = new UserTransactionImple();
assertTrue(ut.createSubordinate() != null);
ut.begin();
try {
ut.createSubordinate();
fail();
} catch (final NotSupportedException ex) {
}
ut.commit();
}
use of com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple in project narayana by jbosstm.
the class UserTransactionUnitTest method test.
@Test
public void test() throws Exception {
ThreadActionData.purgeActions();
UserTransactionImple ut = new UserTransactionImple();
assertEquals(ut.getTimeout(), 0);
assertTrue(ut.toString() != null);
assertEquals(ut.getObjectInstance(null, null, null, null), ut);
try {
ut = (UserTransactionImple) UserTransaction.userTransaction(new InitialContext());
fail();
} catch (final Throwable ex) {
}
}
use of com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple in project narayana by jbosstm.
the class AsyncCommit method test.
@Test
public void test() throws Exception {
UserTransactionImple ut = new UserTransactionImple();
ut.begin();
TransactionImple current = TransactionImple.getTransaction();
TestResource res1, res2;
current.enlistResource(res1 = new TestResource());
current.enlistResource(res2 = new TestResource());
current.delistResource(res2, XAResource.TMSUCCESS);
current.delistResource(res1, XAResource.TMSUCCESS);
Future<Void> commitAsync = ut.commitAsync();
commitAsync.get();
}
use of com.arjuna.ats.internal.jta.transaction.arjunacore.UserTransactionImple in project narayana by jbosstm.
the class UserTransactionUnitTest method testNull.
@Test
public void testNull() throws Exception {
ThreadActionData.purgeActions();
UserTransactionImple ut = new UserTransactionImple();
try {
ut.commit();
fail();
} catch (final IllegalStateException ex) {
}
try {
ut.rollback();
fail();
} catch (final IllegalStateException ex) {
}
try {
ut.setRollbackOnly();
fail();
} catch (final IllegalStateException ex) {
}
}
Aggregations