use of com.arjuna.mw.wscf.model.sagas.api.CoordinatorManager 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.mw.wscf.model.sagas.api.CoordinatorManager 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.mw.wscf.model.sagas.api.CoordinatorManager 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.mw.wscf.model.sagas.api.CoordinatorManager 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.mw.wscf.model.sagas.api.CoordinatorManager in project narayana by jbosstm.
the class SagasTestLocal method cannotComplete.
@Test(expected = CoordinatorCancelledException.class)
public void cannotComplete() throws Exception {
CoordinatorManager cm = CoordinatorManagerFactory.coordinatorManager();
cm.begin("Sagas11HLS");
cm.enlistParticipant(new Participant("p1"));
cm.enlistParticipant(new Participant("p2"));
cm.participantCompleted("p1");
cm.participantCannotComplete("p2");
cm.close();
}
Aggregations