Search in sources :

Example 6 with XARecoveryModule

use of com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule in project narayana by jbosstm.

the class XARecoveryModuleUnitTest method testNull.

@Test
public void testNull() {
    XARecoveryModule xarm = new XARecoveryModule();
    xarm.periodicWorkFirstPass();
    xarm.periodicWorkSecondPass();
}
Also used : XARecoveryModule(com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule) Test(org.junit.Test)

Example 7 with XARecoveryModule

use of com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule 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();
    }
}
Also used : SubordinateAtomicTransaction(com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.SubordinateAtomicTransaction) TransactionImple(com.arjuna.ats.internal.jta.transaction.jts.TransactionImple) ArrayList(java.util.ArrayList) RecoveryXAResource(com.hp.mwtests.ts.jta.common.RecoveryXAResource) XARecoveryModule(com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule) Test(org.junit.Test)

Aggregations

XARecoveryModule (com.arjuna.ats.internal.jta.recovery.jts.XARecoveryModule)7 Test (org.junit.Test)5 XAException (javax.transaction.xa.XAException)3 Xid (javax.transaction.xa.Xid)3 Uid (com.arjuna.ats.arjuna.common.Uid)2 RecoveryModule (com.arjuna.ats.arjuna.recovery.RecoveryModule)2 SubordinateTransaction (com.arjuna.ats.internal.jta.transaction.arjunacore.jca.SubordinateTransaction)2 XAResourceRecoveryHelper (com.arjuna.ats.jta.recovery.XAResourceRecoveryHelper)2 ObjStoreBrowser (com.arjuna.ats.arjuna.tools.osb.mbean.ObjStoreBrowser)1 AtomicActionRecoveryModule (com.arjuna.ats.internal.arjuna.recovery.AtomicActionRecoveryModule)1 TransactionImporter (com.arjuna.ats.internal.jta.transaction.arjunacore.jca.TransactionImporter)1 TransactionImple (com.arjuna.ats.internal.jta.transaction.jts.TransactionImple)1 XATerminatorImple (com.arjuna.ats.internal.jta.transaction.jts.jca.XATerminatorImple)1 SubordinateAtomicTransaction (com.arjuna.ats.internal.jta.transaction.jts.subordinate.jca.SubordinateAtomicTransaction)1 SerializableXAResourceDeserializer (com.arjuna.ats.jta.recovery.SerializableXAResourceDeserializer)1 XidImple (com.arjuna.ats.jta.xa.XidImple)1 RecoveryXAResource (com.hp.mwtests.ts.jta.common.RecoveryXAResource)1 TestXAResource (com.hp.mwtests.ts.jta.jts.TestXAResource)1 TestXAResourceWrapper (com.hp.mwtests.ts.jta.recovery.TestXAResourceWrapper)1 Field (java.lang.reflect.Field)1