Package org.apache.camel.component.mock

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


            return;
        }

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.allMessages().body().isInstanceOf(String.class);

        template.sendBody("direct:start", "Hello Nagios");

        assertMockEndpointsSatisfied();
View Full Code Here


            return;
        }

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(2);
        mock.allMessages().body().isInstanceOf(String.class);

        template.sendBody("direct:start", "Hello Nagios");
        template.sendBody("direct:start", "Bye Nagios");

        assertMockEndpointsSatisfied();
View Full Code Here

    public void testSplitParallelNoStopOnExceptionStop() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:split");
        mock.expectedMinimumMessageCount(0);
        // we do NOT stop so we receive all messages except the one that goes kaboom
        mock.allMessages().body().isNotEqualTo("Kaboom");
        mock.expectedBodiesReceivedInAnyOrder("Hello World", "Goodday World", "Bye World", "Hi World");

        try {
            template.sendBody("direct:start", "Hello World,Goodday World,Kaboom,Bye World,Hi World");
            fail("Should thrown an exception");
View Full Code Here

    }

    public void testSplitParallelStopOnExceptionStop() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:split");
        mock.expectedMinimumMessageCount(0);
        mock.allMessages().body().isNotEqualTo("Kaboom");

        try {
            template.sendBody("direct:start", "Hello World,Goodday World,Kaboom,Bye World");
            fail("Should thrown an exception");
        } catch (CamelExecutionException e) {
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);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_DELAY).isNull();

        template.sendBody("direct:start", "Foo");
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);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_DELAY).isNull();

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

    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);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_MAX_COUNTER).isEqualTo(2);
        mockEndpoint.allMessages().header(Exchange.REDELIVERY_DELAY).isNull();

        template.sendBody("direct:start", "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:start", "Foo");

        assertMockEndpointsSatisfied();
    }
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

    @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

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.