Package org.apache.camel.component.mock

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


    public void testMoveToSubDir() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(3);
        mock.expectedFileExists("./target/move/.done/bye.txt");
        mock.expectedFileExists("./target/move/sub/.done/hello.txt");
        mock.expectedFileExists("./target/move/sub/sub2/.done/goodday.txt");

        assertMockEndpointsSatisfied();
    }
View Full Code Here


    public void testMoveToSubDir() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(3);
        mock.expectedFileExists("./target/move/.done/bye.txt");
        mock.expectedFileExists("./target/move/sub/.done/hello.txt");
        mock.expectedFileExists("./target/move/sub/sub2/.done/goodday.txt");

        assertMockEndpointsSatisfied();
    }

    @Override
View Full Code Here

    public void testMultiDir() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("Bye World", "Hello World", "Godday 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/godday.txt.old");

        assertMockEndpointsSatisfied();
View Full Code Here

    public void testMultiDir() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("Bye World", "Hello World", "Godday 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/godday.txt.old");

        assertMockEndpointsSatisfied();

    }
View Full Code Here

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceivedInAnyOrder("Bye World", "Hello World", "Godday 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/godday.txt.old");

        assertMockEndpointsSatisfied();

    }
View Full Code Here

    public void testPollFileAndShouldNotBeMoved() throws Exception {
        template.sendBodyAndHeader("file://target/movefile", "Hello World", Exchange.FILE_NAME, "hello.txt");

        MockEndpoint mock = getMockEndpoint("mock:foo");
        mock.expectedBodiesReceived("Hello World");
        mock.expectedFileExists("target/movefile/error/hello.txt", "Hello World");

        mock.assertIsSatisfied();
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
View Full Code Here

    public void testXsltOutputFile() throws Exception {
        createDirectory("target/xslt");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("<?xml version=\"1.0\" encoding=\"UTF-8\"?><goodbye>world!</goodbye>");
        mock.expectedFileExists("target/xslt/xsltme.xml");
        mock.message(0).body().isInstanceOf(File.class);

        template.sendBodyAndHeader("direct:start", "<hello>world!</hello>", Exchange.XSLT_FILE_NAME, "target/xslt/xsltme.xml");

        mock.assertIsSatisfied();
View Full Code Here

    public void testSplitPropertiesFileAndRoute() throws Exception {
        MockEndpoint foo = getMockEndpoint("mock:foo");
        foo.expectedBodiesReceived("[foo=1, foo=4]");

        // after the file is routed it should be moved to done
        foo.expectedFileExists("target/file/splitprop/done/myprop.txt", body);

        MockEndpoint bar = getMockEndpoint("mock:bar");
        bar.expectedBodiesReceived("[bar=2, bar=3]");

        template.sendBodyAndHeader("file://target/file/splitprop", body, Exchange.FILE_NAME, "myprop.txt");
View Full Code Here

    @Test
    public void testPollFileAndShouldBeMoved() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedBodiesReceived("Hello World this file will be moved");
        mock.expectedFileExists(FTP_ROOT_DIR + "movefile/done/sub2/hello.txt.old");

        mock.assertIsSatisfied();
    }
   
    private void prepareFtpServer() throws Exception {
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.