Search in sources :

Example 11 with HLS

use of com.arjuna.mw.wsas.activity.HLS in project narayana by jbosstm.

the class ContextTest method testContext.

@Test
public void testContext() throws Exception {
    UserActivity ua = UserActivityFactory.userActivity();
    HLS[] currentHLS = ActivityManagerFactory.activityManager().allHighLevelServices();
    for (HLS hls : currentHLS) {
        ActivityManagerFactory.activityManager().removeHLS(hls);
    }
    try {
        ua.start("dummy");
        System.out.println("Started: " + ua.activityName());
        ua.start("dummy");
        System.out.println("Started: " + ua.activityName());
        ContextManager manager = new ContextManager();
        com.arjuna.mw.wsas.context.Context context = manager.context("dummy");
        if (context != null) {
            fail("Context not null: " + context);
        }
    } finally {
        try {
            for (HLS hls : currentHLS) {
                ActivityManagerFactory.activityManager().addHLS(hls);
            }
        } catch (Exception e) {
        }
        WSASTestUtils.cleanup(ua);
    }
}
Also used : ContextManager(com.arjuna.mw.wsas.context.ContextManager) UserActivity(com.arjuna.mw.wsas.UserActivity) HLS(com.arjuna.mw.wsas.activity.HLS) Test(org.junit.Test)

Aggregations

HLS (com.arjuna.mw.wsas.activity.HLS)11 NoActivityException (com.arjuna.mw.wsas.exceptions.NoActivityException)6 SystemException (com.arjuna.mw.wsas.exceptions.SystemException)6 InvalidActivityException (com.arjuna.mw.wsas.exceptions.InvalidActivityException)5 InvalidTimeoutException (com.arjuna.mw.wsas.exceptions.InvalidTimeoutException)5 NoPermissionException (com.arjuna.mw.wsas.exceptions.NoPermissionException)5 ProtocolViolationException (com.arjuna.mw.wsas.exceptions.ProtocolViolationException)5 WrongStateException (com.arjuna.mw.wsas.exceptions.WrongStateException)5 ActivityImple (com.arjuna.mwlabs.wsas.activity.ActivityImple)5 ActiveChildException (com.arjuna.mw.wsas.exceptions.ActiveChildException)4 EmptyStackException (java.util.EmptyStackException)4 UserActivity (com.arjuna.mw.wsas.UserActivity)3 Outcome (com.arjuna.mw.wsas.activity.Outcome)3 ContextManager (com.arjuna.mw.wsas.context.ContextManager)3 Test (org.junit.Test)3 Context (com.arjuna.mw.wsas.context.Context)2 SOAPContext (com.arjuna.mw.wsas.context.soap.SOAPContext)2 ActivityHierarchyImple (com.arjuna.mwlabs.wsas.activity.ActivityHierarchyImple)2 DemoHLS (com.arjuna.wsas.tests.DemoHLS)2 DemoSOAPContextImple (com.arjuna.wsas.tests.DemoSOAPContextImple)2