Examples of allMessages()


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

        MockEndpoint mock = resolveMandatoryEndpoint("mock:marshal", MockEndpoint.class);
        mock.expectedMessageCount(1);

        XPathExpression xpath = new XPathExpression("count(//*[namespace-uri() = 'http://example.camel.org/apache' and local-name() = 'po']) = 1");
        xpath.setResultType(Boolean.class);
        mock.allMessages().body().matches(xpath);
       
        template.sendBody("direct:marshal", bean);       
        mock.assertIsSatisfied();
       
        //To make sure there is no XML declaration.
View Full Code Here

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

    public void testValidFilenameOnExchange() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(2);
        // should have file name header set
        mock.allMessages().header(Exchange.FILE_NAME).isNotNull();

        assertMockEndpointsSatisfied();

        // and expect name to contain target/filename-consumer-XXX.txt
        assertDirectoryEquals("target/filename-consumer-bye.txt", mock.getReceivedExchanges().get(0).getIn().getHeader(Exchange.FILE_NAME, String.class));
View Full Code Here

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

    @Test
    public void testValidFilenameOnExchange() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(2);
        // should have file name header set
        mock.allMessages().header(Exchange.FILE_NAME).isNotNull();

        assertMockEndpointsSatisfied();

        // give time for ftp consumer to disconnect
        Thread.sleep(2000);
View Full Code Here

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

public class AggregateCompletedByBatchConsumerSendEmptyMessageWhenIdleTest extends ContextTestSupport {

    public void testBatchConsumerSendEmptyMessageWhenIdle() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);
        mock.allMessages().body().isNull();
        mock.allMessages().header(Exchange.AGGREGATED_COMPLETED_BY).isEqualTo("consumer");
        mock.allMessages().header(Exchange.AGGREGATED_SIZE).isEqualTo(1);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

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

    public void testBatchConsumerSendEmptyMessageWhenIdle() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);
        mock.allMessages().body().isNull();
        mock.allMessages().header(Exchange.AGGREGATED_COMPLETED_BY).isEqualTo("consumer");
        mock.allMessages().header(Exchange.AGGREGATED_SIZE).isEqualTo(1);

        assertMockEndpointsSatisfied();
    }
View Full Code Here

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

    public void testBatchConsumerSendEmptyMessageWhenIdle() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMinimumMessageCount(1);
        mock.allMessages().body().isNull();
        mock.allMessages().header(Exchange.AGGREGATED_COMPLETED_BY).isEqualTo("consumer");
        mock.allMessages().header(Exchange.AGGREGATED_SIZE).isEqualTo(1);

        assertMockEndpointsSatisfied();
    }

    @Override
View Full Code Here

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

    }

    public void testSedaConcurrentInOut() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(20);
        mock.allMessages().body().startsWith("Bye");

        // should at least take 3 sec
        mock.setMinimumResultWaitTime(3000);

        ExecutorService executors = Executors.newFixedThreadPool(10);
View Full Code Here

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

    }

    public void testSedaConcurrentInOutWithAsync() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(20);
        mock.allMessages().body().startsWith("Bye");

        // should at least take 3 sec
        mock.setMinimumResultWaitTime(3000);

        // use our own template that has a higher thread pool than default camel that uses 5
View Full Code Here

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

    }

    public void testSplitParallelNoStopOnExceptionStop() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:split");
        // 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");

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

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

        assertMockEndpointsSatisfied();
    }

    public void testSplitParallelStopOnExceptionStop() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:split");
        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
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.