Search in sources :

Example 1 with ContextManager

use of com.arjuna.ats.internal.jts.context.ContextManager in project narayana by jbosstm.

the class ContextManagerUnitTest method testContextManager.

@Test
public void testContextManager() throws Exception {
    ContextManager manager = new ContextManager();
    assertEquals(manager.current(Thread.currentThread().getName()), null);
    assertEquals(manager.current(), null);
    OTSImpleManager.current().begin();
    manager.associate();
    OTSImpleManager.current().suspend();
    OTSImpleManager.current().begin();
    Control ct = OTSImpleManager.current().suspend();
    manager.addRemoteHierarchy(ct);
    manager.popAction();
    OTSImpleManager.current().suspend();
    OTSImpleManager.current().begin();
    ActionControl cont = (ActionControl) OTSImpleManager.current().getControlWrapper().getImple().getControl();
    manager.addActionControlHierarchy(cont);
    manager.purgeActions();
    OTSImpleManager.current().suspend();
    OTSImpleManager.current().begin();
    manager.addControlImpleHierarchy(OTSImpleManager.current().getControlWrapper().getImple());
    manager.purgeActions();
    OTSImpleManager.current().suspend();
}
Also used : Control(org.omg.CosTransactions.Control) ActionControl(com.arjuna.ArjunaOTS.ActionControl) ActionControl(com.arjuna.ArjunaOTS.ActionControl) ContextManager(com.arjuna.ats.internal.jts.context.ContextManager) Test(org.junit.Test)

Aggregations

ActionControl (com.arjuna.ArjunaOTS.ActionControl)1 ContextManager (com.arjuna.ats.internal.jts.context.ContextManager)1 Test (org.junit.Test)1 Control (org.omg.CosTransactions.Control)1