public class

Enclosed

extends Suite
java.lang.Object
   ↳ org.junit.runner.Runner
     ↳ org.junit.runners.ParentRunner<T>
       ↳ org.junit.runners.Suite
         ↳ org.junit.experimental.runners.Enclosed

Class Overview

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. So, for example:

  \@RunWith(Enclosed.class)
  public class ListTests {
  	...useful shared stuff...
  	public static class OneKindOfListTest {...}
  	public static class AnotherKind {...}
  }
  
For a real example, @see org.junit.tests.manipulation.SortableTest.

Summary

Public Constructors
Enclosed(Class<?> klass, RunnerBuilder builder)
Only called reflectively.
[Expand]
Inherited Methods
From class org.junit.runners.Suite
From class org.junit.runners.ParentRunner
From class org.junit.runner.Runner
From class java.lang.Object
From interface org.junit.runner.Describable
From interface org.junit.runner.manipulation.Filterable
From interface org.junit.runner.manipulation.Sortable

Public Constructors

public Enclosed (Class<?> klass, RunnerBuilder builder)

Only called reflectively. Do not use programmatically.

Throws
Throwable