Package org.apache.camel.component.mock

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


    }

    public void testFileRenameFileOnCommitIssue() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedFileExists("./target/renameissue/.camel/hello.txt");

        template.sendBodyAndHeader("file://target/renameissue", "World", Exchange.FILE_NAME, "hello.txt");

        assertMockEndpointsSatisfied();
    }
View Full Code Here


    public void testMoveFailed() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");

        mock.expectedFileExists("target/failed/.camel/hello.txt", "Hello World");
        mock.expectedFileExists("target/failed/error/bye-error.txt", "Kabom");

        template.sendBodyAndHeader("file://target/failed", "Hello World", Exchange.FILE_NAME, "hello.txt");
        template.sendBodyAndHeader("file://target/failed", "Kabom", Exchange.FILE_NAME, "bye.txt");
View Full Code Here

    public void testMoveFailed() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");

        mock.expectedFileExists("target/failed/.camel/hello.txt", "Hello World");
        mock.expectedFileExists("target/failed/error/bye-error.txt", "Kabom");

        template.sendBodyAndHeader("file://target/failed", "Hello World", Exchange.FILE_NAME, "hello.txt");
        template.sendBodyAndHeader("file://target/failed", "Kabom", Exchange.FILE_NAME, "bye.txt");

        assertMockEndpointsSatisfied();
View Full Code Here

    }

    public void testMoveToSubDir() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(3);
        mock.expectedFileExists(base + "/.done/bye.txt");
        mock.expectedFileExists(base + "/sub/.done/hello.txt");
        mock.expectedFileExists(base + "/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(base + "/.done/bye.txt");
        mock.expectedFileExists(base + "/sub/.done/hello.txt");
        mock.expectedFileExists(base + "/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(base + "/.done/bye.txt");
        mock.expectedFileExists(base + "/sub/.done/hello.txt");
        mock.expectedFileExists(base + "/sub/sub2/.done/goodday.txt");

        assertMockEndpointsSatisfied();
    }

    @Override
View Full Code Here

        deleteDirectory("target/changed/");
        createDirectory("target/changed/in");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedFileExists("target/changed/out/slowfile.dat");

        writeSlowFile();

        assertMockEndpointsSatisfied();
View Full Code Here

        deleteDirectory("target/marker/");
        createDirectory("target/marker/in");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(2);
        mock.expectedFileExists("target/marker/out/file1.dat");
        mock.expectedFileExists("target/marker/out/file2.dat");

        writeFiles();

        assertMockEndpointsSatisfied();
View Full Code Here

        createDirectory("target/marker/in");

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(2);
        mock.expectedFileExists("target/marker/out/file1.dat");
        mock.expectedFileExists("target/marker/out/file2.dat");

        writeFiles();

        assertMockEndpointsSatisfied();
View Full Code Here

    }

    public void testAppend() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World\nBye World");
        mock.expectedFileExists("target/file/hello.txt", "Hello World\nBye World");

        template.sendBodyAndHeader("file://target/file?fileExist=Append", "Bye World", Exchange.FILE_NAME, "hello.txt");

        assertMockEndpointsSatisfied();
    }
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.