Package org.apache.camel

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


        myTemplate.sendBodyAndHeader("file:target/foo", "Hello World", Exchange.FILE_NAME, "hello.txt");

        mock.assertIsSatisfied();

        myTemplate.stop();
    }

    @Configuration
    public static Option[] configure() throws Exception {
View Full Code Here


                Message in = exchange.getIn();
                in.setHeader("name", "James");
                in.setBody(body);
            }
        });
        template.stop();

        resultEndpoint.assertIsSatisfied();
    }

    protected void assertValidContext(SpringCamelContext context) {
View Full Code Here

                Message in = exchange.getIn();
                in.setHeader("name", "James");
                in.setBody(body);
            }
        });
        template.stop();

        List list = MyProcessor.getExchanges();
        assertEquals("Should have received a single exchange: " + list, 1, list.size());
    }
View Full Code Here

        mock.expectedMessageCount(1);

        ProducerTemplate template = camel.createProducerTemplate();
        template.start();
        template.sendBody("direct:start", "Hello World");
        template.stop();

        mock.assertIsSatisfied();
    }

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

        mock.expectedMessageCount(1);

        ProducerTemplate template = camel.createProducerTemplate();
        template.start();
        template.sendBody("direct:start", "Hello World");
        template.stop();

        mock.assertIsSatisfied();
    }

}
View Full Code Here

        result.expectedBodiesReceived("Hello World");

        ProducerTemplate template = camel1.createProducerTemplate();
        template.start();
        template.sendBody("direct:one", "Hello World");
        template.stop();

        result.assertIsSatisfied();

        // lets see if the counter is +1 since last (has 1 step in the route)
        int delta = myInterceptor.getCount() - start;
View Full Code Here

        result.expectedBodiesReceived("Bye World");

        ProducerTemplate template = camel2.createProducerTemplate();
        template.start();
        template.sendBody("direct:two", "Bye World");
        template.stop();

        result.assertIsSatisfied();

        // lets see if the counter is +2 since last (has 2 steps in the route)
        int delta = myInterceptor.getCount() - start;
View Full Code Here

        result.expectedBodiesReceived(body);

        ProducerTemplate template = camel1.createProducerTemplate();
        template.start();
        template.sendBody("direct:start", body);
        template.stop();

        result.assertIsSatisfied();
    }

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

        result.expectedBodiesReceived(body);

        ProducerTemplate template = camel2.createProducerTemplate();
        template.start();
        template.sendBody("direct:start", body);
        template.stop();

        result.assertIsSatisfied();
    }

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

        result.expectedMessageCount(0);

        ProducerTemplate template = camel1.createProducerTemplate();
        template.start();
        template.sendBody("direct:foo", body);
        template.stop();

        Thread.sleep(200);
       
        result.assertIsSatisfied();
    }
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.