Search in sources :

Example 6 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.

the class BusinessAgreementWithCoordinatorCompletionCoordinatorTest method testSendError.

@Test
public void testSendError() throws Exception {
    final String messageId = "testSendError";
    final MAP map = AddressingHelper.createRequestContext(TestUtil.coordinatorCompletionParticipantServiceURI, messageId);
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("9");
    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
    CoordinatorCompletionParticipantClient.getClient().sendSoapFault(soapFault, null, map, TestUtil.getBusinessActivityFaultAction());
    final CoordinatorCompletionParticipantDetails details = testCoordinatorCompletionParticipantProcessor.getCoordinatorCompletionParticipantDetails(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) CoordinatorCompletionParticipantDetails(com.arjuna.wst.tests.arq.TestCoordinatorCompletionParticipantProcessor.CoordinatorCompletionParticipantDetails) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 7 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 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 8 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 in project narayana by jbosstm.

the class CompletionCoordinatorTest method testSendError.

@Test
public void testSendError() throws Exception {
    final String messageId = "123456";
    final String reason = "testSendErrorReason";
    final String instanceIdentifier = "testSendError";
    final W3CEndpointReference completionInitiatorEndpoint = TestUtil.getCompletionInitiatorEndpoint(instanceIdentifier);
    final MAP map = AddressingHelper.createRequestContext(TestUtil.completionInitiatorServiceURI, messageId);
    final SoapFaultType soapFaultType = SoapFaultType.FAULT_SENDER;
    final QName subcode = ArjunaTXConstants.UNKNOWNERROR_ERROR_CODE_QNAME;
    final SoapFault soapFault = new SoapFault11(soapFaultType, subcode, reason);
    final TestCompletionInitiatorCallback callback = new TestCompletionInitiatorCallback() {

        public void soapFault(final SoapFault soapFault, final MAP map, final ArjunaContext arjunaContext) {
            assertEquals(map.getTo(), TestUtil.completionInitiatorServiceURI);
            assertNull(map.getFrom());
            assertNull(map.getFaultTo());
            assertNotNull(map.getReplyTo());
            assertTrue(AddressingHelper.isNoneReplyTo(map));
            assertNotNull(map.getMessageID());
            assertEquals(map.getMessageID(), messageId);
            assertNotNull(arjunaContext);
            assertEquals(instanceIdentifier, arjunaContext.getInstanceIdentifier().getInstanceIdentifier());
            assertNotNull(soapFault);
            assertEquals(soapFaultType, soapFault.getSoapFaultType());
            assertEquals(subcode, soapFault.getSubcode());
            assertEquals(reason, soapFault.getReason());
        }
    };
    final CompletionInitiatorProcessor initiator = CompletionInitiatorProcessor.getProcessor();
    initiator.registerCallback(instanceIdentifier, callback);
    try {
        CompletionInitiatorClient.getClient().sendSoapFault(completionInitiatorEndpoint, map, soapFault, new InstanceIdentifier("sender"));
        callback.waitUntilTriggered();
    } finally {
        initiator.removeCallback(instanceIdentifier);
    }
    assertTrue(callback.hasTriggered());
    assertFalse(callback.hasFailed());
}
Also used : SoapFault(com.arjuna.webservices.SoapFault) SoapFaultType(com.arjuna.webservices.SoapFaultType) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) QName(javax.xml.namespace.QName) CompletionInitiatorProcessor(com.arjuna.webservices11.wsat.processors.CompletionInitiatorProcessor) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) SoapFault11(com.arjuna.webservices11.SoapFault11) ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 9 with SoapFault11

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

Example 10 with SoapFault11

use of com.arjuna.webservices11.SoapFault11 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)

Aggregations

SoapFault11 (com.arjuna.webservices11.SoapFault11)104 MAP (org.jboss.ws.api.addressing.MAP)74 MessageContext (javax.xml.ws.handler.MessageContext)54 Action (javax.xml.ws.Action)51 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)42 RequestWrapper (javax.xml.ws.RequestWrapper)38 SoapFault (com.arjuna.webservices.SoapFault)28 Uid (com.arjuna.ats.arjuna.common.Uid)22 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)18 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)10 Fault (org.xmlsoap.schemas.soap.envelope.Fault)10 Task (com.arjuna.services.framework.task.Task)9 QName (javax.xml.namespace.QName)8 SoapFaultType (com.arjuna.webservices.SoapFaultType)7 Test (org.junit.Test)7 ParticipantEngine (com.arjuna.wst11.messaging.engines.ParticipantEngine)6 SOAPBinding (javax.jws.soap.SOAPBinding)6 SystemException (com.arjuna.wst.SystemException)5 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)5 ParticipantCompletionParticipantEngine (com.arjuna.wst11.messaging.engines.ParticipantCompletionParticipantEngine)5