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