testBlueprintContainer(bundleContext, bundle);
}
protected void testBlueprintContainer(BundleContext bc, Bundle bundle) throws Exception {
BlueprintContainer blueprintContainer = getBlueprintContainerForBundle(
bc == null ? bundleContext : bc, "org.apache.aries.blueprint.sample",
5000);
assertNotNull(blueprintContainer);
Object obj = blueprintContainer.getComponentInstance("bar");
assertNotNull(obj);
assertEquals(Bar.class, obj.getClass());
Bar bar = (Bar) obj;
assertNotNull(bar.getContext());
assertEquals("Hello FooBar", bar.getValue());
assertNotNull(bar.getList());
assertEquals(2, bar.getList().size());
assertEquals("a list element", bar.getList().get(0));
assertEquals(Integer.valueOf(5), bar.getList().get(1));
obj = blueprintContainer.getComponentInstance("foo");
assertNotNull(obj);
assertEquals(Foo.class, obj.getClass());
Foo foo = (Foo) obj;
assertEquals(5, foo.getA());
assertEquals(10, foo.getB());