catch (Exception e) {
}
}
public void testGetServicePropertyClassloader() throws Exception {
OsgiServiceProxyFactoryBean pfb = new OsgiServiceProxyFactoryBean();
Method setter = AnnotatedBean.class.getMethod("setAnnotatedBeanTypeWithClassLoaderClient",
new Class[] { AnnotatedBean.class });
ServiceReference ref = AnnotationUtils.getAnnotation(setter, ServiceReference.class);
processor.getServiceProperty(pfb, ref, setter, null);
assertEquals(pfb.getContextClassLoader(), ImportContextClassLoader.CLIENT);
pfb = new OsgiServiceProxyFactoryBean();
setter = AnnotatedBean.class.getMethod("setAnnotatedBeanTypeWithClassLoaderUmanaged",
new Class[] { AnnotatedBean.class });
ref = AnnotationUtils.getAnnotation(setter, ServiceReference.class);
processor.getServiceProperty(pfb, ref, setter, null);
assertEquals(pfb.getContextClassLoader(), ImportContextClassLoader.UNMANAGED);
pfb = new OsgiServiceProxyFactoryBean();
setter = AnnotatedBean.class.getMethod("setAnnotatedBeanTypeWithClassLoaderServiceProvider",
new Class[] { AnnotatedBean.class });
ref = AnnotationUtils.getAnnotation(setter, ServiceReference.class);
processor.getServiceProperty(pfb, ref, setter, null);
assertEquals(pfb.getContextClassLoader(), ImportContextClassLoader.SERVICE_PROVIDER);
}