1 package org.junit; 2 3 import java.lang.annotation.ElementType; 4 import java.lang.annotation.Retention; 5 import java.lang.annotation.RetentionPolicy; 6 import java.lang.annotation.Target; 7 8 /** 9 * <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 */ value()38 String value() default ""; 39 } 40