Search in sources :

Example 1 with ParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails 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 2 with ParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails in project narayana by jbosstm.

the class TwoPCCoordinatorTest method testSendRollback.

@Test
public void testSendRollback() throws Exception {
    final String messageId = "testSendRollback";
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId);
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("3");
    final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
    ParticipantClient.getClient().sendRollback(participantEndpointReference, map, new InstanceIdentifier("sender"));
    final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000);
    assertTrue(details.hasRollback());
    checkDetails(details, true, true, messageId, null);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) ParticipantDetails(com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 3 with ParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails in project narayana by jbosstm.

the class TwoPCCoordinatorTest method testSendCommit.

@Test
public void testSendCommit() throws Exception {
    final String messageId = "testSendCommit";
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId);
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2");
    final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
    ParticipantClient.getClient().sendCommit(participantEndpointReference, map, new InstanceIdentifier("sender"));
    final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000);
    assertTrue(details.hasCommit());
    checkDetails(details, true, true, messageId, null);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) ParticipantDetails(com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 4 with ParticipantDetails

use of com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails in project narayana by jbosstm.

the class TwoPCCoordinatorTest method testSendPrepare.

@Test
public void testSendPrepare() throws Exception {
    final String messageId = "testSendPrepare";
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantServiceURI, messageId);
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1");
    final W3CEndpointReference participantEndpointReference = TestUtil.getParticipantEndpoint(null);
    ParticipantClient.getClient().sendPrepare(participantEndpointReference, map, new InstanceIdentifier("sender"));
    final ParticipantDetails details = testParticipantProcessor.getParticipantDetails(messageId, 10000);
    assertTrue(details.hasPrepare());
    checkDetails(details, true, true, messageId, null);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) ParticipantDetails(com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Aggregations

InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)4 ParticipantDetails (com.arjuna.wst.tests.arq.TestParticipantProcessor.ParticipantDetails)4 MAP (org.jboss.ws.api.addressing.MAP)4 Test (org.junit.Test)4 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)3 SoapFault (com.arjuna.webservices.SoapFault)1 SoapFaultType (com.arjuna.webservices.SoapFaultType)1 SoapFault11 (com.arjuna.webservices11.SoapFault11)1 QName (javax.xml.namespace.QName)1