use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class ManagedFromRestGetEmbeddedRouteTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("dummy-test", new DummyRestConsumerFactory());
return new DefaultCamelContext(registry);
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class ManagedFromRestPlaceholderTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("dummy-test", new DummyRestConsumerFactory());
CamelContext answer = new DefaultCamelContext(registry);
PropertiesComponent pc = new PropertiesComponent();
pc.setLocation("classpath:org/apache/camel/management/rest.properties");
answer.addComponent("properties", pc);
return answer;
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class LogProcessorWithProvidedLoggerTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("mylogger1", LoggerFactory.getLogger("org.apache.camel.customlogger"));
CamelContext context = new DefaultCamelContext(registry);
return context;
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class CxfEndpointTest method testCxfEndpointConfigurer.
@Test
public void testCxfEndpointConfigurer() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
CxfEndpointConfigurer configurer = EasyMock.createMock(CxfEndpointConfigurer.class);
Processor processor = EasyMock.createMock(Processor.class);
registry.put("myConfigurer", configurer);
CamelContext camelContext = new DefaultCamelContext(registry);
CxfComponent cxfComponent = new CxfComponent(camelContext);
CxfEndpoint endpoint = (CxfEndpoint) cxfComponent.createEndpoint(routerEndpointURI + "&cxfEndpointConfigurer=#myConfigurer");
configurer.configure(EasyMock.isA(AbstractWSDLBasedEndpointFactory.class));
EasyMock.expectLastCall();
configurer.configureServer(EasyMock.isA(Server.class));
EasyMock.expectLastCall();
EasyMock.replay(configurer);
endpoint.createConsumer(processor);
EasyMock.verify(configurer);
EasyMock.reset(configurer);
configurer.configure(EasyMock.isA(AbstractWSDLBasedEndpointFactory.class));
EasyMock.expectLastCall();
configurer.configureClient(EasyMock.isA(Client.class));
EasyMock.expectLastCall();
EasyMock.replay(configurer);
Producer producer = endpoint.createProducer();
producer.start();
EasyMock.verify(configurer);
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class CamelSimpleExpressionPerfTestRunner method main.
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);
}
Aggregations