_@Ignore
Description
- Ignore a test method.
- You do not have to comment out the source code for the method.Â
- Annotating the method with
@Ignore
will cause the test to be regarded as a passing test, although it will not actually be run.
Attributes
Attribute Name | Required? | Possible Values | Info |
---|---|---|---|
reason | Yes |
|
|
reactivate-on | No |
|
|
error-id | No |
|
|
failure-id | No |
|
|
Location in the test class file
Before a test method.
Examples
In the following example, the failure-id
attribute notes for the programmer's benefit what failure ID is expected.
Â
@Ignore
@Ignore(
reason:'Throwaway test',
failure-id: 'FORCED_FAILURE'
)
@Test
ignoreFailure()
{
log(
message: 'Annotated with failure',
log-file-name: 'test_me.log',
log-classifier: 'anyClassifier'
);
fail(
message:'Failure message',
failure-id: 'FORCED_FAILURE'
);
}
Â
In the CLI, the test will show both Passed and Ignored.
Â
userme > te test_me#ignoreFailure Processing [1] tests class experiment.test_me ------------------------------------------------------- 1/1 .ignoreFailure Throwaway test Ignored P[1] I[1]
Â