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