use of com.arjuna.mw.wscf.model.twophase.exceptions.CoordinatorCancelledException in project narayana by jbosstm.
the class CancelOnlyConfirmTest method testCancelOnlyConfirm.
@Test
public void testCancelOnlyConfirm() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
UserCoordinator ua = UserCoordinatorFactory.userCoordinator();
try {
ua.begin("TwoPhase11HLS");
System.out.println("Started: " + ua.identifier() + "\n");
ua.setCancelOnly();
ua.confirm();
fail("Confirm 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.twophase.exceptions.CoordinatorCancelledException 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("TwoPhase11HLS");
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;
}
}
Aggregations