Search in sources :

Example 11 with DummyXA

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));
}
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)

Example 12 with DummyXA

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);
}
Also used : DummyXA(com.hp.mwtests.ts.jta.jts.common.DummyXA) LastResourceRecord(com.arjuna.ats.internal.jta.resources.jts.orbspecific.LastResourceRecord) TransactionImple(com.arjuna.ats.internal.jta.transaction.jts.TransactionImple) Test(org.junit.Test)

Aggregations

DummyXA (com.hp.mwtests.ts.jta.jts.common.DummyXA)12 Test (org.junit.Test)12 TransactionImple (com.arjuna.ats.internal.jta.transaction.jts.TransactionImple)9 Uid (com.arjuna.ats.arjuna.common.Uid)5 XAResourceRecord (com.arjuna.ats.internal.jta.resources.jts.orbspecific.XAResourceRecord)4 XidImple (com.arjuna.ats.jta.xa.XidImple)3 DummyRecoverableXAConnection (com.hp.mwtests.ts.jta.common.DummyRecoverableXAConnection)3 SystemException (javax.transaction.SystemException)2 RecoveryModule (com.arjuna.ats.arjuna.recovery.RecoveryModule)1 InputObjectState (com.arjuna.ats.arjuna.state.InputObjectState)1 OutputObjectState (com.arjuna.ats.arjuna.state.OutputObjectState)1 XARecoveryModule (com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule)1 XARecoveryResourceImple (com.arjuna.ats.internal.jta.recovery.jts.XARecoveryResourceImple)1 XARecoveryResourceManagerImple (com.arjuna.ats.internal.jta.recovery.jts.XARecoveryResourceManagerImple)1 LastResourceRecord (com.arjuna.ats.internal.jta.resources.jts.orbspecific.LastResourceRecord)1 InitialContext (javax.naming.InitialContext)1 RollbackException (javax.transaction.RollbackException)1 XAException (javax.transaction.xa.XAException)1 Control (org.omg.CosTransactions.Control)1