Package org.apache.camel

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


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

                // return the OUT body, but check for exchange pattern
View Full Code Here


        int response = exchange.getOut().getBody(Integer.class);
       
        assertEquals("Get a wrong response.", 33, response);

        // stop and exit the client
        producer.stop();
        context.stop();
    }
   
    @Test
    public void testCamelRemotingInvocation() {
View Full Code Here

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

                // return the OUT body, but check for exchange pattern
View Full Code Here

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

                // return the OUT body, but check for exchange pattern
View Full Code Here

        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

        Field field = producer.getClass().getDeclaredField("session");
        field.setAccessible(true);
        IoSession session = (IoSession) field.get(producer);
        assertTrue("There should be a logger filter", session.getFilterChain().contains("logger"));

        producer.stop();

        assertMockEndpointsSatisifed();
    }

    public void testLoggerOptionFalse() throws Exception {
View Full Code Here

        Field field = producer.getClass().getDeclaredField("session");
        field.setAccessible(true);
        IoSession session = (IoSession) field.get(producer);
        assertFalse("There should NOT be a logger filter", session.getFilterChain().contains("logger"));

        producer.stop();

        assertMockEndpointsSatisifed();
    }

    public void testNoLoggerOption() throws Exception {
View Full Code Here

        Field field = producer.getClass().getDeclaredField("session");
        field.setAccessible(true);
        IoSession session = (IoSession) field.get(producer);
        assertFalse("There should NOT default be a logger filter", session.getFilterChain().contains("logger"));

        producer.stop();

        assertMockEndpointsSatisifed();
    }

View Full Code Here

        Field field = producer.getClass().getDeclaredField("connector");
        field.setAccessible(true);
        field.set(producer, mockConnector);

        // stop using our mock
        producer.stop();

        verify(mockConnector);

        assertMockEndpointsSatisifed();
    }
View Full Code Here

        exchange.getIn().setBody("Hello ASCII from FTPServer");
        exchange.getIn().setHeader(FileComponent.HEADER_FILE_NAME, "ascii.txt");
        Producer producer = endpoint.createProducer();
        producer.start();
        producer.process(exchange);
        producer.stop();
    }

    protected RouteBuilder createRouteBuilder() throws Exception {
        return new RouteBuilder() {
            public void configure() 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.