use of com.arjuna.wscf.tests.SagasParticipant in project narayana by jbosstm.
the class AddParticipantTest method testAddParticipant.
@Test
public void testAddParticipant() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
try {
cm.begin("Sagas11HLS");
cm.enlistParticipant(new SagasParticipant(null));
System.out.println("Started: " + cm.identifier() + "\n");
cm.complete();
cm.close();
} catch (Exception ex) {
WSCF11TestUtils.cleanup(cm);
throw ex;
}
}
use of com.arjuna.wscf.tests.SagasParticipant in project narayana by jbosstm.
the class ParticipantExitedCloseTest method testParticipantExitedClose.
@Test
public void testParticipantExitedClose() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
try {
String id = "1235";
cm.begin("Sagas11HLS");
SagasParticipant participant = new SagasParticipant(id);
cm.enlistParticipant(participant);
cm.delistParticipant(id);
System.out.println("Started: " + cm.identifier() + "\n");
cm.close();
} catch (Exception ex) {
WSCF11TestUtils.cleanup(cm);
throw ex;
}
}
use of com.arjuna.wscf.tests.SagasParticipant in project narayana by jbosstm.
the class ParticipantCannotCompleteCloseTest method testParticipantCannotCompleteClose.
@Test
public void testParticipantCannotCompleteClose() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
try {
String id = "1234";
cm.begin("Sagas11HLS");
SagasParticipant participant = new SagasParticipant(id);
cm.enlistParticipant(participant);
cm.participantCannotComplete(id);
System.out.println("Started: " + cm.identifier() + "\n");
cm.close();
fail("Close succeeded after participantFaulted");
} catch (CoordinatorCancelledException ex) {
WSCF11TestUtils.cleanup(cm);
} catch (Exception ex) {
WSCF11TestUtils.cleanup(cm);
throw ex;
}
}
use of com.arjuna.wscf.tests.SagasParticipant in project narayana by jbosstm.
the class ParticipantFaultedCloseTest method testParticipantFaultedClose.
@Test
public void testParticipantFaultedClose() throws Exception {
System.out.println("Running test : " + this.getClass().getName());
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
try {
String id = "1236";
cm.begin("Sagas11HLS");
SagasParticipant participant = new SagasParticipant(id);
cm.enlistParticipant(participant);
cm.participantFaulted(id);
System.out.println("Started: " + cm.identifier() + "\n");
cm.close();
fail("Close succeeded after participantFaulted");
} catch (CoordinatorCancelledException ex) {
WSCF11TestUtils.cleanup(cm);
} catch (Exception ex) {
WSCF11TestUtils.cleanup(cm);
throw ex;
}
}
use of com.arjuna.wscf.tests.SagasParticipant 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