summaryrefslogtreecommitdiffstats
path: root/junit4/src/main/java/org/junit/experimental/runners/Enclosed.java
blob: b0560ed36b5a3a8cea7ca556f846491a2d05f5f8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.junit.experimental.runners;

import org.junit.runners.Suite;
import org.junit.runners.model.RunnerBuilder;


/**
 * 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:
 *  <pre>
 *  \@RunWith(Enclosed.class)
 *  public class ListTests {
 *  	...useful shared stuff...
 *  	public static class OneKindOfListTest {...}
 *  	public static class AnotherKind {...}
 *  }
 *  </pre>
 *  
 *  For a real example, @see org.junit.tests.manipulation.SortableTest.
 */
public class Enclosed extends Suite {
	/**
	 * Only called reflectively. Do not use programmatically.
	 */
	public Enclosed(Class<?> klass, RunnerBuilder builder) throws Throwable {
		super(builder, klass, klass.getClasses());
	}
}