use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendCancel.
@Test
public void testSendCancel() throws Exception {
final String messageId = "testSendCancel";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2");
W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
ParticipantCompletionParticipantClient.getClient().sendCancel(endpoint, map, new InstanceIdentifier("sender"));
final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
assertTrue(details.hasCancel());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendStatus.
@Test
public void testSendStatus() throws Exception {
final String messageId = "testSendStatus";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6");
W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
final State state = State.STATE_ACTIVE;
ParticipantCompletionParticipantClient.getClient().sendStatus(endpoint, map, new InstanceIdentifier("sender"), state.getValue());
final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
assertNotNull(details.hasStatus());
;
assertEquals(details.hasStatus().getState(), state.getValue());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendGetStatus";
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("8");
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);
ParticipantCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction());
final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
assertNotNull(details.getSoapFault());
assertEquals(details.getSoapFault().getSoapFaultType(), soapFault.getSoapFaultType());
assertEquals(details.getSoapFault().getReason(), soapFault.getReason());
assertEquals(details.getSoapFault().getSubcode(), soapFault.getSubcode());
checkDetails(details, false, false, messageId, null);
}
use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendCompensate.
@Test
public void testSendCompensate() throws Exception {
final String messageId = "testSendCompensate";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3");
W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
ParticipantCompletionParticipantClient.getClient().sendCompensate(endpoint, map, new InstanceIdentifier("sender"));
final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
assertTrue(details.hasCompensate());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.
the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendExited.
@Test
public void testSendExited() throws Exception {
final String messageId = "testSendExited";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5");
W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
ParticipantCompletionParticipantClient.getClient().sendExited(endpoint, map, new InstanceIdentifier("sender"));
final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
assertTrue(details.hasExited());
checkDetails(details, false, true, messageId, instanceIdentifier);
}
Aggregations