private static final transient Log LOG = LogFactory.getLog(CamelContextAutoStartupTest.class);
public void testAutoStartupFalse() throws Exception {
ApplicationContext ac = new ClassPathXmlApplicationContext("org/apache/camel/spring/config/CamelContextAutoStartupTestFalse.xml");
SpringCamelContext camel = (SpringCamelContext) ac.getBean("myCamel");
assertEquals("myCamel", camel.getName());
assertEquals(false, camel.isStarted());
assertEquals(false, camel.isAutoStartup());
assertEquals(0, camel.getRoutes().size());
// now start Camel
LOG.info("******** now starting Camel manually *********");
camel.start();
// now its started
assertEquals(true, camel.isStarted());
// but auto startup is still fasle
assertEquals(false, camel.isAutoStartup());
// but now we have one route
assertEquals(1, camel.getRoutes().size());
// and now we can send a message to the route and see that it works
MockEndpoint mock = camel.getEndpoint("mock:result", MockEndpoint.class);
mock.expectedMessageCount(1);
camel.createProducerTemplate().sendBody("direct:start", "Hello World");
mock.assertIsSatisfied();
}