use of com.arjuna.wst.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionParticipantTest method testSendCannotComplete.
@Test
public void testSendCannotComplete() throws Exception {
final String messageId = "testSendCannotComplete";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("10");
W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId);
ParticipantCompletionCoordinatorClient.getClient().sendCannotComplete(endpoint, map, new InstanceIdentifier("sender"));
final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000);
assertTrue(details.hasCannotComplete());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionParticipantTest method testSendExit.
@Test
public void testSendExit() throws Exception {
final String messageId = "testSendExit";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("7");
W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId);
ParticipantCompletionCoordinatorClient.getClient().sendExit(endpoint, map, new InstanceIdentifier("sender"));
final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000);
assertTrue(details.hasExit());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionParticipantTest method testSendCompensated.
@Test
public void testSendCompensated() throws Exception {
final String messageId = "testSendCompensated";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3");
W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId);
ParticipantCompletionCoordinatorClient.getClient().sendCompensated(endpoint, map, new InstanceIdentifier("sender"));
final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000);
assertTrue(details.hasCompensated());
checkDetails(details, false, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionParticipantTest method testSendCompleted.
@Test
public void testSendCompleted() throws Exception {
final String messageId = "testSendCompleted";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4");
W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId);
ParticipantCompletionCoordinatorClient.getClient().sendCompleted(endpoint, map, new InstanceIdentifier("sender"));
final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000);
assertTrue(details.hasCompleted());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionParticipantTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendError";
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6");
final String reason = "testSendErrorReason";
final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER;
final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME;
final SoapFault11 soapFault = new SoapFault11(soapFaultType, subcode, reason);
ParticipantCompletionCoordinatorClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction());
final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000);
assertNotNull(details.hasSoapFault());
assertEquals(details.hasSoapFault().getSoapFaultType(), soapFault.getSoapFaultType());
assertEquals(details.hasSoapFault().getSubcode(), soapFault.getSubcode());
assertEquals(details.hasSoapFault().getReason(), soapFault.getReason());
checkDetails(details, false, false, messageId, null);
}
Aggregations