use of com.arjuna.mw.wscf.model.sagas.api.UserCoordinator in project narayana by jbosstm.
the class CancelOnlyCloseTest method testCancelOnlyClose.
@Test
public void testCancelOnlyClose() 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.setCancelOnly();
ua.close();
fail("Close succeeded after setCancelOnly");
} catch (CoordinatorCancelledException ex) {
// we should get here
WSCF11TestUtils.cleanup(ua);
} 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 SuspendCloseTest method testSuspendClose.
@Test
public void testSuspendClose() 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.");
}
ua.close();
} catch (NoCoordinatorException ex) {
WSCF11TestUtils.cleanup(ua);
} 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 BeginCancelTest method testBeginCancel.
@Test
public void testBeginCancel() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
ua.begin("Sagas11HLS");
System.out.println("Started: " + ua.identifier() + "\n");
ua.cancel();
System.out.println("Cancelled");
}
use of com.arjuna.mw.wscf.model.sagas.api.UserCoordinator in project narayana by jbosstm.
the class CancelOnlyCancelTest method testCancelOnlyCancel.
@Test
public void testCancelOnlyCancel() 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.setCancelOnly();
ua.cancel();
} catch (CoordinatorCancelledException ex) {
// why is it ok to get here?
WSCF11TestUtils.cleanup(ua);
} 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 SuspendTest method testSuspend.
@Test
public void testSuspend() 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.");
}
} catch (NoCoordinatorException ex) {
// why is it ok to get here?
} catch (Exception ex) {
WSCF11TestUtils.cleanup(ua);
throw ex;
}
}
Aggregations