use of com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails in project narayana by jbosstm.
the class TwoPCParticipantTest method testSendAborted.
@Test
public void testSendAborted() throws Exception {
final String messageId = "testSendAborted";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2");
W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId);
CoordinatorClient.getClient().sendAborted(coordinatorEndpoint, map, new InstanceIdentifier("sender"));
CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
assertTrue(details.hasAborted());
checkDetails(details, false, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails in project narayana by jbosstm.
the class TwoPCParticipantTest method testSendPrepared.
@Test
public void testSendPrepared() throws Exception {
final String messageId = "testSendPrepared";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1");
W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId);
CoordinatorClient.getClient().sendPrepared(coordinatorEndpoint, map, new InstanceIdentifier("sender"));
CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
assertTrue(details.hasPrepared());
checkDetails(details, true, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails in project narayana by jbosstm.
the class TwoPCParticipantTest method testSendError.
@Test
public void testSendError() throws Exception {
final String messageId = "testSendError";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5");
W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId);
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);
CoordinatorClient.getClient().sendSoapFault(coordinatorEndpoint, map, soapFault, new InstanceIdentifier("sender"));
CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
assertNotNull(details.hasSoapFault());
assertEquals(details.hasSoapFault().getSoapFaultType(), soapFault.getSoapFaultType());
assertEquals(details.hasSoapFault().getReason(), soapFault.getReason());
assertEquals(details.hasSoapFault().getSubcode(), soapFault.getSubcode());
checkDetails(details, false, false, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails in project narayana by jbosstm.
the class TwoPCParticipantTest method testSendCommitted.
@Test
public void testSendCommitted() throws Exception {
final String messageId = "testSendCommitted";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("4");
W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId);
CoordinatorClient.getClient().sendCommitted(coordinatorEndpoint, map, new InstanceIdentifier("sender"));
CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
assertTrue(details.hasCommitted());
checkDetails(details, false, true, messageId, instanceIdentifier);
}
use of com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails in project narayana by jbosstm.
the class TwoPCParticipantTest method testSendReadOnly.
@Test
public void testSendReadOnly() throws Exception {
final String messageId = "testSendReadOnly";
final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3");
W3CEndpointReference coordinatorEndpoint = TestUtil.getCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorServiceURI, messageId);
CoordinatorClient.getClient().sendReadOnly(coordinatorEndpoint, map, new InstanceIdentifier("sender"));
CoordinatorDetails details = testCoordinatorProcessor.getCoordinatorDetails(messageId, 10000);
assertTrue(details.hasReadOnly());
checkDetails(details, false, true, messageId, instanceIdentifier);
}
Aggregations