Search in sources :

Example 1 with RecoveredTransactionReplayer

use of com.arjuna.ats.internal.jts.recovery.transactions.RecoveredTransactionReplayer in project narayana by jbosstm.

the class RecoveredTransactionReplayerUnitTest method testCommitted.

@Test
public void testCommitted() throws Exception {
    /*
         * Deliberately choose a Uid that doesn't represent a state
         * on disk.
         * 
         * Use un-threaded.
         */
    Uid dummyUid = new Uid();
    String dummyState = "/StateManager/DummyState";
    RecoveredTransactionReplayer replayer = new RecoveredTransactionReplayer(dummyUid, dummyState);
    DemoResource res = new DemoResource();
    assertTrue(RecoveredTransactionReplayer.isPresent(dummyUid) != null);
    replayer.swapResource(dummyUid, res.getResource());
    replayer.run();
    assertTrue(RecoveredTransactionReplayer.isPresent(dummyUid) == null);
}
Also used : DemoResource(com.hp.mwtests.ts.jts.orbspecific.resources.DemoResource) Uid(com.arjuna.ats.arjuna.common.Uid) RecoveredTransactionReplayer(com.arjuna.ats.internal.jts.recovery.transactions.RecoveredTransactionReplayer) Test(org.junit.Test)

Aggregations

Uid (com.arjuna.ats.arjuna.common.Uid)1 RecoveredTransactionReplayer (com.arjuna.ats.internal.jts.recovery.transactions.RecoveredTransactionReplayer)1 DemoResource (com.hp.mwtests.ts.jts.orbspecific.resources.DemoResource)1 Test (org.junit.Test)1