defineManagedBean(Producer1.class);
defineManagedBean(Producer1ConsumerComponent.class);
List<AbstractOwbBean<?>> comps = getComponents();
ContextFactory contextFactory = WebBeansContext.getInstance().getContextFactory();
contextFactory.initRequestContext(null);
contextFactory.initApplicationContext(null);
Assert.assertEquals(4, getDeployedComponents());
Object obj = getManager().getInstance(comps.get(0));
Assert.assertNotNull(obj);
getInstanceByName("service");
getManager().getInstance(comps.get(1));
Object object = getManager().getInstance(comps.get(2));
Assert.assertTrue(object instanceof Producer1ConsumerComponent);
Producer1ConsumerComponent single = (Producer1ConsumerComponent) object;
IService service = single.getService();
Assert.assertNotNull(service);
contextFactory.destroyApplicationContext(null);
contextFactory.destroyRequestContext(null);
}