use of com.hp.mwtests.ts.jts.orbspecific.resources.DemoArjunaResource 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.hp.mwtests.ts.jts.orbspecific.resources.DemoArjunaResource 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.hp.mwtests.ts.jts.orbspecific.resources.DemoArjunaResource 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();
}
Aggregations