Class Enclosed

  • All Implemented Interfaces:
    Describable, Filterable, Orderable, Sortable

    public class Enclosed
    extends Suite
    If you put tests in inner classes, Ant, for example, won't find them. By running the outer class with Enclosed, the tests in the inner classes will be run. You might put tests in inner classes to group them for convenience or to share constants. Abstract inner classes are ignored.

    So, for example:

     @RunWith(Enclosed.class)
     public class ListTests {
         ...useful shared stuff...
         public static class OneKindOfListTest {...}
         public static class AnotherKind {...}
         abstract public static class Ignored {...}
     }
     
    • Constructor Detail

      • Enclosed

        public Enclosed​(java.lang.Class<?> klass,
                        RunnerBuilder builder)
                 throws java.lang.Throwable
        Only called reflectively. Do not use programmatically.
        Throws:
        java.lang.Throwable