Search in sources :

Example 1 with CoordinatorDetails

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);
}
Also used : CoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 2 with CoordinatorDetails

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);
}
Also used : CoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 3 with CoordinatorDetails

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);
}
Also used : CoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails) SoapFaultType(com.arjuna.webservices.SoapFaultType) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) QName(javax.xml.namespace.QName) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) SoapFault11(com.arjuna.webservices11.SoapFault11) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 4 with CoordinatorDetails

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);
}
Also used : CoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 5 with CoordinatorDetails

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);
}
Also used : CoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Aggregations

InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)5 CoordinatorDetails (com.arjuna.wst.tests.arq.TestCoordinatorProcessor.CoordinatorDetails)5 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)5 MAP (org.jboss.ws.api.addressing.MAP)5 Test (org.junit.Test)5 SoapFaultType (com.arjuna.webservices.SoapFaultType)1 SoapFault11 (com.arjuna.webservices11.SoapFault11)1 QName (javax.xml.namespace.QName)1