Search in sources :

Example 1 with CoordinatorCompletionCoordinatorDetails

use of com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails in project narayana by jbosstm.

the class BusinessAgreementWithCoordinatorCompletionParticipantTest method testSendCompensated.

@Test
public void testSendCompensated() throws Exception {
    final String messageId = "testSendCompensated";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3");
    W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId);
    CoordinatorCompletionCoordinatorClient.getClient().sendCompensated(endpoint, map, new InstanceIdentifier("sender"));
    CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000);
    assertTrue(details.hasCompensated());
    checkDetails(details, false, true, messageId, instanceIdentifier);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) CoordinatorCompletionCoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails) Test(org.junit.Test)

Example 2 with CoordinatorCompletionCoordinatorDetails

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

Example 3 with CoordinatorCompletionCoordinatorDetails

use of com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails in project narayana by jbosstm.

the class BusinessAgreementWithCoordinatorCompletionParticipantTest method testSendCancelled.

public void testSendCancelled() throws Exception {
    final String messageId = "testSendCancelled";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2");
    W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId);
    CoordinatorCompletionCoordinatorClient.getClient().sendCancelled(endpoint, map, new InstanceIdentifier("sender"));
    CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000);
    assertTrue(details.hasCancelled());
    checkDetails(details, false, true, messageId, instanceIdentifier);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) CoordinatorCompletionCoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails)

Example 4 with CoordinatorCompletionCoordinatorDetails

use of com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails in project narayana by jbosstm.

the class BusinessAgreementWithCoordinatorCompletionParticipantTest method testSendCompleted.

@Test
public void testSendCompleted() throws Exception {
    final String messageId = "testSendCompleted";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5");
    W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId);
    CoordinatorCompletionCoordinatorClient.getClient().sendCompleted(endpoint, map, new InstanceIdentifier("sender"));
    CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000);
    assertTrue(details.hasCompleted());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) CoordinatorCompletionCoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails) Test(org.junit.Test)

Example 5 with CoordinatorCompletionCoordinatorDetails

use of com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails in project narayana by jbosstm.

the class BusinessAgreementWithCoordinatorCompletionParticipantTest method testSendStatus.

@Test
public void testSendStatus() throws Exception {
    final String messageId = "testSendStatus";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6");
    W3CEndpointReference endpoint = TestUtil.getCoordinatorCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionCoordinatorServiceURI, messageId);
    final State state = State.STATE_COMPENSATING;
    CoordinatorCompletionCoordinatorClient.getClient().sendStatus(endpoint, map, new InstanceIdentifier("sender"), state.getValue());
    CoordinatorCompletionCoordinatorDetails details = testCoordinatorCompletionCoordinatorProcessor.getCoordinatorCompletionCoordinatorDetails(messageId, 10000);
    assertNotNull(details.hasStatus());
    assertEquals(details.hasStatus().getState(), state.getValue());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) State(com.arjuna.webservices11.wsba.State) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) CoordinatorCompletionCoordinatorDetails(com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails) Test(org.junit.Test)

Aggregations

InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)9 CoordinatorCompletionCoordinatorDetails (com.arjuna.wst.tests.arq.TestCoordinatorCompletionCoordinatorProcessor.CoordinatorCompletionCoordinatorDetails)9 MAP (org.jboss.ws.api.addressing.MAP)9 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)8 Test (org.junit.Test)8 State (com.arjuna.webservices11.wsba.State)2 SoapFaultType (com.arjuna.webservices.SoapFaultType)1 SoapFault11 (com.arjuna.webservices11.SoapFault11)1 QName (javax.xml.namespace.QName)1