Package org.apache.camel

Examples of org.apache.camel.Producer.process()


        Exchange exchange = createExchangeWithInBody(
                "SELECT * FROM cmis:document WHERE CONTAINS('Camel test content.')");
        exchange.getIn().getHeaders().put("CamelCMISReadSize", 1);

        producer.process(exchange);

        @SuppressWarnings("unchecked")
        List<Map<String, Object>> documents = exchange.getOut().getBody(List.class);
        assertEquals(1, documents.size());
    }
View Full Code Here


        Exchange exchange = createExchangeWithInBody(
                "SELECT * FROM cmis:document WHERE cmis:name='test1.txt'");
        exchange.getIn().getHeaders().put("CamelCMISRetrieveContent", true);

        producer.process(exchange);

        @SuppressWarnings("unchecked")
        List<Map<String, Object>> documents = exchange.getOut().getBody(List.class);
        InputStream content = (InputStream)documents.get(0).get("CamelCMISContent");
        assertEquals("This is the first Camel test content.", readFromStream(content));
View Full Code Here

                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }
View Full Code Here

        exchange.setProperty("ham", "old");
        exchange.setProperty("setException", setException);

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);

        return exchange;
    }

    private void assertExchange(Exchange exchange, boolean hasFault) {
View Full Code Here

        Producer producer = endpoint.createProducer();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody(hello);

        producer.start();
        producer.process(exchange);
        producer.stop();

        String s = exchange.getOut().getBody(String.class);
        assertEquals(bye, s);
    }
View Full Code Here

        Producer producer = endpoint.createProducer();
        producer.start();
        Exchange exchange = producer.createExchange();
        exchange.getIn().setBody("Hello World");
        try {
            producer.process(exchange);
            fail("Should have thrown an ExchangeTimedOutException wrapped in a RuntimeCamelException");
        } catch (Exception e) {
            assertTrue("Should have thrown an ExchangeTimedOutException", e instanceof ExchangeTimedOutException);
        }
        producer.stop();
View Full Code Here

        exchange.setProperty("ham", "old");
        exchange.setProperty("setException", setException);

        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);

        return exchange;
    }

    private void assertExchange(Exchange exchange, boolean hasFault) {
View Full Code Here

        Producer producer = endpoint.createProducer();
        producer.start();

        // set input and execute it
        exchange.getIn().setBody("Hello World");
        producer.process(exchange);

        Field field = producer.getClass().getDeclaredField("session");
        field.setAccessible(true);
        IoSession session = (IoSession) field.get(producer);
        assertTrue("There should be a test filter", session.getFilterChain().contains(TestFilter.class.getCanonicalName()));
View Full Code Here

                Producer producer;
                try {
                    producer = endpoint.createProducer();
                    producer.start();
                    producer.process(exchange);
                    producer.stop();
                } catch (Exception e) {
                    throw ObjectHelper.wrapRuntimeCamelException(e);
                }
View Full Code Here

        Exchange exchange = endpoint.createExchange();
        exchange.getIn().setBody("Hello World this file will be deleted");
        exchange.getIn().setHeader(Exchange.FILE_NAME, "hello.txt");
        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();

        // assert file is created
        File file = new File(FTP_ROOT_DIR + "deletefile/hello.txt");
        file = file.getAbsoluteFile();
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.