Class ScanningSuite

  • All Implemented Interfaces:
    org.junit.runner.Describable, org.junit.runner.manipulation.Filterable, org.junit.runner.manipulation.Orderable, org.junit.runner.manipulation.Sortable

    public class ScanningSuite
    extends org.junit.runners.Suite
    A Suite that allows specifying patterns of names classes to include/exclude. Supports merging patterns specified in superclasses as well, to simplify writing focused test harnesses.
    • Constructor Detail

      • ScanningSuite

        public ScanningSuite​(Class<?> annotatedClass,
                             org.junit.runners.model.RunnerBuilder builder)
                      throws org.junit.runners.model.InitializationError
        Called reflectively on classes annotated with @RunWith(Suite.class)
        Parameters:
        annotatedClass - the root class
        builder - builds runners for classes in the suite
        Throws:
        org.junit.runners.model.InitializationError
    • Method Detail

      • findMatchingTestClasses

        public static Class<?>[] findMatchingTestClasses​(ClassResolver classResolver,
                                                         Class<?> annotatedClass)
        Gets all matching annotations from the test class being run and its superclasses, and finds all matching classes on the classpath. This method is 'unsafe' in that it throws lots of exceptions that need to be handled.
        Parameters:
        annotatedClass - the test class
        Returns:
        the matching classes.