use of com.arjuna.ats.internal.jts.orbspecific.ControlImple in project narayana by jbosstm.
the class ServerNestedStrictUnitTest method testCommit.
@Test
public void testCommit() 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());
ServerStrictNestedAction act = new ServerStrictNestedAction(sc, true);
assertFalse(act.interposeResource());
act.commit_subtransaction(null);
}
use of com.arjuna.ats.internal.jts.orbspecific.ControlImple in project narayana by jbosstm.
the class ServerTopLevelOSIActionUnitTest method testCommit.
@Test
public void testCommit() 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());
ServerOSITopLevelAction act = new ServerOSITopLevelAction(sc, true);
assertEquals(act.prepare(), Vote.VoteReadOnly);
try {
act.commit();
fail();
} catch (final INVALID_TRANSACTION ex) {
}
assertTrue(act.getReference() != null);
}
use of com.arjuna.ats.internal.jts.orbspecific.ControlImple in project narayana by jbosstm.
the class ServerTopLevelOSIActionUnitTest method testCommitOnePhase.
@Test
public void testCommitOnePhase() 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());
ServerOSITopLevelAction act = new ServerOSITopLevelAction(sc, true);
act.commit_one_phase();
assertTrue(act.type() != null);
}
use of com.arjuna.ats.internal.jts.orbspecific.ControlImple in project narayana by jbosstm.
the class ServerTopLevelOSIActionUnitTest 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());
ServerOSITopLevelAction act = new ServerOSITopLevelAction(sc, true);
assertEquals(act.prepare(), Vote.VoteReadOnly);
try {
act.rollback();
fail();
} catch (final INVALID_TRANSACTION ex) {
}
act.forget();
}
use of com.arjuna.ats.internal.jts.orbspecific.ControlImple in project narayana by jbosstm.
the class OSIInterposition method setupHierarchy.
/*
* Currently assume that formatID and otid are not a unique combination,
* i.e., if we see the same otid but with a different formatID it's
* really the same transaction.
*/
public synchronized ControlImple setupHierarchy(PropagationContext context) throws SystemException {
/*
* Map otid to a Uid.
*/
Uid theUid = OTIDMap.find(context.current.otid);
ServerTopLevelAction proxyAction = present(theUid);
ControlImple controlPtr = null;
if (proxyAction == null) {
/*
* Create a new proxyAction element and return the "current" transaction.
*/
controlPtr = createHierarchy(context, theUid);
} else {
controlPtr = checkHierarchy(proxyAction, context);
}
return controlPtr;
}
Aggregations