Examples of expectedFileExists()


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

        MockEndpoint mock = getMockEndpoint("mock:chmod" + routeSuffix);
        mock.expectedMessageCount(1);
        String testFileName = "chmod" + routeSuffix + ".txt";
        String fullTestFileName = TEST_DIRECTORY + testFileName;
        String testFileContent = "Writing file with chmod " + routeSuffix + " option at " + new Date();
        mock.expectedFileExists(fullTestFileName, testFileContent);

        template.sendBodyAndHeader("direct:write" + routeSuffix, testFileContent, Exchange.FILE_NAME, testFileName);

        File f = new File(fullTestFileName);
        Set<PosixFilePermission> permissions = Files.getPosixFilePermissions(f.toPath(), LinkOption.NOFOLLOW_LINKS);
View Full Code Here

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

        MockEndpoint mock = getMockEndpoint("mock:noChmod");
        mock.expectedMessageCount(1);
        String testFileName = "noChmod.txt";
        String fullTestFileName = TEST_DIRECTORY + testFileName;
        String testFileContent = "Writing file with no chmod option at " + new Date();
        mock.expectedFileExists(fullTestFileName, testFileContent);
        template.sendBodyAndHeader("direct:writeNoChmod", testFileContent, Exchange.FILE_NAME, testFileName);
        assertMockEndpointsSatisfied();
    }

View Full Code Here

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

    }

    public void testReadLockFailed() throws Exception {
        MockEndpoint mock = getMockEndpoint("mock:result");
        mock.expectedMessageCount(1);
        mock.expectedFileExists("target/readlock/out/file1.dat");

        writeFiles();
      

        assertMockEndpointsSatisfied();
View Full Code Here

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

        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

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.xml");

        String body = "<?xml version=\"1.0\"?><persons xmlns=\"http://foo.com/bar\"><person name=\"James\"/><person name=\"Claus\"/></persons>";

        template.sendBodyAndHeader("file://target/renameissue", body, Exchange.FILE_NAME, "hello.xml");
View Full Code Here

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

    public void testTransactionRollback() throws Exception {
        MockEndpoint error = getMockEndpoint("mock:error");
        error.expectedMessageCount(1);
        error.message(0).header(Exchange.EXCEPTION_CAUGHT).isNotNull();
        error.message(0).header(Exchange.EXCEPTION_CAUGHT).isInstanceOf(IllegalArgumentException.class);
        error.expectedFileExists("target/transacted/failed/fail.txt");

        template.sendBodyAndHeader("file://target/transacted/fail", "Hello World", Exchange.FILE_NAME, "fail.txt");

        // wait for route to complete
        Thread.sleep(3000);
View Full Code Here

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

    public void testXsltOutput() 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");

        assertMockEndpointsSatisfied();
View Full Code Here

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

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

        mock.assertIsSatisfied();
    }
View Full Code Here

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

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

        mock.assertIsSatisfied();
    }
   
View Full Code Here

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

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

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