KickJava   Java API By Example, From Geeks To Geeks.

Java > Open Source Codes > org > junit > Ignore


1 package org.junit;
2
3 import java.lang.annotation.ElementType JavaDoc;
4 import java.lang.annotation.Retention JavaDoc;
5 import java.lang.annotation.RetentionPolicy JavaDoc;
6 import java.lang.annotation.Target JavaDoc;
7
8 /**
9  * <p>Sometimes you want to temporarily disable a test. Methods annotated with {@link org.junit.Test}
10  * that are also annotated with <code>&#064;Ignore</code> will not be executed as tests. Native JUnit 4 test runners
11  * should report the number of ignored tests along with the number of tests that ran and the
12  * number of tests that failed.</p>
13  *
14  * For example:
15  * <pre>
16  * &#064;Ignore &#064;Test public void something() { ...
17  * </pre>
18  * &#064;Ignore takes an optional default parameter if you want to record why a test is being ignored:<br/>
19  * <pre>
20  * &#064;Ignore("not ready yet") &#064;Test public void something() { ...
21  * </pre>
22  *
23  */

24 @Retention JavaDoc(RetentionPolicy.RUNTIME)
25 @Target JavaDoc({ElementType.METHOD, ElementType.TYPE})
26 public @interface Ignore {
27     /**
28      * The optional reason why the test is ignored.
29      */

30     String JavaDoc value() default "";
31 }
32
Popular Tags