use of com.arjuna.mw.wsas.completionstatus.Failure in project narayana by jbosstm.
the class TimeoutTest method testTimeout.
@Test
public void testTimeout() throws Exception {
UserActivity ua = UserActivityFactory.userActivity();
int timeout = ua.getTimeout();
try {
ua.setTimeout(1);
ua.start("dummy");
Thread.currentThread();
Thread.sleep(2000);
if (!(ua.status() instanceof Completed)) {
ua.end();
fail("Activity status should be Completed " + ua.status());
}
if (!(ua.getCompletionStatus() instanceof Failure)) {
fail("Activity completion status should be Failure " + ua.getCompletionStatus());
}
System.out.println("Activity status: " + ua.status());
} finally {
ua.setTimeout(timeout);
WSASTestUtils.cleanup(ua);
}
}
Aggregations