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/bye.txt");
        mock.expectedFileExists(FTP_ROOT_DIR + ".done/goodday.txt");

        mock.assertIsSatisfied();
View Full Code Here


        template.sendBodyAndHeader(fileUrl, "Goodday World", Exchange.FILE_NAME, "sub/sub2/goodday.txt");
    }

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

        mock.expectedFileExists("target/multidir/.done/bye.txt.old");
        mock.expectedFileExists("target/multidir/.done/sub/hello.txt.old");
        mock.expectedFileExists("target/multidir/.done/sub/sub2/goodday.txt.old");
View Full Code Here

    }

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

        mock.assertIsSatisfied();
View Full Code Here

public class HttpAsyncCallbackTest extends CamelTestSupport {

    @Test
    public void testAsyncAndSyncAtSameTimeWithHttp() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("Hello Claus", "Hello Hadrian", "Hello Willem");

        // START SNIPPET: e3
        MyCallback callback = new MyCallback();

        // Send 3 async request/reply message to the http endpoint
View Full Code Here

        String customerBody = "<customer name=\"James\"/>";

        MockEndpoint result = getMockEndpoint("mock:result");
       
        result.expectedMessageCount(4);
        result.expectedBodiesReceivedInAnyOrder("<person name=\"Jon\"/>",
                                                "<person name=\"Hadrian\"/>",
                                                "<person name=\"Claus\"/>",
                                                "<person name=\"James\"/>");

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

        super.setUp();
    }

    public void testDepth() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("a2", "b2");

        template.sendBodyAndHeader("file:target/depth", "a", Exchange.FILE_NAME, "a.txt");
        template.sendBodyAndHeader("file:target/depth", "b", Exchange.FILE_NAME, "b.txt");
        template.sendBodyAndHeader("file:target/depth/foo", "a2", Exchange.FILE_NAME, "a2.txt");
        template.sendBodyAndHeader("file:target/depth/foo/bar", "a3", Exchange.FILE_NAME, "a.txt");
View Full Code Here

    }

    public void testDepthMin2Max99() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");

        mock.expectedBodiesReceivedInAnyOrder("a2", "b2", "a3", "b3");

        template.sendBodyAndHeader("file:target/depth2", "a", Exchange.FILE_NAME, "a.txt");
        template.sendBodyAndHeader("file:target/depth2", "b", Exchange.FILE_NAME, "b.txt");
        template.sendBodyAndHeader("file:target/depth2/bar", "b2", Exchange.FILE_NAME, "b2.txt");
        template.sendBodyAndHeader("file:target/depth2/foo", "a2", Exchange.FILE_NAME, "a2.txt");
View Full Code Here

    }

    public void testMin1Max1() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");

        mock.expectedBodiesReceivedInAnyOrder("a", "b");

        template.sendBodyAndHeader("file:target/depth3", "a", Exchange.FILE_NAME, "a.txt");
        template.sendBodyAndHeader("file:target/depth3", "b", Exchange.FILE_NAME, "b.txt");
        template.sendBodyAndHeader("file:target/depth3/foo", "a2", Exchange.FILE_NAME, "a.txt");
        template.sendBodyAndHeader("file:target/depth3/foo/bar", "a3", Exchange.FILE_NAME, "a.txt");
View Full Code Here

*/
public class DirectQueueTest extends ContextTestSupport {

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

        template.sendBody("direct:foo", "Hello World");
        template.sendBody("direct:foo", "Bye World");
        template.sendBody("direct:bar", "Bar");
    }
View Full Code Here

    }

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

        mock.assertIsSatisfied();
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.