use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class BlueprintComponentResolverTest method testOsgiResolverFindComponentFallbackTest.
@Test
public void testOsgiResolverFindComponentFallbackTest() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("allstar-component", new SampleComponent(true));
CamelContext camelContext = new DefaultCamelContext(registry);
BlueprintComponentResolver resolver = new BlueprintComponentResolver(null);
Component component = resolver.resolveComponent("allstar", camelContext);
assertNotNull("We should find the super component", component);
assertTrue("We should get the super component here", component instanceof SampleComponent);
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class OsgiLanguageResolverTest method testOsgiResolverFindLanguageFallbackTest.
@Test
public void testOsgiResolverFindLanguageFallbackTest() throws IOException {
SimpleRegistry registry = new SimpleRegistry();
registry.put("fuffy-language", new SampleLanguage(true));
CamelContext camelContext = new DefaultCamelContext(registry);
OsgiLanguageResolver resolver = new OsgiLanguageResolver(getBundleContext());
Language language = resolver.resolveLanguage("fuffy", camelContext);
assertNotNull("We should find fuffy language", language);
assertTrue("We should find the fallback language", ((SampleLanguage) language).isFallback());
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class OsgiLanguageResolverTest method testOsgiResolverFindLanguageDoubleFallbackTest.
@Test
public void testOsgiResolverFindLanguageDoubleFallbackTest() throws IOException {
SimpleRegistry registry = new SimpleRegistry();
registry.put("fuffy", new SampleLanguage(false));
registry.put("fuffy-language", new SampleLanguage(true));
CamelContext camelContext = new DefaultCamelContext(registry);
OsgiLanguageResolver resolver = new OsgiLanguageResolver(getBundleContext());
Language language = resolver.resolveLanguage("fuffy", camelContext);
assertNotNull("We should find fuffy language", language);
assertFalse("We should NOT find the fallback language", ((SampleLanguage) language).isFallback());
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class OsgiComponentResolverTest method testOsgiResolverFindLanguageDoubleFallbackTest.
@Test
public void testOsgiResolverFindLanguageDoubleFallbackTest() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("allstar", new SampleComponent(false));
registry.put("allstar-component", new SampleComponent(true));
CamelContext camelContext = new DefaultCamelContext(registry);
OsgiComponentResolver resolver = new OsgiComponentResolver(getBundleContext());
Component component = resolver.resolveComponent("allstar", camelContext);
assertNotNull("We should find the super component", component);
assertTrue("We should get the super component here", component instanceof SampleComponent);
assertFalse("We should NOT find the fallback component", ((SampleComponent) component).isFallback());
}
use of org.apache.camel.impl.SimpleRegistry in project camel by apache.
the class OsgiComponentResolverTest method testOsgiResolverFindComponentFallbackTest.
@Test
public void testOsgiResolverFindComponentFallbackTest() throws Exception {
SimpleRegistry registry = new SimpleRegistry();
registry.put("allstar-component", new SampleComponent(true));
CamelContext camelContext = new DefaultCamelContext(registry);
OsgiComponentResolver resolver = new OsgiComponentResolver(getBundleContext());
Component component = resolver.resolveComponent("allstar", camelContext);
assertNotNull("We should find the super component", component);
assertTrue("We should get the super component here", component instanceof SampleComponent);
}
Aggregations