use of com.arjuna.webservices.SoapFaultType in project narayana by jbosstm.
the class BusinessAgreementWithCoordinatorCompletionCoordinatorTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendError";
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("9");
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);
// this would be a better test if we could set the identifier as a reference parameter here
CoordinatorCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction());
final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(messageId, 10000);
assertNotNull(details.hasSoapFault());
assertEquals(details.hasSoapFault().getSoapFaultType(), soapFaultType);
assertEquals(details.hasSoapFault().getReason(), reason);
assertEquals(details.hasSoapFault().getSubcode(), subcode);
checkDetails(details, false, false, messageId, null);
}
use of com.arjuna.webservices.SoapFaultType 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.webservices.SoapFaultType in project narayana by jbosstm.
the class CompletionCoordinatorTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "123456";
final String reason = "testSendErrorReason";
final String instanceIdentifier = "testSendError";
final W3CEndpointReference completionInitiatorEndpoint = TestUtil.getCompletionInitiatorEndpoint(instanceIdentifier);
final MAP map = AddressingHelper.createRequestContext(TestUtil.completionInitiatorServiceURI, messageId);
final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER;
final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME;
final SoapFault soapFault = new SoapFault11(soapFaultType, subcode, reason);
final TestCompletionInitiatorCallback callback = new TestCompletionInitiatorCallback() {
public void soapFault(final SoapFault soapFault, final MAP map, final ArjunaContext arjunaContext) {
assertEquals(map.getTo(), TestUtil.completionInitiatorServiceURI);
assertNull(map.getFrom());
assertNull(map.getFaultTo());
assertNotNull(map.getReplyTo());
assertTrue(AddressingHelper.isNoneReplyTo(map));
assertNotNull(map.getMessageID());
assertEquals(map.getMessageID(), messageId);
assertNotNull(arjunaContext);
assertEquals(instanceIdentifier, arjunaContext.getInstanceIdentifier().getInstanceIdentifier());
assertNotNull(soapFault);
assertEquals(soapFaultType, soapFault.getSoapFaultType());
assertEquals(subcode, soapFault.getSubcode());
assertEquals(reason, soapFault.getReason());
}
};
final CompletionInitiatorProcessor initiator = CompletionInitiatorProcessor.getProcessor();
initiator.registerCallback(instanceIdentifier, callback);
try {
CompletionInitiatorClient.getClient().sendSoapFault(completionInitiatorEndpoint, map, soapFault, new InstanceIdentifier("sender"));
callback.waitUntilTriggered();
} finally {
initiator.removeCallback(instanceIdentifier);
}
assertTrue(callback.hasTriggered());
assertFalse(callback.hasFailed());
}
use of com.arjuna.webservices.SoapFaultType in project narayana by jbosstm.
the class TwoPCCoordinatorTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendError";
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4");
final String reason = "testSendErrorReason";
final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER;
final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME;
final SoapFault soapFault = new SoapFault11(soapFaultType, subcode, reason);
ParticipantClient.getClient().sendSoapFault(map, soapFault, new InstanceIdentifier("sender"));
final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000);
final SoapFault receivedSoapFault = details.getSoapFault();
assertNotNull(receivedSoapFault);
assertEquals(soapFaultType, receivedSoapFault.getSoapFaultType());
assertEquals(subcode, receivedSoapFault.getSubcode());
assertEquals(reason, receivedSoapFault.getReason());
checkDetails(details, false, false, messageId, null);
}
use of com.arjuna.webservices.SoapFaultType in project narayana by jbosstm.
the class BusinessAgreementWithCoordinatorCompletionParticipantTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendError";
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("7");
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);
// this would be a better test if we could set the identifier as a reference parameter here
CoordinatorCompletionCoordinatorClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction());
final CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000);
assertNotNull(details.hasSoapFault());
assertEquals(details.hasSoapFault().getSoapFaultType(), soapFaultType);
assertEquals(details.hasSoapFault().getReason(), reason);
assertEquals(details.hasSoapFault().getSubcode(), subcode);
checkDetails(details, false, false, messageId, null);
}
Aggregations