1b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotpackage org.junit.runner;
2b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
3b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.ElementType;
4b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.Inherited;
5b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.Retention;
6b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.RetentionPolicy;
7b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.Target;
8b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
9b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot/**
10b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * When a class is annotated with <code>&#064;RunWith</code> or extends a class annotated
11b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * with <code>&#064;RunWith</code>, JUnit will invoke the class it references to run the
12b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * tests in that class instead of the runner built into JUnit. We added this feature late
13b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * in development. While it seems powerful we expect the runner API to change as we learn
14b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * how people really use it. Some of the classes that are currently internal will likely
15b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * be refined and become public.
16b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot *
17b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * For example, suites in JUnit 4 are built using RunWith, and a custom runner named Suite:
18b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot *
19b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * <pre>
20b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * &#064;RunWith(Suite.class)
21b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * &#064;SuiteClasses({ATest.class, BTest.class, CTest.class})
22b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * public class ABCSuite {
23b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * }
24b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * </pre>
25b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot */
26b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot@Retention(RetentionPolicy.RUNTIME)
27b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot@Target(ElementType.TYPE)
28b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot@Inherited
29b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotpublic @interface RunWith {
30b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot	/**
31b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot	 * @return a Runner class (must have a constructor that takes a single Class to run)
32b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot	 */
33b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot	Class<? extends Runner> value();
34b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot}
35