use of com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.SubordinateAtomicTransaction in project narayana by jbosstm.
the class SubordinateTxUnitTest method testAtomicTransaction.
@Test
public void testAtomicTransaction() throws Exception {
XidImple xid = new XidImple(new Uid());
SubordinateAtomicTransaction saa1 = new SubordinateAtomicTransaction(new Uid());
SubordinateAtomicTransaction saa2 = new SubordinateAtomicTransaction(new Uid(), xid, 0);
assertEquals(saa2.getXid(), xid);
try {
saa2.end(true);
fail();
} catch (final WrongTransaction ex) {
}
try {
saa2.abort();
fail();
} catch (final WrongTransaction ex) {
}
DummySubordinateAtomicTransaction dsat = new DummySubordinateAtomicTransaction();
assertFalse(dsat.checkForCurrent());
}
use of com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.SubordinateAtomicTransaction in project narayana by jbosstm.
the class XARecoveryModuleUnitTest method testRecover.
@Test
public void testRecover() throws Exception {
ArrayList<String> r = new ArrayList<String>();
TransactionImple tx = new TransactionImple();
assertTrue(tx.enlistResource(new RecoveryXAResource()));
SubordinateAtomicTransaction sat = new SubordinateAtomicTransaction(tx.get_uid(), tx.getTxId(), 0);
assertEquals(sat.doPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
r.add("com.hp.mwtests.ts.jta.recovery.DummyXARecoveryResource");
jtaPropertyManager.getJTAEnvironmentBean().setXaResourceRecoveryClassNames(r);
XARecoveryModule xarm = new XARecoveryModule();
for (int i = 0; i < 11; i++) {
xarm.periodicWorkFirstPass();
xarm.periodicWorkSecondPass();
}
}
Aggregations