use of org.osgi.service.cdi.CdiEvent in project aries by apache.
the class EventsTests method testEventsGetSent.
public void testEventsGetSent() throws Exception {
BeanManager beanManager = cdiContainer.getBeanManager();
assertNotNull(beanManager);
@SuppressWarnings("serial") Set<Bean<?>> beans = beanManager.getBeans(Object.class, new AnnotationLiteral<CdiEventObserverQualifier>() {
});
Bean<?> bean = beanManager.resolve(beans);
CreationalContext<?> ctx = beanManager.createCreationalContext(bean);
Object bcb = beanManager.getReference(bean, Object.class, ctx);
assertNotNull(bcb);
@SuppressWarnings("unchecked") BeanService<List<CdiEvent>> bti = (BeanService<List<CdiEvent>>) bcb;
List<CdiEvent> list = bti.get();
assertNotNull(list);
assertEquals(3, list.size());
}
Aggregations