use of com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager in project narayana by jbosstm.
the class SagasTestLocal method completeTest.
@Test
public void completeTest() throws Exception {
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
cm.begin("Sagas11HLS");
cm.enlistParticipant(new Participant("p1"));
cm.enlistParticipant(new Participant("p2"));
cm.participantCompleted("p1");
cm.participantCompleted("p2");
cm.close();
}
use of com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager in project narayana by jbosstm.
the class SagasTestLocal method cancelTest.
@Test
public void cancelTest() throws Exception {
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
cm.begin("Sagas11HLS");
cm.enlistParticipant(new Participant("p1"));
cm.enlistParticipant(new Participant("p2"));
cm.participantCompleted("p1");
cm.participantCompleted("p2");
cm.cancel();
}
use of com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager in project narayana by jbosstm.
the class HierarchyTest method testComparision.
@Test
public void testComparision() throws Exception {
CoordinatorManager cm1 = CoordinatorManagerFactory.coordinatorManager();
CoordinatorManager cm2 = CoordinatorManagerFactory.coordinatorManager();
cm1.begin("Sagas11HLS");
ActivityHierarchy hierarchy1 = cm1.suspend();
cm2.begin("Sagas11HLS");
ActivityHierarchy hierarchy2 = cm2.suspend();
try {
Assert.assertFalse(hierarchy1.equals(hierarchy2));
} finally {
cm1.resume(hierarchy1);
cm1.close();
cm2.resume(hierarchy2);
cm2.close();
}
}
use of com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager in project narayana by jbosstm.
the class SuspendResumeMultiParticipantTest method testSuspendResumeMultiParticipant.
@Test
public void testSuspendResumeMultiParticipant() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
try {
cm.begin("Sagas11HLS");
cm.enlistParticipant(new SagasParticipant("p1"));
cm.enlistParticipant(new SagasParticipant("p2"));
System.out.println("Started: " + cm.identifier() + "\n");
ActivityHierarchy hier = cm.suspend();
System.out.println("Suspended: " + hier + "\n");
if (cm.currentActivity() != null) {
WSCF11TestUtils.cleanup(cm);
fail("Hierarchy still active.");
}
cm.resume(hier);
System.out.println("Resumed: " + hier + "\n");
cm.close();
} catch (Exception ex) {
WSCF11TestUtils.cleanup(cm);
throw ex;
}
}
Aggregations