@Test public void testFindByMultiplePackages() { serviceProvider = new ServiceProvider("com.tacitknowledge.flip.fixtures", "com.tacitknowledge.flip.otherfixtures"); Collection<Class<?>> objects = serviceProvider.findClass(FlipContext.class); assertFalse(objects.isEmpty()); boolean found = false; for(Class clazz : objects) { if (clazz == Test1ContextProvider.class) { found = true; break; } } assertTrue(found); found = false; for(Class clazz : objects) { if (clazz == TestContextProvider.class) { found = true; break; } } assertTrue(found); }
protected Collection<Class<?>> findClass(final Class<? extends Annotation> annotationClass) { return reflections.getTypesAnnotatedWith(annotationClass); }
ServiceProvider { protected Collection<Class<?>> findClass(final Class<? extends Annotation> annotationClass) { return reflections.getTypesAnnotatedWith(annotationClass); } }
ServiceProvider { protected Collection<Class<?>> findClass(final Class<? extends Annotation> annotationClass) { return reflections.getTypesAnnotatedWith(annotationClass); } ServiceProvider(final String... pkgs); }
ServiceProvider { protected Collection<Class<?>> findClass(final Class<? extends Annotation> annotationClass) { return reflections.getTypesAnnotatedWith(annotationClass); } ServiceProvider(final String... pkgs); Collection<Object> find(final Class<? extends Annotation> annotatedClass); Collection<T> find(final Class<? extends Annotation> annotatedClass, final Class<T> resultingClass); }
ServiceProvider { protected Collection<Class<?>> findClass(final Class<? extends Annotation> annotationClass) { return reflections.getTypesAnnotatedWith(annotationClass); } ServiceProvider(final String... pkgs); Collection<Object> find(final Class<? extends Annotation> annotatedClass); Collection<T> find(final Class<? extends Annotation> annotatedClass, final Class<T> resultingClass);  }