Search in sources :

Example 1 with ParticipantCompletionParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.

the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendCancel.

@Test
public void testSendCancel() throws Exception {
    final String messageId = "testSendCancel";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2");
    W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
    ParticipantCompletionParticipantClient.getClient().sendCancel(endpoint, map, new InstanceIdentifier("sender"));
    final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
    assertTrue(details.hasCancel());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : ParticipantCompletionParticipantDetails(com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails) 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 ParticipantCompletionParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.

the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendStatus.

@Test
public void testSendStatus() throws Exception {
    final String messageId = "testSendStatus";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("6");
    W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
    final State state = State.STATE_ACTIVE;
    ParticipantCompletionParticipantClient.getClient().sendStatus(endpoint, map, new InstanceIdentifier("sender"), state.getValue());
    final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
    assertNotNull(details.hasStatus());
    ;
    assertEquals(details.hasStatus().getState(), state.getValue());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : ParticipantCompletionParticipantDetails(com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails) 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) Test(org.junit.Test)

Example 3 with ParticipantCompletionParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails 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);
}
Also used : SoapFaultType(com.arjuna.webservices.SoapFaultType) ParticipantCompletionParticipantDetails(com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails) 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 ParticipantCompletionParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.

the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendCompensate.

@Test
public void testSendCompensate() throws Exception {
    final String messageId = "testSendCompensate";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3");
    W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
    ParticipantCompletionParticipantClient.getClient().sendCompensate(endpoint, map, new InstanceIdentifier("sender"));
    final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
    assertTrue(details.hasCompensate());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : ParticipantCompletionParticipantDetails(com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails) 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 ParticipantCompletionParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails in project narayana by jbosstm.

the class BusinessAgreementWithParticipantCompletionCoordinatorTest method testSendExited.

@Test
public void testSendExited() throws Exception {
    final String messageId = "testSendExited";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("5");
    W3CEndpointReference endpoint = TestUtil.getParticipantCompletionParticipantEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionParticipantServiceURI, messageId);
    ParticipantCompletionParticipantClient.getClient().sendExited(endpoint, map, new InstanceIdentifier("sender"));
    final ParticipantCompletionParticipantDetails details = testParticipantCompletionParticipantProcessor.getParticipantCompletionParticipantDetails(messageId, 10000);
    assertTrue(details.hasExited());
    checkDetails(details, false, true, messageId, instanceIdentifier);
}
Also used : ParticipantCompletionParticipantDetails(com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails) 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)9 ParticipantCompletionParticipantDetails (com.arjuna.wst.tests.arq.TestParticipantCompletionParticipantProcessor.ParticipantCompletionParticipantDetails)9 MAP (org.jboss.ws.api.addressing.MAP)9 Test (org.junit.Test)9 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)8 SoapFaultType (com.arjuna.webservices.SoapFaultType)1 SoapFault11 (com.arjuna.webservices11.SoapFault11)1 State (com.arjuna.webservices11.wsba.State)1 QName (javax.xml.namespace.QName)1