Package org.apache.camel.impl

Examples of org.apache.camel.impl.SimpleRegistry


    private CamelSimpleExpressionPerfTestRunner() {
        //Utils class
    }

    public static void main(String[] args) throws Exception {
        long bodyOnly = executePerformanceTest(new SimpleRegistry(), "${body}");
        long bodyProperty = executePerformanceTest(new SimpleRegistry(), "${body[p]}");
        long bodyPropertyWithCache = executePerformanceTest(new SimpleRegistry(), "${body[p]}");

        System.out.printf("${body}: %dms%n", bodyOnly);
        System.out.printf("${body[p]} : %dms%n", bodyProperty);
        System.out.printf("${body[p]} with cache : %dms%n", bodyPropertyWithCache);
    }
View Full Code Here


        }
    }

    public void testErrorListener() throws Exception {
        try {
            SimpleRegistry registry = new SimpleRegistry();
            registry.put("myListener", listener);

            RouteBuilder builder = createRouteBuilder();
            CamelContext context = new DefaultCamelContext(registry);
            context.addRoutes(builder);
            context.start();
View Full Code Here

    private SimpleRegistry map;

    @Override
    protected SimpleRegistry createRegistry() throws Exception {
        map = new SimpleRegistry();
        return map;
    }
View Full Code Here

public class ManagedFromRestGetTest extends ManagementTestSupport {

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        registry.put("dummy-test", new DummyRestConsumerFactory());
        return new DefaultCamelContext(registry);
    }
View Full Code Here

public class ManagedRestRegistryTest extends ManagementTestSupport {

    @Override
    protected CamelContext createCamelContext() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        registry.put("dummy-test", new DummyRestConsumerFactory());
        return new DefaultCamelContext(registry);
    }
View Full Code Here

    }

    @Test(expected = FailedToCreateRouteException.class)
    public void shouldFailWhenThereIsNoJobLauncher() throws Exception {
        // Given
        SimpleRegistry registry = new SimpleRegistry();
        registry.put("mockJob", job);
        CamelContext camelContext = new DefaultCamelContext(registry);
        camelContext.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("spring-batch:mockJob");
View Full Code Here

    }

    @Test(expected = FailedToCreateRouteException.class)
    public void shouldFailWhenThereIsMoreThanOneJobLauncher() throws Exception {
        // Given
        SimpleRegistry registry = new SimpleRegistry();
        registry.put("mockJob", job);
        registry.put("launcher1", jobLauncher);
        registry.put("launcher2", jobLauncher);
        CamelContext camelContext = new DefaultCamelContext(registry);
        camelContext.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("spring-batch:mockJob");
View Full Code Here

    }

    @Test
    public void shouldResolveAnyJobLauncher() throws Exception {
        // Given
        SimpleRegistry registry = new SimpleRegistry();
        registry.put("mockJob", job);
        registry.put("someRandomName", jobLauncher);
        CamelContext camelContext = new DefaultCamelContext(registry);
        camelContext.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("direct:start").to("spring-batch:mockJob");
View Full Code Here

public class GuavaEventBusConsumerConfigurationTest {

    @Test(expected = IllegalStateException.class)
    public void shouldForwardMessageToCamel() throws Exception {
        // Given
        SimpleRegistry registry = new SimpleRegistry();
        registry.put("eventBus", new EventBus());
        CamelContext context = new DefaultCamelContext(registry);
        context.addRoutes(new RouteBuilder() {
            @Override
            public void configure() throws Exception {
                from("guava-eventbus:eventBus?listenerInterface=org.apache.camel.component.guava.eventbus.CustomListener&eventClass=org.apache.camel.component.guava.eventbus.MessageWrapper").
View Full Code Here

        return new RabbitMQComponent(context).createEndpoint(uri, remaining, params);
    }

    @Test
    public void testConnectionFactoryRef() throws Exception {
        SimpleRegistry registry = new SimpleRegistry();
        ConnectionFactory connectionFactoryMock = Mockito.mock(ConnectionFactory.class);
        registry.put("connectionFactoryMock", connectionFactoryMock);

        CamelContext defaultContext = new DefaultCamelContext(registry);

        Map<String, Object> params = new HashMap<String, Object>();
        params.put("connectionFactory", "#connectionFactoryMock");
View Full Code Here

TOP

Related Classes of org.apache.camel.impl.SimpleRegistry

Copyright © 2018 www.massapicom. 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.