Package org.apache.camel.component.file

Examples of org.apache.camel.component.file.FileEndpoint


        // get the file handle
        file = new File("target/filelanguage/test/hello.txt");
        GenericFile<File> gf = FileConsumer.asGenericFile("target/filelanguage", file, null);

        FileEndpoint endpoint = getMandatoryEndpoint(uri, FileEndpoint.class);

        Exchange answer = endpoint.createExchange(gf);
        endpoint.configureMessage(gf, answer.getIn());

        Calendar cal = GregorianCalendar.getInstance();
        cal.set(1974, Calendar.APRIL, 20);
        answer.getIn().setHeader("birthday", cal.getTime());
View Full Code Here


        // get the file handle
        file = new File("target/filelanguage/test/hello.txt");
        GenericFile<File> gf = FileConsumer.asGenericFile("target/filelanguage", file);

        FileEndpoint endpoint = getMandatoryEndpoint(uri, FileEndpoint.class);

        Exchange answer = endpoint.createExchange(gf);
        endpoint.configureMessage(gf, answer.getIn());

        Calendar cal = GregorianCalendar.getInstance();
        cal.set(1974, Calendar.APRIL, 20);
        answer.getIn().setHeader("birthday", cal.getTime());
View Full Code Here

        // get the file handle
        file = new File("target/filelanguage/test/hello.txt");
        GenericFile<File> gf = FileConsumer.asGenericFile("target/filelanguage", file);

        FileEndpoint endpoint = getMandatoryEndpoint(uri, FileEndpoint.class);

        Exchange answer = endpoint.createExchange(gf);
        endpoint.configureMessage(gf, answer.getIn());

        Calendar cal = GregorianCalendar.getInstance();
        cal.set(1974, Calendar.APRIL, 20);
        answer.getIn().setHeader("birthday", cal.getTime());
View Full Code Here

    @EndpointInject(uri = "mock:result")
    protected MockEndpoint result;

    public void testMocksAreValid() throws Exception {
        // lets check that our injected endpoint is valid
        FileEndpoint fileEndpoint = TestSupport.assertIsInstanceOf(FileEndpoint.class, inputFile);
        assertEquals("File", new File("target/test-default-inbox"), fileEndpoint.getFile());

        result.expectedBodiesReceived(expectedBody);
        result.setResultWaitTime(5000);

        template.sendBodyAndHeader(inputFile, expectedBody, Exchange.FILE_NAME, "hello.txt");
View Full Code Here

        // get the file handle
        file = new File("target/filelanguage/test/hello.txt");
        GenericFile<File> gf = FileConsumer.asGenericFile("target/filelanguage", file, null);

        FileEndpoint endpoint = getMandatoryEndpoint(uri, FileEndpoint.class);

        Exchange answer = endpoint.createExchange(gf);
        endpoint.configureMessage(gf, answer.getIn());

        Calendar cal = GregorianCalendar.getInstance();
        cal.set(1974, Calendar.APRIL, 20);
        answer.getIn().setHeader("birthday", cal.getTime());
View Full Code Here

    protected MockEndpoint result;

    @Test
    public void testMocksAreValid() throws Exception {
        // lets check that our injected endpoint is valid
        FileEndpoint fileEndpoint = assertIsInstanceOf(FileEndpoint.class, inputFile);
        assertEquals("File", new File("target/test-default-inbox"), fileEndpoint.getFile());

        result.expectedBodiesReceived(expectedBody);
        result.setResultWaitTime(5000);

        template.sendBodyAndHeader(inputFile, expectedBody, Exchange.FILE_NAME, "hello.txt");
View Full Code Here

        // get the file handle
        file = new File("target/filelanguage/test/hello.txt");
        GenericFile<File> gf = FileConsumer.asGenericFile("target/filelanguage", file);

        FileEndpoint endpoint = getMandatoryEndpoint(uri, FileEndpoint.class);

        Exchange answer = endpoint.createExchange(gf);
        endpoint.configureMessage(gf, answer.getIn());

        Calendar cal = GregorianCalendar.getInstance();
        cal.set(1974, Calendar.APRIL, 20);
        answer.getIn().setHeader("birthday", cal.getTime());
View Full Code Here

    @EndpointInject(uri = "mock:result")
    protected MockEndpoint result;

    public void testMocksAreValid() throws Exception {
        // lets check that our injected endpoint is valid
        FileEndpoint fileEndpoint = TestSupport.assertIsInstanceOf(FileEndpoint.class, inputFile);
        assertEquals("File", new File("target/test-default-inbox"), fileEndpoint.getFile());

        result.expectedBodiesReceived(expectedBody);
        result.setResultWaitTime(5000);

        template.sendBodyAndHeader(inputFile, expectedBody, Exchange.FILE_NAME, "hello.txt");
View Full Code Here

        // get the file handle
        file = new File("target/filelanguage/test/hello.txt");
        GenericFile<File> gf = FileConsumer.asGenericFile("target/filelanguage", file);

        FileEndpoint endpoint = getMandatoryEndpoint(uri, FileEndpoint.class);

        Exchange answer = endpoint.createExchange(gf);
        endpoint.configureMessage(gf, answer.getIn());

        Calendar cal = GregorianCalendar.getInstance();
        cal.set(1974, Calendar.APRIL, 20);
        answer.getIn().setHeader("birthday", cal.getTime());
View Full Code Here

        // get the file handle
        file = new File("target/filelanguage/test/hello.txt");
        GenericFile<File> gf = FileConsumer.asGenericFile("target/filelanguage", file, null);

        FileEndpoint endpoint = getMandatoryEndpoint(uri, FileEndpoint.class);

        Exchange answer = endpoint.createExchange(gf);
        endpoint.configureMessage(gf, answer.getIn());

        Calendar cal = Calendar.getInstance();
        cal.set(1974, Calendar.APRIL, 20);
        answer.getIn().setHeader("birthday", cal.getTime());
View Full Code Here

TOP

Related Classes of org.apache.camel.component.file.FileEndpoint

Copyright © 2018 www.massapicom. 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.