Search in sources :

Example 11 with NoActivityException

use of com.arjuna.mw.wsas.exceptions.NoActivityException in project narayana by jbosstm.

the class HierarchyTest method testHierarchy.

@Test
public void testHierarchy() throws Exception {
    UserActivity ua = UserActivityFactory.userActivity();
    try {
        ua.start("dummy");
        System.out.println("Started: " + ua.activityName());
        ua.start("dummy");
        System.out.println("Started: " + ua.activityName());
        ActivityHierarchy ctx = ua.currentActivity();
        System.out.println("\nHierarchy: " + ctx);
        if (ctx == null) {
            fail("current activity should not be null");
        } else {
            ua.end();
            System.out.println("\nCurrent: " + ua.activityName());
            ua.end();
            try {
                if (ua.activityName() != null) {
                    fail("activity name should be null but is " + ua.activityName());
                }
            } catch (NoActivityException ex) {
            // ok if we get here
            }
        }
    } catch (Exception ex) {
        WSASTestUtils.cleanup(ua);
        throw ex;
    }
}
Also used : UserActivity(com.arjuna.mw.wsas.UserActivity) NoActivityException(com.arjuna.mw.wsas.exceptions.NoActivityException) ActivityHierarchy(com.arjuna.mw.wsas.activity.ActivityHierarchy) NoActivityException(com.arjuna.mw.wsas.exceptions.NoActivityException) Test(org.junit.Test)

Example 12 with NoActivityException

use of com.arjuna.mw.wsas.exceptions.NoActivityException in project narayana by jbosstm.

the class NullEndTest method testNullEnd.

@Test
public void testNullEnd() throws Exception {
    UserActivity ua = UserActivityFactory.userActivity();
    try {
        ua.end();
        fail("should have thrown NoActivityException");
    } catch (NoActivityException ex) {
    // it's ok if we arrive here?
    } catch (Exception ex) {
        WSASTestUtils.cleanup(ua);
        throw ex;
    }
}
Also used : UserActivity(com.arjuna.mw.wsas.UserActivity) NoActivityException(com.arjuna.mw.wsas.exceptions.NoActivityException) NoActivityException(com.arjuna.mw.wsas.exceptions.NoActivityException) Test(org.junit.Test)

Aggregations

NoActivityException (com.arjuna.mw.wsas.exceptions.NoActivityException)12 SystemException (com.arjuna.mw.wsas.exceptions.SystemException)7 InvalidCreateParametersException (com.arjuna.wsc.InvalidCreateParametersException)5 InvalidProtocolException (com.arjuna.wsc.InvalidProtocolException)5 UserActivity (com.arjuna.mw.wsas.UserActivity)3 HLS (com.arjuna.mw.wsas.activity.HLS)3 ActivityImple (com.arjuna.mwlabs.wsas.activity.ActivityImple)3 SubordinateATCoordinator (com.arjuna.mwlabs.wscf.model.twophase.arjunacore.subordinate.SubordinateATCoordinator)3 ServiceRegistry (com.arjuna.webservices11.ServiceRegistry)3 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)3 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)3 Test (org.junit.Test)3 CoordinationContext (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContext)3 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)3 Expires (org.oasis_open.docs.ws_tx.wscoor._2006._06.Expires)3 Outcome (com.arjuna.mw.wsas.activity.Outcome)2 ActiveChildException (com.arjuna.mw.wsas.exceptions.ActiveChildException)2 InvalidActivityException (com.arjuna.mw.wsas.exceptions.InvalidActivityException)2 InvalidTimeoutException (com.arjuna.mw.wsas.exceptions.InvalidTimeoutException)2 NoPermissionException (com.arjuna.mw.wsas.exceptions.NoPermissionException)2