use of com.hp.mwtests.ts.jta.jts.common.DummyXA in project narayana by jbosstm.
the class XARecoveryResourceImpleUnitTest method test.
@Test
public void test() {
XARecoveryResourceImple xares = new XARecoveryResourceImple(new Uid());
assertEquals(xares.getXAResource(), null);
assertEquals(xares.recoverable(), XARecoveryResource.INFLIGHT_TRANSACTION);
xares = new XARecoveryResourceImple(new Uid(), new DummyXA(false));
assertEquals(xares.recover(), XARecoveryResource.FAILED_TO_RECOVER);
DummyXARecoveryResource dummy = new DummyXARecoveryResource();
assertTrue(dummy.notAProblem(new XAException(XAException.XAER_NOTA), true));
assertFalse(dummy.notAProblem(new XAException(XAException.XAER_DUPID), false));
}
use of com.hp.mwtests.ts.jta.jts.common.DummyXA in project narayana by jbosstm.
the class LastResourceRecordUnitTest method test.
@Test
public void test() throws Exception {
TransactionImple tx = new TransactionImple();
LastResourceRecord rec = new LastResourceRecord(tx, new DummyXA(false), tx.getTxId(), null);
rec.commit();
assertEquals(rec.prepare(), Vote.VoteCommit);
assertTrue(rec.toString() != null);
assertFalse(rec.saveRecord());
assertTrue(rec.type() != null);
}
Aggregations