Search in sources :

Example 1 with AssumedCompleteTransaction

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

the class AssumedCompleteUnitTest method testTransaction.

@Test
public void testTransaction() throws Exception {
    AssumedCompleteTransaction tx = new AssumedCompleteTransaction(new Uid());
    assertEquals(tx.getOriginalStatus(), Status.StatusNoTransaction);
    assertTrue(tx.type() != null);
    assertEquals(AssumedCompleteTransaction.typeName(), tx.type());
    assertTrue(tx.toString() != null);
    assertFalse(tx.assumeComplete());
    assertEquals(tx.getLastActiveTime(), null);
    OutputObjectState os = new OutputObjectState();
    assertTrue(tx.save_state(os, ObjectType.ANDPERSISTENT));
    InputObjectState is = new InputObjectState(os);
    assertTrue(tx.restore_state(is, ObjectType.ANDPERSISTENT));
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) AssumedCompleteTransaction(com.arjuna.ats.internal.jts.recovery.transactions.AssumedCompleteTransaction) OutputObjectState(com.arjuna.ats.arjuna.state.OutputObjectState) Test(org.junit.Test)

Aggregations

Uid (com.arjuna.ats.arjuna.common.Uid)1 InputObjectState (com.arjuna.ats.arjuna.state.InputObjectState)1 OutputObjectState (com.arjuna.ats.arjuna.state.OutputObjectState)1 AssumedCompleteTransaction (com.arjuna.ats.internal.jts.recovery.transactions.AssumedCompleteTransaction)1 Test (org.junit.Test)1