Search in sources :

Example 11 with ServerTopLevelAction

use of com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerTopLevelAction in project narayana by jbosstm.

the class ServerTopLevelActionUnitTest method testRollback.

@Test
public void testRollback() throws Exception {
    ControlImple cont = new ControlImple(null, null);
    Control theControl = cont.getControl();
    ArjunaTransactionImple tx = cont.getImplHandle();
    ServerControl sc = new ServerControl(tx.get_uid(), theControl, tx, theControl.get_coordinator(), theControl.get_terminator());
    ServerTopLevelAction act = new ServerTopLevelAction(sc);
    assertEquals(act.prepare(), Vote.VoteReadOnly);
    try {
        act.rollback();
        fail();
    } catch (final INVALID_TRANSACTION ex) {
    }
    act.forget();
}
Also used : Control(org.omg.CosTransactions.Control) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) ServerControl(com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl) ServerTopLevelAction(com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerTopLevelAction) INVALID_TRANSACTION(org.omg.CORBA.INVALID_TRANSACTION) ArjunaTransactionImple(com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple) ControlImple(com.arjuna.ats.internal.jts.orbspecific.ControlImple) Test(org.junit.Test)

Aggregations

ServerTopLevelAction (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerTopLevelAction)11 ServerControl (com.arjuna.ats.internal.jts.orbspecific.interposition.ServerControl)8 ControlImple (com.arjuna.ats.internal.jts.orbspecific.ControlImple)7 Uid (com.arjuna.ats.arjuna.common.Uid)4 ArjunaTransactionImple (com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple)4 Test (org.junit.Test)4 SystemException (org.omg.CORBA.SystemException)4 TRANSACTION_ROLLEDBACK (org.omg.CORBA.TRANSACTION_ROLLEDBACK)4 Control (org.omg.CosTransactions.Control)4 Coordinator (org.omg.CosTransactions.Coordinator)4 Terminator (org.omg.CosTransactions.Terminator)4 ServerResource (com.arjuna.ats.internal.jts.interposition.resources.arjuna.ServerResource)2 INVALID_TRANSACTION (org.omg.CORBA.INVALID_TRANSACTION)2 ManagedSynchronizationImple (com.arjuna.ats.internal.jta.resources.jts.orbspecific.ManagedSynchronizationImple)1 TransactionImple (com.arjuna.ats.internal.jta.transaction.jts.TransactionImple)1 ControlWrapper (com.arjuna.ats.internal.jts.ControlWrapper)1 InterpositionCreator (com.arjuna.ats.internal.jts.interposition.resources.arjuna.InterpositionCreator)1 CurrentImple (com.arjuna.ats.internal.jts.orbspecific.CurrentImple)1 ServerNestedAction (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.arjuna.ServerNestedAction)1 ServerOSINestedAction (com.arjuna.ats.internal.jts.orbspecific.interposition.resources.osi.ServerOSINestedAction)1