use of org.apache.aries.cdi.test.interfaces.Pojo in project aries by apache.
the class OSGiBeanDescriptorTests method testServices.
public void testServices() throws Exception {
Bundle tb2Bundle = installBundle("tb2.jar");
ServiceTracker<Pojo, Pojo> st = new ServiceTracker<Pojo, Pojo>(bundleContext, Pojo.class, null);
st.open(true);
try {
Pojo pojo = st.waitForService(timeout);
assertNotNull(pojo);
} finally {
tb2Bundle.uninstall();
}
}
use of org.apache.aries.cdi.test.interfaces.Pojo in project aries by apache.
the class AbstractTestCase method assertPojoExists.
void assertPojoExists(BeanManager beanManager) {
Set<Bean<?>> beans = beanManager.getBeans(Pojo.class, any);
assertFalse(beans.isEmpty());
Iterator<Bean<?>> iterator = beans.iterator();
Bean<?> bean = iterator.next();
assertTrue(Pojo.class.isAssignableFrom(bean.getBeanClass()));
assertFalse(iterator.hasNext());
bean = beanManager.resolve(beans);
CreationalContext<?> ctx = beanManager.createCreationalContext(bean);
Pojo pojo = (Pojo) beanManager.getReference(bean, Pojo.class, ctx);
assertNotNull(pojo);
}
Aggregations