01: package org.junit;
02:
03: import java.lang.annotation.ElementType;
04: import java.lang.annotation.Retention;
05: import java.lang.annotation.RetentionPolicy;
06: import java.lang.annotation.Target;
07:
08: /**
09: * <p>Sometimes you want to temporarily disable a test or a group of tests. Methods annotated with
10: * {@link org.junit.Test} that are also annotated with <code>@Ignore</code> will not be executed as tests.
11: * Also, you can annotate a class containing test methods with <code>@Ignore</code> and none of the containing
12: * tests will be executed. Native JUnit 4 test runners should report the number of ignored tests along with the
13: * number of tests that ran and the number of tests that failed.</p>
14: *
15: * For example:
16: * <pre>
17: * @Ignore @Test public void something() { ...
18: * </pre>
19: * @Ignore takes an optional default parameter if you want to record why a test is being ignored:<br/>
20: * <pre>
21: * @Ignore("not ready yet") @Test public void something() { ...
22: * </pre>
23: * @Ignore can also be applied to the test class:<br/>
24: * <pre>
25: * @Ignore public class IgnoreMe {
26: * @Test public void test1() { ... }
27: * @Test public void test2() { ... }
28: * }
29: * </pre>
30: *
31: */
32: @Retention(RetentionPolicy.RUNTIME)
33: @Target({ElementType.METHOD,ElementType.TYPE})
34: public @interface Ignore {
35: /**
36: * The optional reason why the test is ignored.
37: */
38: String value() default "";
39: }
|