Package org.apache.camel

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


        }
        // END SNIPPET: e5

        // wait a bit and then stop
        Thread.sleep(1000);
        context.stop();
    }
}
View Full Code Here


        Component log = new LogComponent();
        context.addComponent("log", log);
        context.addEndpoint("log:/foo", log.createEndpoint("log://foo"));
        context.removeComponent("log");
        context.stop();

        List<String> expectedEvents = Arrays.asList("onContextStart", "onServiceAdd", "onServiceAdd", "onServiceAdd",
                "onServiceAdd", "onServiceAdd", "onServiceAdd", "onServiceAdd", "onThreadPoolAdd", "onThreadPoolAdd",
                "onComponentAdd", "onEndpointAdd", "onComponentRemove", "onContextStop");
        assertEquals(expectedEvents, dummy1.getEvents());
View Full Code Here

    public static List<Route> getRouteList(RouteBuilder builder) throws Exception {
        CamelContext context = new DefaultCamelContext();
        context.addRoutes(builder);
        context.start();
        List<Route> answer = context.getRoutes();
        context.stop();
        return answer;
    }

    /**
     * Asserts that the text contains the given string
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

        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

            fail("Expect to catch an exception here");
        } catch (Exception ex) {
            assertTrue(ex.getMessage().endsWith("Multiple consumers for the same endpoint is not allowed: Endpoint[http://localhost:7070/test]"));
        }
               
        context.stop();
    }

}
View Full Code Here

    public static List<Route> getRouteList(RouteBuilder builder) throws Exception {
        CamelContext context = new DefaultCamelContext();
        context.addRoutes(builder);
        context.start();
        List<Route> answer = context.getRoutes();
        context.stop();
        return answer;
    }

    /**
     * Asserts that the text contains the given string
View Full Code Here

    public static List<Route> getRouteList(RouteBuilder builder) throws Exception {
        CamelContext context = new DefaultCamelContext();
        context.addRoutes(builder);
        context.start();
        List<Route> answer = context.getRoutes();
        context.stop();
        return answer;
    }

    /**
     * Asserts that the text contains the given string
View Full Code Here

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

    @Override
    protected void setUp() throws Exception {
View Full Code Here

        ISay proxy = (ISay) applicationContext.getBean("sayProxy");
        String rc = proxy.say();
        assertEquals("Hello", rc);
        // END SNIPPET: invoke

        camelContext.stop();
        applicationContext.destroy();
    }

    protected AbstractXmlApplicationContext createApplicationContext() {
        return new ClassPathXmlApplicationContext("org/apache/camel/spring/remoting/spring.xml");
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.