use of com.hp.mwtests.ts.jta.common.LastXAResource in project narayana by jbosstm.
the class JTAOrder method test.
@Test
public void test() throws Exception {
XAResource theResource = new TestResource();
FirstXAResource first = new FirstXAResource();
LastXAResource last = new LastXAResource();
javax.transaction.TransactionManager tm = com.arjuna.ats.jta.TransactionManager.transactionManager();
System.out.println("Starting top-level transaction.");
tm.begin();
javax.transaction.Transaction theTransaction = tm.getTransaction();
theTransaction.enlistResource(theResource);
theTransaction.enlistResource(last);
theTransaction.enlistResource(first);
System.out.println("Committing transaction.");
tm.commit();
assertEquals(Status.STATUS_COMMITTED, theTransaction.getStatus());
}
Aggregations