Package org.apache.camel.component.mock

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


        // We expect the exchange here after 1 delivery and 2 re-deliveries
        MockEndpoint mock = getMockEndpoint("mock:error");
        mock.expectedMessageCount(1);
        mock.message(0).header("org.apache.camel.Redelivered").isEqualTo(Boolean.TRUE);
        mock.message(0).header("org.apache.camel.RedeliveryCounter").isEqualTo(2);

        try {
            template.sendBody("direct:start", "Hello World");
        } catch (RuntimeCamelException e) {
            // expected
View Full Code Here


        counter = 0;

        // We expect the exchange here after 1 delivery
        MockEndpoint mock = getMockEndpoint("mock:no");
        mock.expectedMessageCount(1);
        mock.message(0).header("org.apache.camel.Redelivered").isEqualTo(Boolean.FALSE);
        mock.message(0).header("org.apache.camel.RedeliveryCounter").isEqualTo(0);

        try {
            template.sendBody("direct:no", "Hello World");
        } catch (RuntimeCamelException e) {
View Full Code Here

        // We expect the exchange here after 1 delivery
        MockEndpoint mock = getMockEndpoint("mock:no");
        mock.expectedMessageCount(1);
        mock.message(0).header("org.apache.camel.Redelivered").isEqualTo(Boolean.FALSE);
        mock.message(0).header("org.apache.camel.RedeliveryCounter").isEqualTo(0);

        try {
            template.sendBody("direct:no", "Hello World");
        } catch (RuntimeCamelException e) {
            // expected
View Full Code Here

        counter = 0;

        // We expect the exchange here after 1 delivery and 1 re delivery
        MockEndpoint mock = getMockEndpoint("mock:one");
        mock.expectedMessageCount(1);
        mock.message(0).header("org.apache.camel.Redelivered").isEqualTo(Boolean.TRUE);
        mock.message(0).header("org.apache.camel.RedeliveryCounter").isEqualTo(1);

        try {
            template.sendBody("direct:one", "Hello World");
        } catch (RuntimeCamelException e) {
View Full Code Here

        // We expect the exchange here after 1 delivery and 1 re delivery
        MockEndpoint mock = getMockEndpoint("mock:one");
        mock.expectedMessageCount(1);
        mock.message(0).header("org.apache.camel.Redelivered").isEqualTo(Boolean.TRUE);
        mock.message(0).header("org.apache.camel.RedeliveryCounter").isEqualTo(1);

        try {
            template.sendBody("direct:one", "Hello World");
        } catch (RuntimeCamelException e) {
            // expected
View Full Code Here

        MockEndpoint result = getMockEndpoint("mock:result");

        // we expect 4 messages grouped by the latest message only
        result.expectedMessageCount(4);
        result.expectedBodiesReceived("Message 1d", "Message 2b", "Message 3c", "Message 4");
        result.message(0).property(Exchange.AGGREGATED_COUNT).isEqualTo(4);
        result.message(1).property(Exchange.AGGREGATED_COUNT).isEqualTo(2);
        result.message(2).property(Exchange.AGGREGATED_COUNT).isEqualTo(3);
        result.message(3).property(Exchange.AGGREGATED_COUNT).isEqualTo(1);

        // then we sent all the message at once
View Full Code Here

        // we expect 4 messages grouped by the latest message only
        result.expectedMessageCount(4);
        result.expectedBodiesReceived("Message 1d", "Message 2b", "Message 3c", "Message 4");
        result.message(0).property(Exchange.AGGREGATED_COUNT).isEqualTo(4);
        result.message(1).property(Exchange.AGGREGATED_COUNT).isEqualTo(2);
        result.message(2).property(Exchange.AGGREGATED_COUNT).isEqualTo(3);
        result.message(3).property(Exchange.AGGREGATED_COUNT).isEqualTo(1);

        // then we sent all the message at once
        template.sendBodyAndHeader("direct:start", "Message 1a", "id", "1");
View Full Code Here


    public void testAggregatorNotAtStart() throws Exception {
        MockEndpoint resultEndpoint = resolveMandatoryEndpoint("mock:result", MockEndpoint.class);
        resultEndpoint.expectedMessageCount(1);
        resultEndpoint.message(0).header("visited").isNotNull();
        resultEndpoint.setSleepForEmptyTest(2 * BatchProcessor.DEFAULT_BATCH_TIMEOUT);
        template.sendBodyAndHeader("seda:header", "message:1", "cheese", 123);
        resultEndpoint.assertIsSatisfied();
    }

View Full Code Here

        // we expect 4 messages grouped by the latest message only
        result.expectedMessageCount(4);
        result.expectedBodiesReceived("Message 1d", "Message 2b", "Message 3c", "Message 4");
        result.message(0).property(Exchange.AGGREGATED_COUNT).isEqualTo(4);
        result.message(1).property(Exchange.AGGREGATED_COUNT).isEqualTo(2);
        result.message(2).property(Exchange.AGGREGATED_COUNT).isEqualTo(3);
        result.message(3).property(Exchange.AGGREGATED_COUNT).isEqualTo(1);

        // then we sent all the message at once
        template.sendBodyAndHeader("direct:start", "Message 1a", "id", "1");
        template.sendBodyAndHeader("direct:start", "Message 2a", "id", "2");
View Full Code Here

        result.expectedMessageCount(4);
        result.expectedBodiesReceived("Message 1d", "Message 2b", "Message 3c", "Message 4");
        result.message(0).property(Exchange.AGGREGATED_COUNT).isEqualTo(4);
        result.message(1).property(Exchange.AGGREGATED_COUNT).isEqualTo(2);
        result.message(2).property(Exchange.AGGREGATED_COUNT).isEqualTo(3);
        result.message(3).property(Exchange.AGGREGATED_COUNT).isEqualTo(1);

        // then we sent all the message at once
        template.sendBodyAndHeader("direct:start", "Message 1a", "id", "1");
        template.sendBodyAndHeader("direct:start", "Message 2a", "id", "2");
        template.sendBodyAndHeader("direct:start", "Message 3a", "id", "3");
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.