use of com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple in project narayana by jbosstm.
the class ExtendedResourceUnitTest method testNestedAbort.
@Test
public void testNestedAbort() throws Exception {
DemoArjunaResource ares = new DemoArjunaResource();
OTSImpleManager.current().begin();
ArjunaTransactionImple tx = OTSImpleManager.current().getControlWrapper().getImple().getImplHandle();
OTSImpleManager.current().begin();
ExtendedResourceRecord res = new ExtendedResourceRecord(false, new Uid(), ares.getReference(), tx.getControlHandle().get_coordinator(), new Uid(), OTSImpleManager.current().getControlWrapper().getImple().getImplHandle());
assertEquals(res.nestedPrepare(), TwoPhaseOutcome.PREPARE_OK);
assertEquals(res.nestedAbort(), TwoPhaseOutcome.FINISH_OK);
OTSImpleManager.current().rollback();
OTSImpleManager.current().rollback();
}
use of com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple in project narayana by jbosstm.
the class ExtendedResourceUnitTest method testTopLevelAbort.
@Test
public void testTopLevelAbort() throws Exception {
DemoArjunaResource ares = new DemoArjunaResource();
OTSImpleManager.current().begin();
ArjunaTransactionImple tx = OTSImpleManager.current().getControlWrapper().getImple().getImplHandle();
ExtendedResourceRecord res = new ExtendedResourceRecord(false, new Uid(), ares.getReference(), tx.getControlHandle().get_coordinator(), new Uid(), OTSImpleManager.current().getControlWrapper().getImple().getImplHandle());
assertEquals(res.topLevelPrepare(), TwoPhaseOutcome.PREPARE_OK);
assertEquals(res.topLevelAbort(), TwoPhaseOutcome.FINISH_OK);
OTSImpleManager.current().rollback();
}
use of com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple in project narayana by jbosstm.
the class ExtendedResourceUnitTest method testNestedOnePhase.
@Test
public void testNestedOnePhase() throws Exception {
DemoArjunaResource ares = new DemoArjunaResource();
OTSImpleManager.current().begin();
ArjunaTransactionImple tx = OTSImpleManager.current().getControlWrapper().getImple().getImplHandle();
OTSImpleManager.current().begin();
ExtendedResourceRecord res = new ExtendedResourceRecord(false, new Uid(), ares.getReference(), tx.getControlHandle().get_coordinator(), new Uid(), OTSImpleManager.current().getControlWrapper().getImple().getImplHandle());
assertEquals(res.nestedOnePhaseCommit(), TwoPhaseOutcome.FINISH_OK);
OTSImpleManager.current().rollback();
OTSImpleManager.current().rollback();
}
use of com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple in project narayana by jbosstm.
the class JacORBGenericRecoveryCreatorSuccessUnitTest method testSuccess.
@Test
public void testSuccess() throws Exception {
JacOrbRCServiceInit init = new JacOrbRCServiceInit();
JacOrbRecoveryInit rinit = new JacOrbRecoveryInit();
init.startRCservice();
RecoveryCreator creator = RecoveryCreator.getCreator();
GenericRecoveryCreator generic = null;
if (creator instanceof GenericRecoveryCreator)
generic = (GenericRecoveryCreator) creator;
assertTrue(generic != null);
DemoResource demo = new DemoResource();
ArjunaTransactionImple tx = new ArjunaTransactionImple(null);
Object[] params = new Object[1];
params[0] = tx;
RecoveryCoordinator rc = generic.create(demo.getResource(), params);
assertTrue(rc != null);
generic.destroy(rc);
generic.destroyAll(params);
JacOrbRCServiceInit.shutdownRCService();
}
use of com.arjuna.ats.internal.jts.orbspecific.coordinator.ArjunaTransactionImple in project narayana by jbosstm.
the class ServerNestedOSIActionUnitTest 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());
ServerOSINestedAction act = new ServerOSINestedAction(sc, true);
act.rollback_subtransaction();
}
Aggregations