Search in sources :

Example 16 with ServerTransaction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction in project narayana by jbosstm.

the class ServerFactoryUnitTest method testGetOSStatusWithArjunaTransactionImple.

@Test
public void testGetOSStatusWithArjunaTransactionImple() throws Exception {
    final Uid uid = new Uid();
    final OutputObjectState outputObjectState = new OutputObjectState();
    final ServerTransaction transaction = new ServerTransaction(uid, null);
    transaction.save_state(outputObjectState, ObjectType.ANDPERSISTENT);
    StoreManager.getRecoveryStore().write_committed(uid, ServerTransaction.typeName(), outputObjectState);
    Assert.assertEquals(Status.StatusCommitted, ServerFactory.getOSStatus(uid));
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) OutputObjectState(com.arjuna.ats.arjuna.state.OutputObjectState) ServerTransaction(com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction) AssumedCompleteHeuristicServerTransaction(com.arjuna.ats.internal.jts.recovery.transactions.AssumedCompleteHeuristicServerTransaction) Test(org.junit.Test)

Example 17 with ServerTransaction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction in project narayana by jbosstm.

the class ServerTransactionUnitTest method testPrepareRollback.

@Test
public void testPrepareRollback() throws Exception {
    ServerTransaction sc = new ServerTransaction(new Uid(), null);
    // readonly so we commit here
    assertEquals(sc.doPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
    // Due to the readonly we allow the massage
    assertEquals(sc.doPhase2Abort(), ActionStatus.ABORTED);
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ServerTransaction(com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction) Test(org.junit.Test)

Aggregations

ServerTransaction (com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction)17 Uid (com.arjuna.ats.arjuna.common.Uid)8 SystemException (org.omg.CORBA.SystemException)8 Test (org.junit.Test)7 INVALID_TRANSACTION (org.omg.CORBA.INVALID_TRANSACTION)7 HeuristicHazard (org.omg.CosTransactions.HeuristicHazard)5 HeuristicMixed (org.omg.CosTransactions.HeuristicMixed)4 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)3 UNKNOWN (org.omg.CORBA.UNKNOWN)3 OutputObjectState (com.arjuna.ats.arjuna.state.OutputObjectState)2 HeuristicCommit (org.omg.CosTransactions.HeuristicCommit)2 RecoveryCoordinator (org.omg.CosTransactions.RecoveryCoordinator)2 BasicAction (com.arjuna.ats.arjuna.coordinator.BasicAction)1 InputObjectState (com.arjuna.ats.arjuna.state.InputObjectState)1 ArjunaTransactionImple (com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple)1 ServerSynchronization (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.ServerSynchronization)1 AssumedCompleteHeuristicServerTransaction (com.arjuna.ats.internal.jts.recovery.transactions.AssumedCompleteHeuristicServerTransaction)1 com.hp.mwtests.ts.jts.orbspecific.resources.demosync (com.hp.mwtests.ts.jts.orbspecific.resources.demosync)1 BAD_OPERATION (org.omg.CORBA.BAD_OPERATION)1 HeuristicRollback (org.omg.CosTransactions.HeuristicRollback)1