Search in sources :

Example 41 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class BusinessAgreementWithParticipantCompletionParticipantTest method testSendCannotComplete.

@Test
public void testSendCannotComplete() throws Exception {
    final String messageId = "testSendCannotComplete";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("10");
    W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId);
    ParticipantCompletionCoordinatorClient.getClient().sendCannotComplete(endpoint, map, new InstanceIdentifier("sender"));
    final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000);
    assertTrue(details.hasCannotComplete());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : ParticipantCompletionCoordinatorDetails(com.arjuna.wst.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 42 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class BusinessAgreementWithParticipantCompletionParticipantTest method testSendExit.

@Test
public void testSendExit() throws Exception {
    final String messageId = "testSendExit";
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("7");
    W3CEndpointReference endpoint = TestUtil.getParticipantCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    final MAP map = AddressingHelper.createRequestContext(TestUtil.participantCompletionCoordinatorServiceURI, messageId);
    ParticipantCompletionCoordinatorClient.getClient().sendExit(endpoint, map, new InstanceIdentifier("sender"));
    final ParticipantCompletionCoordinatorDetails details = testParticipantCompletionCoordinatorProcessor.getParticipantCompletionCoordinatorDetails(messageId, 10000);
    assertTrue(details.hasExit());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : ParticipantCompletionCoordinatorDetails(com.arjuna.wst.tests.arq.TestParticipantCompletionCoordinatorProcessor.ParticipantCompletionCoordinatorDetails) W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 43 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class CompletionParticipantTest method testSendCommit.

@Test
public void testSendCommit() throws Exception {
    final String messageId = "testSendCommit";
    final MAP map = AddressingHelper.createRequestContext(TestUtil.completionCoordinatorServiceURI, messageId);
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("1");
    final W3CEndpointReference endpoint = TestUtil.getCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    CompletionCoordinatorClient.getClient().sendCommit(endpoint, map, new InstanceIdentifier("sender"));
    final CompletionCoordinatorDetails details = testCompletionCoordinatorProcessor.getCompletionCoordinatorDetails(messageId, 10000);
    assertTrue(details.hasCommit());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) CompletionCoordinatorDetails(com.arjuna.wst.tests.arq.TestCompletionCoordinatorProcessor.CompletionCoordinatorDetails) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 44 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class CompletionParticipantTest method testSendRollback.

@Test
public void testSendRollback() throws Exception {
    final String messageId = "testSendRollback";
    final MAP map = AddressingHelper.createRequestContext(TestUtil.completionCoordinatorServiceURI, messageId);
    final InstanceIdentifier instanceIdentifier = new InstanceIdentifier("2");
    final W3CEndpointReference endpoint = TestUtil.getCompletionCoordinatorEndpoint(instanceIdentifier.getInstanceIdentifier());
    CompletionCoordinatorClient.getClient().sendRollback(endpoint, map, new InstanceIdentifier("sender"));
    final CompletionCoordinatorDetails details = testCompletionCoordinatorProcessor.getCompletionCoordinatorDetails(messageId, 10000);
    assertTrue(details.hasRollback());
    checkDetails(details, true, true, messageId, instanceIdentifier);
}
Also used : W3CEndpointReference(javax.xml.ws.wsaddressing.W3CEndpointReference) CompletionCoordinatorDetails(com.arjuna.wst.tests.arq.TestCompletionCoordinatorProcessor.CompletionCoordinatorDetails) InstanceIdentifier(com.arjuna.webservices11.wsarj.InstanceIdentifier) MAP(org.jboss.ws.api.addressing.MAP) Test(org.junit.Test)

Example 45 with MAP

use of org.jboss.ws.api.addressing.MAP in project narayana by jbosstm.

the class CompletionParticipantTest method checkDetails.

private void checkDetails(CompletionCoordinatorDetails details, boolean hasFrom, boolean hasFaultTo, String messageId, InstanceIdentifier instanceIdentifier) {
    MAP inMAP = details.getMAP();
    ArjunaContext inArjunaContext = details.getArjunaContext();
    assertEquals(inMAP.getTo(), TestUtil.completionCoordinatorServiceURI);
    assertNotNull(inMAP.getReplyTo());
    assertTrue(AddressingHelper.isNoneReplyTo(inMAP));
    if (hasFrom) {
        assertNotNull(inMAP.getFrom());
        assertEquals(inMAP.getFrom().getAddress(), TestUtil.completionInitiatorServiceURI);
    } else {
        assertNull(inMAP.getFrom());
    }
    if (hasFaultTo) {
        assertNotNull(inMAP.getFaultTo());
        assertEquals(inMAP.getFaultTo().getAddress(), TestUtil.completionInitiatorServiceURI);
    } else {
        assertNull(inMAP.getFrom());
    }
    assertNotNull(inMAP.getMessageID());
    assertEquals(inMAP.getMessageID(), messageId);
    if (instanceIdentifier == null) {
        assertNull(inArjunaContext);
    } else {
        assertNotNull(inArjunaContext);
        assertEquals(instanceIdentifier.getInstanceIdentifier(), inArjunaContext.getInstanceIdentifier().getInstanceIdentifier());
    }
}
Also used : ArjunaContext(com.arjuna.webservices11.wsarj.ArjunaContext) MAP(org.jboss.ws.api.addressing.MAP)

Aggregations

MAP (org.jboss.ws.api.addressing.MAP)322 MessageContext (javax.xml.ws.handler.MessageContext)119 Action (javax.xml.ws.Action)104 ArjunaContext (com.arjuna.webservices11.wsarj.ArjunaContext)81 InstanceIdentifier (com.arjuna.webservices11.wsarj.InstanceIdentifier)75 SoapFault11 (com.arjuna.webservices11.SoapFault11)65 Task (com.arjuna.services.framework.task.Task)62 W3CEndpointReference (javax.xml.ws.wsaddressing.W3CEndpointReference)53 Test (org.junit.Test)51 RequestWrapper (javax.xml.ws.RequestWrapper)41 CoordinationContextType (org.oasis_open.docs.ws_tx.wscoor._2006._06.CoordinationContextType)40 NotificationType (org.oasis_open.docs.ws_tx.wsba._2006._06.NotificationType)29 SoapFault (com.arjuna.webservices.SoapFault)24 ATInitiatorProcessor (com.jboss.transaction.txinterop.webservices.atinterop.processors.ATInitiatorProcessor)15 InitiatorProcessor (com.jboss.transaction.wstf.webservices.sc007.processors.InitiatorProcessor)15 Notification (org.oasis_open.docs.ws_tx.wsat._2006._06.Notification)15 QName (javax.xml.namespace.QName)13 BAInitiatorProcessor (com.jboss.transaction.txinterop.webservices.bainterop.processors.BAInitiatorProcessor)12 SystemException (com.arjuna.wst.SystemException)11 UnknownTransactionException (com.arjuna.wst.UnknownTransactionException)11