use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class OsgiDataFormatResolverTest method testOsgiResolverFindDataFormatFallbackTest.
@Test
public void testOsgiResolverFindDataFormatFallbackTest() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("allstar-dataformat", new SampleDataFormat(true));
CamelContext camelContext = new DefaultCamelContext(registry);
OsgiDataFormatResolver resolver = new OsgiDataFormatResolver(getBundleContext());
DataFormat dataformat = resolver.resolveDataFormat("allstar", camelContext);
assertNotNull("We should find the super dataformat", dataformat);
assertTrue("We should get the super dataformat here", dataformat instanceof SampleDataFormat);
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class OsgiDataFormatResolverTest method testOsgiResolverFindLanguageDoubleFallbackTest.
@Test
public void testOsgiResolverFindLanguageDoubleFallbackTest() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("allstar", new SampleDataFormat(false));
registry.put("allstar-dataformat", new SampleDataFormat(true));
CamelContext camelContext = new DefaultCamelContext(registry);
OsgiDataFormatResolver resolver = new OsgiDataFormatResolver(getBundleContext());
DataFormat dataformat = resolver.resolveDataFormat("allstar", camelContext);
assertNotNull("We should find the super dataformat", dataformat);
assertTrue("We should get the super dataformat here", dataformat instanceof SampleDataFormat);
assertFalse("We should NOT find the fallback dataformat", ((SampleDataFormat) dataformat).isFallback());
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class GreaterCamelEjbPropertiesTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
// use simple registry to not conflict with jndi used by EJB
CamelContext answer = new DefaultCamelContext(new SimpleRegistry());
// enlist EJB component using JndiContext
Properties properties = new Properties();
properties.setProperty(Context.INITIAL_CONTEXT_FACTORY, "org.apache.openejb.client.LocalInitialContextFactory");
EjbComponent ejb = answer.getComponent("ejb", EjbComponent.class);
ejb.setProperties(properties);
return answer;
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class SedaQueueFactoryTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
SimpleRegistry simpleRegistry = new SimpleRegistry();
simpleRegistry.put("arrayQueueFactory", arrayQueueFactory);
return new DefaultCamelContext(simpleRegistry);
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class ManagedFromRestGetTest method createCamelContext.
@Override
protected CamelContext createCamelContext() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("dummy-test", new DummyRestConsumerFactory());
return new DefaultCamelContext(registry);
}
Aggregations