use of com.arjuna.mw.wscf.model.sagas.api.UserCoordinator in project narayana by jbosstm.
the class BeginCloseTest method testBeginClose.
@Test
public void testBeginClose() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
try {
ua.begin("Sagas11HLS");
System.out.println("Started: " + ua.identifier() + "\n");
ua.close();
} catch (Exception ex) {
WSCF11TestUtils.cleanup(ua);
throw ex;
}
}
use of com.arjuna.mw.wscf.model.sagas.api.UserCoordinator in project narayana by jbosstm.
the class SuspendResumeTest method testSuspendResume.
@Test
public void testSuspendResume() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
try {
ua.begin("Sagas11HLS");
System.out.println("Started: " + ua.identifier() + "\n");
ActivityHierarchy hier = ua.suspend();
System.out.println("Suspended: " + hier + "\n");
if (ua.currentActivity() != null) {
WSCF11TestUtils.cleanup(ua);
fail("Hierarchy still active");
} else {
ua.resume(hier);
System.out.println("Resumed: " + hier + "\n");
ua.cancel();
System.out.println("Cancelled");
}
} catch (Exception ex) {
WSCF11TestUtils.cleanup(ua);
throw ex;
}
}
Aggregations