Package org.apache.camel.component.mock

Examples of org.apache.camel.component.mock.MockEndpoint.allMessages()


    @Test
    public void testRetryRouteSpecific() throws Exception {
        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_DELAY).isNull();

        template.sendBody("direct:routeSpecific", "Foo");
View Full Code Here


    @Test
    public void testRetryRouteSpecific() throws Exception {
        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_DELAY).isNull();

        template.sendBody("direct:routeSpecific", "Foo");
View Full Code Here

    public void testRetryRouteSpecific() throws Exception {
        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_DELAY).isNull();

        template.sendBody("direct:routeSpecific", "Foo");

        assertMockEndpointsSatisfied();
View Full Code Here

        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_DELAY).isNull();

        template.sendBody("direct:routeSpecific", "Foo");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    @Test
    public void testRetryRouteSpecificDelay() throws Exception {
        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().property("SporadicDelay").isGreaterThanOrEqualTo(500);

        template.sendBody("direct:routeSpecificDelay", "Foo");
View Full Code Here

    @Test
    public void testRetryRouteSpecificDelay() throws Exception {
        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().property("SporadicDelay").isGreaterThanOrEqualTo(500);

        template.sendBody("direct:routeSpecificDelay", "Foo");
View Full Code Here

    public void testRetryRouteSpecificDelay() throws Exception {
        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().property("SporadicDelay").isGreaterThanOrEqualTo(500);

        template.sendBody("direct:routeSpecificDelay", "Foo");

        log.info("delay = {}", mockEndpoint.getReceivedExchanges().get(0).getProperty("SporadicDelay", long.class));
View Full Code Here

        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().property("SporadicDelay").isGreaterThanOrEqualTo(500);

        template.sendBody("direct:routeSpecificDelay", "Foo");

        log.info("delay = {}", mockEndpoint.getReceivedExchanges().get(0).getProperty("SporadicDelay", long.class));
View Full Code Here

    @Test
    public void testRetry() throws Exception {
        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);

        template.sendBody("direct:start", "Foo");

        assertMockEndpointsSatisfied();
View Full Code Here

    @Test
    public void testRetry() throws Exception {
        final MockEndpoint mockEndpoint = getMockEndpoint("mock:result");
        mockEndpoint.expectedMessageCount(1);
        mockEndpoint.allMessages().header(Exchange.REDELIVERED).isEqualTo(true);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_COUNTER).isEqualTo(1);

        template.sendBody("direct:start", "Foo");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.