1b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotpackage org.junit;
2b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
3b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.ElementType;
4b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.Retention;
5b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.RetentionPolicy;
6b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotimport java.lang.annotation.Target;
7b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot
8b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot/**
9aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin * Sometimes you want to temporarily disable a test or a group of tests. Methods annotated with
10b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * {@link org.junit.Test} that are also annotated with <code>&#064;Ignore</code> will not be executed as tests.
11aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin * Also, you can annotate a class containing test methods with <code>&#064;Ignore</code> and none of the containing
12aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin * tests will be executed. Native JUnit 4 test runners should report the number of ignored tests along with the
13aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin * number of tests that ran and the number of tests that failed.
14aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin *
15aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin * <p>For example:
16b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * <pre>
17b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot *    &#064;Ignore &#064;Test public void something() { ...
18b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * </pre>
19aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin * &#064;Ignore takes an optional default parameter if you want to record why a test is being ignored:
20b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * <pre>
21b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot *    &#064;Ignore("not ready yet") &#064;Test public void something() { ...
22b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * </pre>
23aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin * &#064;Ignore can also be applied to the test class:
24b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * <pre>
25aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin *      &#064;Ignore public class IgnoreMe {
26aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin *          &#064;Test public void test1() { ... }
27aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin *          &#064;Test public void test2() { ... }
28aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin *         }
29b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot * </pre>
30b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot *
31aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin * @since 4.0
32b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot */
33b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot@Retention(RetentionPolicy.RUNTIME)
34b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot@Target({ElementType.METHOD, ElementType.TYPE})
35b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabotpublic @interface Ignore {
36aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin    /**
37aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin     * The optional reason why the test is ignored.
38aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin     */
39aeb93fc33cae3aadbb9b46083350ad2dc9aea645Paul Duffin    String value() default "";
40b3823db9f1192d8c81345740b3e65bd6738ba55bBrett Chabot}
41