Search in sources :

Example 6 with ServerTransaction

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

the class ServerTransactionUnitTest method testOnePhaseCommit.

@Test
public void testOnePhaseCommit() throws Exception {
    ServerTransaction sc = new ServerTransaction(new Uid(), null);
    sc.doCommit(true);
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ServerTransaction(com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction) Test(org.junit.Test)

Example 7 with ServerTransaction

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

the class ServerTransactionUnitTest method testPrepareCommit.

@Test
public void testPrepareCommit() throws Exception {
    ServerTransaction sc = new ServerTransaction(new Uid(), null);
    sc.register_synchronization(new demosync(false).getReference());
    sc.doBeforeCompletion();
    assertEquals(sc.doPrepare(), TwoPhaseOutcome.PREPARE_READONLY);
    assertEquals(sc.doPhase2Commit(), TwoPhaseOutcome.FINISH_OK);
    sc.doAfterCompletion(Status.StatusCommitted);
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) com.hp.mwtests.ts.jts.orbspecific.resources.demosync(com.hp.mwtests.ts.jts.orbspecific.resources.demosync) ServerTransaction(com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction) Test(org.junit.Test)

Example 8 with ServerTransaction

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

the class ServerTransactionUnitTest method test.

@Test
public void test() throws Exception {
    ServerTransaction sc = new ServerTransaction(new Uid(), null);
    assertTrue(sc.type() != null);
    assertTrue(ServerTransaction.typeName() != null);
    assertTrue(sc.getSavingUid().notEquals(Uid.nullUid()));
    OutputObjectState os = new OutputObjectState();
    assertTrue(sc.save_state(os, ObjectType.ANDPERSISTENT));
    InputObjectState is = new InputObjectState(os);
    assertTrue(sc.restore_state(is, ObjectType.ANDPERSISTENT));
    sc.setRecoveryCoordinator(null);
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) InputObjectState(com.arjuna.ats.arjuna.state.InputObjectState) OutputObjectState(com.arjuna.ats.arjuna.state.OutputObjectState) ServerTransaction(com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction) Test(org.junit.Test)

Example 9 with ServerTransaction

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

the class ServerTransactionUnitTest method testRollback.

@Test
public void testRollback() throws Exception {
    ServerTransaction sc = new ServerTransaction(new Uid(), null);
    sc.rollback();
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ServerTransaction(com.arjuna.ats.internal.jts.orbspecific.interposition.coordinator.ServerTransaction) Test(org.junit.Test)

Example 10 with ServerTransaction

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

the class ServerSynchronizationUnitTest method test.

@Test
public void test() throws Exception {
    ServerTransaction sc = new ServerTransaction(new Uid(), null);
    ServerSynchronization sync = new ServerSynchronization(sc);
    sync.before_completion();
    sync.after_completion(Status.StatusCommitted);
    assertTrue(sync.getSynchronization() != null);
    sync.destroy();
}
Also used : Uid(com.arjuna.ats.arjuna.common.Uid) ServerSynchronization(com.arjuna.ats.internal.jts.orbspecific.interposition.resources.ServerSynchronization) 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