use of com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails 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.wst.tests.arq.TestParticipantProcessor.ParticipantDetails in project narayana by jbosstm.
the class TwoPCCoordinatorTest method testSendRollback.
@Test
public void testSendRollback() throws Exception {
final String messageId = "testSendRollback";
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3");
final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
ParticipantClient.getClient().sendRollback(participantEndpointReference, map, new InstanceIdentifier("sender"));
final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000);
assertTrue(details.hasRollback());
checkDetails(details, true, true, messageId, null);
}
use of com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails in project narayana by jbosstm.
the class TwoPCCoordinatorTest method testSendCommit.
@Test
public void testSendCommit() throws Exception {
final String messageId = "testSendCommit";
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2");
final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
ParticipantClient.getClient().sendCommit(participantEndpointReference, map, new InstanceIdentifier("sender"));
final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000);
assertTrue(details.hasCommit());
checkDetails(details, true, true, messageId, null);
}
use of com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails in project narayana by jbosstm.
the class TwoPCCoordinatorTest method testSendPrepare.
@Test
public void testSendPrepare() throws Exception {
final String messageId = "testSendPrepare";
final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId);
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1");
final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
ParticipantClient.getClient().sendPrepare(participantEndpointReference, map, new InstanceIdentifier("sender"));
final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000);
assertTrue(details.hasPrepare());
checkDetails(details, true, true, messageId, null);
}
Aggregations