Find "production" classes (non-unit test) for a given package and subtype?

27 views
Skip to first unread message

Dan Rollo

unread,
Jan 23, 2013, 1:51:45 AM1/23/13
to google-code...@googlegroups.com
I'm trying to iterate over production classes of a given subtype in a give package.

I get close to what I'm after (given subtype in given package) using this:

        Reflections reflections = new Reflections(new ConfigurationBuilder()
                .setScanners(new SubTypesScanner(false /* don't exclude Object.class */), new ResourcesScanner())
                .setUrls(ClasspathHelper.forClassLoader(classLoadersList.toArray(new ClassLoader[0])))                
                .filterInputsBy(new FilterBuilder().include(FilterBuilder.prefix(packageName))));

    reflections.getSubTypesOf(Structure.class); // the subType

However, I want to exclude any unit test classes from the result. Production and Unit Test classes are in different folders on disk.
Is there some way to exclude all classes that exist in the Unit Test folder?

Thanks!
Dan

Reply all
Reply to author
Forward
0 new messages