Package javax.jbi.messaging

Examples of javax.jbi.messaging.RobustInOnly


   
    public void testRobustInOnly() throws Exception {
        activateComponent(new ReturnOutComponent(), "transformer");
        ReceiverComponent target = activateReceiver("target");

        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("pipeline"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.DONE, me.getStatus());
       
        target.getMessageList().assertMessagesReceived(1);
       
        listener.assertExchangeCompleted();
    }
View Full Code Here


   
    public void testRobustInOnlyWithTransformerFault() throws Exception {
        activateComponent(new ReturnFaultComponent(), "transformer");
        ReceiverComponent target = activateReceiver("target");

        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("pipeline"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getFault());
        client.done(me);
       
        target.getMessageList().assertMessagesReceived(0);
       
        listener.assertExchangeCompleted();
View Full Code Here

    public void testRobustInOnlyWithTransformerFaultSentToTarget() throws Exception {
        pipeline.setSendFaultsToTarget(true);
        activateComponent(new ReturnFaultComponent(), "transformer");
        ReceiverComponent target = activateReceiver("target");

        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("pipeline"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.DONE, me.getStatus());
       
        target.getMessageList().assertMessagesReceived(1);
       
        listener.assertExchangeCompleted();
    }
View Full Code Here

   
    public void testRobustInOnlyWithTransformerFaultAndError() throws Exception {
        activateComponent(new ReturnFaultComponent(), "transformer");
        ReceiverComponent target = activateReceiver("target");

        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("pipeline"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getFault());
        client.fail(me, new Exception("I do not like faults"));
       
        target.getMessageList().assertMessagesReceived(0);
       
        listener.assertExchangeCompleted();
View Full Code Here

   
    public void testRobustInOnlyWithTransformerError() throws Exception {
        activateComponent(new ReturnErrorComponent(), "transformer");
        ReceiverComponent target = activateReceiver("target");

        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("pipeline"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ERROR, me.getStatus());
       
        target.getMessageList().assertMessagesReceived(0);
       
        listener.assertExchangeCompleted();
    }
View Full Code Here

   
    public void testRobustInOnlyWithTargetFault() throws Exception {
        activateComponent(new ReturnOutComponent(), "transformer");
        activateComponent(new ReturnFaultComponent(), "target");

        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("pipeline"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getFault());
        client.done(me);
       
        listener.assertExchangeCompleted();
    }
View Full Code Here

   
    public void testRobustInOnlyWithTargetFaultAndError() throws Exception {
        activateComponent(new ReturnOutComponent(), "transformer");
        activateComponent(new ReturnFaultComponent(), "target");

        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("pipeline"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ACTIVE, me.getStatus());
        assertNotNull(me.getFault());
        client.fail(me, new Exception("I do not like faults"));
       
        listener.assertExchangeCompleted();
    }
View Full Code Here

   
    public void testRobustInOnlyWithTargetError() throws Exception {
        activateComponent(new ReturnOutComponent(), "transformer");
        activateComponent(new ReturnErrorComponent(), "target");

        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("pipeline"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ERROR, me.getStatus());
       
        listener.assertExchangeCompleted();
    }
View Full Code Here

    public void testRobustInOnly() throws Exception {
        ReceiverComponent r1 = activateReceiver("recipient1");
        ReceiverComponent r2 = activateReceiver("recipient2");
        ReceiverComponent r3 = activateReceiver("recipient3");
       
        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("recipientList"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.DONE, me.getStatus());
       
        r1.getMessageList().assertMessagesReceived(1);
        r2.getMessageList().assertMessagesReceived(1);
        r3.getMessageList().assertMessagesReceived(1);
    }
View Full Code Here

        assertNotNull(me.getError());
        assertEquals("Use an InOut MEP", me.getError().getMessage());
    }

    public void testRobustInOnly() throws Exception {
        RobustInOnly me = client.createRobustInOnlyExchange();
        me.setService(new QName("routingSlip"));
        me.getInMessage().setContent(createSource("<hello/>"));
        client.sendSync(me);
        assertEquals(ExchangeStatus.ERROR, me.getStatus());
        assertNotNull(me.getError());
        assertEquals("Use an InOut MEP", me.getError().getMessage());
    }
View Full Code Here

TOP

Related Classes of javax.jbi.messaging.RobustInOnly

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.