I am finding unexpected modules

31 views
Skip to first unread message

Debasish Padhy

unread,
May 24, 2014, 6:59:50 PM5/24/14
to google-code...@googlegroups.com

This is a method I am trying to execute 

// Only top level modules should be added to this list

protected Set<Class<? extends Module>> discoverModulesOnClassPath() {

// Scan classpath to identify modules

Predicate<String> filter = new FilterBuilder().includePackage("org.appops.server.core.bindings") ;

Reflections reflections = new Reflections(new ConfigurationBuilder()

         .setScanners(new SubTypesScanner()).setUrls(asList(ClasspathHelper.forClass(Module.class))));

Set<Class<? extends Module>> guiceModules = reflections.getSubTypesOf(Module.class);

return guiceModules;

}


And this is my test

@Test

public void testDiscoverModulesOnClassPath() {

AppOpsCoreServletConfig config = new AppOpsCoreServletConfig() ;

Set<Class<? extends Module>>  modules = config.discoverModulesOnClassPath() ; 

for ( Class m : modules){

System.out.println(m.getSimpleName());

}

} 

I have 3 custom module in the specific package ( have cross checked the path ) but it prints this list of classes

ProviderMethodsModule

AbstractModule

RootModule

PrivateModule


All of these are Guice inbuilt module. Can some one please help what I am doing wrong ?

thanks.

Reply all
Reply to author
Forward
0 new messages