Package org.apache.camel.component.mock

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


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

        mock.expectedFileExists("target/failed/moved/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 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 testFileToFileNioLowBuffer() throws Exception {
        String body = "1234567890123456789012345678901234567890";
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedFileExists("target/nio/out/hello.txt", body);

        template.sendBodyAndHeader("file://target/nio/in", body, Exchange.FILE_NAME, "hello.txt");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    }

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

        assertMockEndpointsSatisfied();
    }

    @Override
View Full Code Here

        String expectBody = "Hello World\nBye World";
        if (ON_WINDOWS) {
            expectBody = "Hello World\r\nBye World";
        }
        mock.expectedBodiesReceived(expectBody);
        mock.expectedFileExists(FTP_ROOT_DIR + "exist/hello.txt", expectBody);      
        template.sendBodyAndHeader(getFtpUrl(), "Bye World", Exchange.FILE_NAME, "hello.txt");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

    @Test
    public void testOverride() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Bye World");
        mock.expectedFileExists(FTP_ROOT_DIR + "exist/hello.txt", "Bye World");

        template.sendBodyAndHeader(getFtpUrl(), "Bye World", Exchange.FILE_NAME, "hello.txt");

        assertMockEndpointsSatisfied();
    }
View Full Code Here

        });
        context.start();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedFileExists("./target/keep/out/hello.txt");
        mock.message(0).header(Exchange.FILE_LAST_MODIFIED).isNotNull();

        assertMockEndpointsSatisfied();

        long t1 = mock.getReceivedExchanges().get(0).getIn().getHeader(Exchange.FILE_LAST_MODIFIED, Date.class).getTime();
View Full Code Here

        });
        context.start();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedFileExists("./target/keep/out/hello.txt");
        mock.message(0).header(Exchange.FILE_LAST_MODIFIED).isNotNull();

        assertMockEndpointsSatisfied();

        long t1 = mock.getReceivedExchanges().get(0).getIn().getHeader(Exchange.FILE_LAST_MODIFIED, Date.class).getTime();
View Full Code Here

        });
        context.start();

        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedFileExists("./target/keep/out/hello.txt");
        mock.message(0).header(Exchange.FILE_LAST_MODIFIED).isNotNull();

        assertMockEndpointsSatisfied();

        long t1 = mock.getReceivedExchanges().get(0).getIn().getHeader(Exchange.FILE_LAST_MODIFIED, Date.class).getTime();
View Full Code Here

    @Test
    public void testIgnore() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedBodiesReceived("Hello World");
        mock.expectedFileExists(FTP_ROOT_DIR + "exist/hello.txt", "Hello World");

        template.sendBodyAndHeader(getFtpUrl(), "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.