Package org.camelcookbook.routing.model

Examples of org.camelcookbook.routing.model.Cheese


        return new WireTapStateLeaksRouteBuilder();
    }

    @Test
    public void testOutMessageAffectedByTappedRoute() throws InterruptedException {
        final Cheese cheese = new Cheese();
        cheese.setAge(1);

        // should receive same object that was sent
        out.expectedBodiesReceived(cheese);
        // since no copy, should have updated age
        out.message(0).expression(simple("${body.age} == 2"));
View Full Code Here


        return new WireTapStateNoLeaksRouteBuilder();
    }

    @Test
    public void testOutMessageUnaffectedByTappedRoute() throws InterruptedException {
        final Cheese cheese = new Cheese();
        cheese.setAge(1);

        // should receive same object that was sent
        out.expectedBodiesReceived(cheese);
        out.setExpectedMessageCount(1);
        // since copy was sent to wire tap, age should remain unchanged
        out.message(0).body().isEqualTo(cheese);
        out.message(0).expression(simple("${body.age} == 1"));

        tapped.setExpectedMessageCount(1);
        tapped.message(0).expression(simple("${body.age} == 2"));
        tapped.setResultWaitTime(1000);

        template.sendBody(cheese);

        assertMockEndpointsSatisfied();

        final Cheese outCheese = out.getReceivedExchanges().get(0).getIn().getBody(Cheese.class);
        final Cheese tappedCheese = tapped.getReceivedExchanges().get(0).getIn().getBody(Cheese.class);

        LOG.info("cheese = {}; out = {}; tapped = {}", cheese, outCheese, tappedCheese);

        LOG.info("cheese == out = {}", (cheese == outCheese));
        LOG.info("cheese == tapped = {}", (cheese == tappedCheese));
View Full Code Here

        return new ClassPathXmlApplicationContext("META-INF/spring/wireTap-stateNoLeaks-context.xml");
    }

    @Test
    public void testOutMessageUnaffectedByTappedRoute() throws InterruptedException {
        final Cheese cheese = new Cheese();
        cheese.setAge(1);

        // should receive same object that was sent
        out.expectedBodiesReceived(cheese);
        out.setExpectedMessageCount(1);
        // since copy was sent to wire tap, age should remain unchanged
        out.message(0).body().isEqualTo(cheese);
        out.message(0).expression(simple("${body.age} == 1"));

        tapped.setExpectedMessageCount(1);
        tapped.message(0).expression(simple("${body.age} == 2"));
        tapped.setResultWaitTime(1000);

        template.sendBody(cheese);

        assertMockEndpointsSatisfied();

        final Cheese outCheese = out.getReceivedExchanges().get(0).getIn().getBody(Cheese.class);
        final Cheese tappedCheese = tapped.getReceivedExchanges().get(0).getIn().getBody(Cheese.class);

        LOG.info("cheese = {}; out = {}; tapped = {}", cheese, outCheese, tappedCheese);

        LOG.info("cheese == out = {}", (cheese == outCheese));
        LOG.info("cheese == tapped = {}", (cheese == tappedCheese));
View Full Code Here

TOP

Related Classes of org.camelcookbook.routing.model.Cheese

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.