Search in sources :

Example 1 with XARecoveryResourceImple

use of com.arjuna.ats.internal.jta.recovery.jts.XARecoveryResourceImple 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));
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) XARecoveryResourceImple(com.arjuna.ats.internal.jta.recovery.jts.XARecoveryResourceImple) DummyXA(com.hp.mwtests.ts.jta.jts.common.DummyXA) XAException(javax.transaction.xa.XAException) Test(org.junit.Test)

Aggregations

Uid (com.arjuna.ats.arjuna.common.Uid)1 XARecoveryResourceImple (com.arjuna.ats.internal.jta.recovery.jts.XARecoveryResourceImple)1 DummyXA (com.hp.mwtests.ts.jta.jts.common.DummyXA)1 XAException (javax.transaction.xa.XAException)1 Test (org.junit.Test)1