Package org.apache.camel.component.mock

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


    }

    @Test
    public void testPollFileAndShouldBeMoved() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("Hello", "Bye", "Goodday");
        mock.expectedFileExists(FTP_ROOT_DIR + "/.done/hello.txt");
        mock.expectedFileExists(FTP_ROOT_DIR + "/.done/sub/bye.txt");
        mock.expectedFileExists(FTP_ROOT_DIR + "/.done/sub/sub2/goodday.txt");

        mock.assertIsSatisfied();
View Full Code Here


        return jndi;
    }

    public void testInclude() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result1");
        mock.expectedBodiesReceivedInAnyOrder("Hello World");

        template.sendBodyAndHeader("file://target/files/ant-path-1/x/y/z", "Hello World", Exchange.FILE_NAME, "report.txt");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        assertMockEndpointsSatisfied();
    }

    public void testExclude() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result2");
        mock.expectedBodiesReceivedInAnyOrder("Hello World 2");

        template.sendBodyAndHeader("file://target/files/ant-path-2/x/y/z", "Hello World 1", Exchange.FILE_NAME, "report.bak");
        template.sendBodyAndHeader("file://target/files/ant-path-2/x/y/z", "Hello World 2", Exchange.FILE_NAME, "report.txt");

        assertMockEndpointsSatisfied();
View Full Code Here

        assertMockEndpointsSatisfied();
    }

    public void testIncludesAndExcludes() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result3");
        mock.expectedBodiesReceivedInAnyOrder("Hello World 2", "Hello World 4");

        template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z", "Hello World 1", Exchange.FILE_NAME, "a.pdf");
        template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z", "Hello World 2", Exchange.FILE_NAME, "m.pdf");
        template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z", "Hello World 3", Exchange.FILE_NAME, "b.txt");
        template.sendBodyAndHeader("file://target/files/ant-path-3/x/y/z", "Hello World 4", Exchange.FILE_NAME, "m.txt");
View Full Code Here

        assertMockEndpointsSatisfied();
    }

    public void testIncludesAndExcludesAndFilter() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result4");
        mock.expectedBodiesReceivedInAnyOrder("Hello World 3");

        template.sendBodyAndHeader("file://target/files/ant-path-4/x/y/z", "Hello World 1", Exchange.FILE_NAME, "a.txt");
        template.sendBodyAndHeader("file://target/files/ant-path-4/x/y/z", "Hello World 2", Exchange.FILE_NAME, "b.txt");
        template.sendBodyAndHeader("file://target/files/ant-path-4/x/y/z", "Hello World 3", Exchange.FILE_NAME, "c.txt");
View Full Code Here

*/
public class VmQueueTest extends AbstractVmTestSupport {

    public void testQueue() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World", "Goodday World", "Bar");

        template2.sendBody("vm:foo", "Hello World");
        template2.sendBody("vm:foo?size=20", "Bye World");
        template2.sendBody("vm:foo?concurrentConsumers=5", "Goodday World");
        template.sendBody("vm:bar", "Bar");
View Full Code Here

*/
public class SedaQueueTest extends ContextTestSupport {

    public void testQueue() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World", "Goodday World", "Bar");

        template.sendBody("seda:foo", "Hello World");
        template.sendBody("seda:foo?size=20", "Bye World");
        template.sendBody("seda:foo?concurrentConsumers=5", "Goodday World");
        template.sendBody("seda:bar", "Bar");
View Full Code Here

        // START SNIPPET: e2
        MockEndpoint result = getMockEndpoint("mock:result");

        // we expect 4 messages grouped by the latest message only
        result.expectedMessageCount(4);
        result.expectedBodiesReceivedInAnyOrder("Message 1d", "Message 2b", "Message 3c", "Message 4");

        // 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

        };
    }

    public void testConsumeBatch() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("Hello World", "Bye World");

        // test header keys
        mock.message(0).property(Exchange.BATCH_SIZE).isEqualTo(2);
        mock.message(0).property(Exchange.BATCH_INDEX).isEqualTo(0);
        mock.message(1).property(Exchange.BATCH_INDEX).isEqualTo(1);
View Full Code Here

        deleteDirectory("./target/includeexclude");
        prepareFiles();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(2);
        mock.expectedBodiesReceivedInAnyOrder("Report 2", "Report 3");
        mock.assertIsSatisfied();
    }

    private void prepareFiles() throws Exception {
        String url = "file://target/includeexclude";
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.