Search in sources :

Example 1 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class ComponentConfigurationIntegrationTest method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    final CamelContext camelContext = super.createCamelContext();
    // replace client id with invalid value
    camelContext.getComponent("linkedin", LinkedInComponent.class).getConfiguration().setClientId("bad_client_id");
    return camelContext;
}
Also used : CamelContext(org.apache.camel.CamelContext)

Example 2 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class BaseMinaTest method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = super.createCamelContext();
    context.addComponent("properties", new PropertiesComponent("ref:prop"));
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext) PropertiesComponent(org.apache.camel.component.properties.PropertiesComponent)

Example 3 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class MetricsMessageHistoryTest method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = super.createCamelContext();
    MetricsMessageHistoryFactory factory = new MetricsMessageHistoryFactory();
    factory.setUseJmx(false);
    factory.setMetricsRegistry(registry);
    context.setMessageHistoryFactory(factory);
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext)

Example 4 with CamelContext

use of org.apache.camel.CamelContext in project camel by apache.

the class ExceptionRouteMetricsMessageHistoryTest method createCamelContext.

@Override
protected CamelContext createCamelContext() throws Exception {
    CamelContext context = super.createCamelContext();
    MetricsMessageHistoryFactory factory = new MetricsMessageHistoryFactory();
    factory.setUseJmx(false);
    factory.setMetricsRegistry(registry);
    context.setMessageHistoryFactory(factory);
    return context;
}
Also used : CamelContext(org.apache.camel.CamelContext)

Example 5 with CamelContext

use of org.apache.camel.CamelContext in project opennms by OpenNMS.

the class NCSPathProviderTest method setUp.

@Before
public void setUp() throws Exception {
    NCSPathRouteUtil pathUtil = new NCSPathRouteUtil(new MockNCSComponentRepository(), new MockNodeDao());
    SimpleRegistry registry = new SimpleRegistry();
    registry.put("pathProviderUtil", pathUtil);
    CamelContext camel = new DefaultCamelContext(registry);
    camel.addRoutes(new RouteBuilder() {

        @Override
        public void configure() throws Exception {
            from("direct:start").setHeader(Exchange.HTTP_URI, simple("http://localhost:10346/ncs-provider/api/space/nsas/service-management/services/884779")).to("http://dummyhost").beanRef("pathProviderUtil", "getServiceName").setHeader(Exchange.HTTP_URI, simple("http://localhost:10346/ncs-provider/api/space/nsas/eline-ptp/service-management/services/884779/servicepath?deviceA=${header.deviceA}&deviceZ=${header.deviceZ}")).to("http://dummyhost").beanRef("pathProviderUtil", "createPath");
        }
    });
    camel.start();
    m_ncsPathService = new NCSPathProviderService(camel);
}
Also used : CamelContext(org.apache.camel.CamelContext) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) RouteBuilder(org.apache.camel.builder.RouteBuilder) SimpleRegistry(org.apache.camel.impl.SimpleRegistry) NCSPathRouteUtil(org.opennms.features.topology.plugins.ncs.support.NCSPathRouteUtil) DefaultCamelContext(org.apache.camel.impl.DefaultCamelContext) Before(org.junit.Before)

Aggregations

CamelContext (org.apache.camel.CamelContext)1478 Test (org.junit.Test)691 DefaultCamelContext (org.apache.camel.impl.DefaultCamelContext)684 RouteBuilder (org.apache.camel.builder.RouteBuilder)448 ProducerTemplate (org.apache.camel.ProducerTemplate)434 ConnectionFactory (javax.jms.ConnectionFactory)220 MockEndpoint (org.apache.camel.component.mock.MockEndpoint)210 Exchange (org.apache.camel.Exchange)109 HashMap (java.util.HashMap)93 Endpoint (org.apache.camel.Endpoint)52 DefaultExchange (org.apache.camel.impl.DefaultExchange)50 IOException (java.io.IOException)46 Map (java.util.Map)45 SimpleRegistry (org.apache.camel.impl.SimpleRegistry)44 CountDownLatch (java.util.concurrent.CountDownLatch)42 SpringCamelContext (org.apache.camel.spring.SpringCamelContext)42 ArrayList (java.util.ArrayList)41 Processor (org.apache.camel.Processor)40 PropertiesComponent (org.apache.camel.component.properties.PropertiesComponent)37 CamelExecutionException (org.apache.camel.CamelExecutionException)33