Package org.apache.camel.component.mock

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


    }

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

        try {
            template.sendBodyAndHeader("file://target/file?fileExist=Fail", "Bye World", Exchange.FILE_NAME, "hello.txt");
            fail("Should have thrown a GenericFileOperationFailedException");
        } catch (GenericFileOperationFailedException e) {
View Full Code Here


    }

    public void testRenameSuccess() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:report");
        mock.expectedBodiesReceived("Hello Paris");
        mock.expectedFileExists("./target/done/paris.txt", "Hello Paris");

        template.sendBodyAndHeader("file:target/reports", "Hello Paris", Exchange.FILE_NAME, "paris.txt");

        mock.assertIsSatisfied();
    }
View Full Code Here

        });
        context.start();

        MockEndpoint header = getMockEndpoint("mock:header");
        header.expectedBodiesReceived("HEADER:foo");
        header.expectedFileExists("./target/multicast/out/header.txt");

        MockEndpoint footer = getMockEndpoint("mock:footer");
        footer.expectedBodiesReceived("FOOTER:foo");
        footer.expectedFileExists("./target/multicast/out/footer.txt");
View Full Code Here

        header.expectedBodiesReceived("HEADER:foo");
        header.expectedFileExists("./target/multicast/out/header.txt");

        MockEndpoint footer = getMockEndpoint("mock:footer");
        footer.expectedBodiesReceived("FOOTER:foo");
        footer.expectedFileExists("./target/multicast/out/footer.txt");

        MockEndpoint end = getMockEndpoint("mock:end");
        end.expectedMessageCount(1);
        end.expectedFileExists("./target/multicast/.camel/foo.txt");
View Full Code Here

        footer.expectedBodiesReceived("FOOTER:foo");
        footer.expectedFileExists("./target/multicast/out/footer.txt");

        MockEndpoint end = getMockEndpoint("mock:end");
        end.expectedMessageCount(1);
        end.expectedFileExists("./target/multicast/.camel/foo.txt");

        template.sendBodyAndHeader("file://target/multicast", "foo", Exchange.FILE_NAME, "foo.txt");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        });
        context.start();

        MockEndpoint header = getMockEndpoint("mock:header");
        header.expectedBodiesReceived("HEADER:foo");
        header.expectedFileExists("./target/multicast/out/header.txt");

        MockEndpoint footer = getMockEndpoint("mock:footer");
        footer.expectedBodiesReceived("FOOTER:foo");
        footer.expectedFileExists("./target/multicast/out/footer.txt");
View Full Code Here

        header.expectedBodiesReceived("HEADER:foo");
        header.expectedFileExists("./target/multicast/out/header.txt");

        MockEndpoint footer = getMockEndpoint("mock:footer");
        footer.expectedBodiesReceived("FOOTER:foo");
        footer.expectedFileExists("./target/multicast/out/footer.txt");

        MockEndpoint end = getMockEndpoint("mock:end");
        end.expectedMessageCount(1);
        end.expectedFileExists("./target/multicast/.camel/foo.txt");
View Full Code Here

        footer.expectedBodiesReceived("FOOTER:foo");
        footer.expectedFileExists("./target/multicast/out/footer.txt");

        MockEndpoint end = getMockEndpoint("mock:end");
        end.expectedMessageCount(1);
        end.expectedFileExists("./target/multicast/.camel/foo.txt");

        template.sendBodyAndHeader("file://target/multicast", "foo", Exchange.FILE_NAME, "foo.txt");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    }

    public void testConsumeFromAbsolutePath() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:report");
        mock.expectedBodiesReceived("Hello Paris");
        mock.expectedFileExists(base + "/../done/paris.txt");

        template.sendBodyAndHeader("file:target/reports", "Hello Paris", Exchange.FILE_NAME, "paris.txt");
        mock.assertIsSatisfied();
    }
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();
    }
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.