Package org.apache.camel

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


        String text = context.getTypeConverter().convertTo(String.class, url);
        assertNotNull(text);
        assertTrue(text.contains("log4j"));

        context.stop();
    }

    public void testLoadClasspathAsUrl() throws Exception {
        CamelContext context = new DefaultCamelContext();
        context.start();
View Full Code Here


        String text = context.getTypeConverter().convertTo(String.class, url);
        assertNotNull(text);
        assertTrue(text.contains("log4j"));

        context.stop();
    }

}
View Full Code Here

        ISay proxy = ProxyHelper.createProxy(endpoint, ISay.class);
        String rc = proxy.say();
        assertEquals("Good Bye!", rc);
        // END SNIPPET: invoke

        camelContext.stop();
    }

    protected RouteBuilder getRouteBuilder(final CamelContext context) {
        return new RouteBuilder() {
            // START SNIPPET: route
View Full Code Here

    @Test
    public void  testOptions() throws Exception {
        CamelContext context = createCamelContext(new String[] {"-cc", "org.apache.camel.spring.javaconfig.config.ContextConfig"});
        context.start();
        runTests(context);
        context.stop();
    }
   
    @Test
    public void testOptionBP() throws Exception {
        CamelContext context = createCamelContext(new String[]{"-bp", "org.apache.camel.spring.javaconfig.config"});
View Full Code Here

    @Test
    public void testOptionBP() throws Exception {
        CamelContext context = createCamelContext(new String[]{"-bp", "org.apache.camel.spring.javaconfig.config"});
        context.start();
        runTests(context);
        context.stop();
       
    }
       
    private CamelContext createCamelContext(String[] options) throws Exception {
        Main main = new Main();       
View Full Code Here

       
        Thread.sleep(4000);
        assertTrue(context.getRouteStatus("testRoute") == ServiceStatus.Started);
        context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");

        context.stop();
        mock.assertIsSatisfied();
    }

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

        try {
            context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");
        } catch (CamelExecutionException e) {
            consumerStopped = true;
        }   
        context.stop();
        assertTrue(consumerStopped);
    }
   
   
    public void suspendTest() throws Exception {
View Full Code Here

            context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");
        } catch (CamelExecutionException e) {
            consumerSuspended = true;
        }       
       
        context.stop();
        assertTrue(consumerSuspended);
    }
   
    public void resumeTest() throws Exception {
        CamelContext context = startRouteWithPolicy("resumePolicy");
View Full Code Here

        ServiceHelper.suspendService(context.getRoute("testRoute").getConsumer());
       
        Thread.sleep(4000);
        context.createProducerTemplate().sendBody("direct:start", "Ready or not, Here, I come");
       
        context.stop();
        mock.assertIsSatisfied();
    }
   
    @SuppressWarnings("unchecked")
    private CamelContext startRouteWithPolicy(String policyBeanName) throws Exception {
View Full Code Here

                template.sendBodyAndHeaders("direct:in", payload, headers);
            }
            assertMockEndpointsSatisfied();
            return mock.getReceivedExchanges().get(0);
        } finally {
            context.stop();
        }
    }

    @Before
    public void setUp() 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.