use of com.arjuna.wscf.tests.TwoPhaseSynchronization in project narayana by jbosstm.
the class SuspendParticipantTest method testSuspendParticipant.
@Test
public void testSuspendParticipant() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
try {
cm.begin("TwoPhase11HLS");
cm.enlistParticipant(new TwoPhaseParticipant("p1"));
cm.enlistParticipant(new TwoPhaseParticipant("p2"));
cm.enlistSynchronization(new TwoPhaseSynchronization());
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.confirm();
} catch (Exception ex) {
WSCF11TestUtils.cleanup(cm);
throw ex;
}
}
use of com.arjuna.wscf.tests.TwoPhaseSynchronization in project narayana by jbosstm.
the class AddSynchronizationTest method testAddSynchronization.
@Test
public void testAddSynchronization() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
try {
cm.begin("TwoPhase11HLS");
cm.enlistSynchronization(new TwoPhaseSynchronization());
System.out.println("Started: " + cm.identifier() + "\n");
cm.confirm();
} catch (Exception ex) {
WSCF11TestUtils.cleanup(cm);
throw ex;
}
}
use of com.arjuna.wscf.tests.TwoPhaseSynchronization in project narayana by jbosstm.
the class ParticipantSynchronizationTest method testParticipantSynchronization.
@Test
public void testParticipantSynchronization() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
try {
cm.begin("TwoPhase11HLS");
cm.enlistParticipant(new TwoPhaseParticipant(null));
cm.enlistParticipant(new TwoPhaseParticipant(null));
cm.enlistSynchronization(new TwoPhaseSynchronization());
System.out.println("Started: " + cm.identifier() + "\n");
cm.confirm();
} catch (Exception ex) {
WSCF11TestUtils.cleanup(cm);
throw ex;
}
}
Aggregations