use of com.arjuna.mw.wsas.UserActivity 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;
}
}
use of com.arjuna.mw.wsas.UserActivity 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;
}
}
Aggregations