_@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
reasonYes
  • A string
  • Appears in CLI, above the word "Ignored."
reactivate-onNo
  • A string
  • Format: YYYY-MM-DD
  • Day on which to expire the @Ignore

error-idNo
  • A string
  • Notes the error being ignored.
  • Does not actually cause the named error to be ignored.
  • An error will be ignored whether or not this attribute is present.
failure-idNo
  • A string
  • Notes the failure being ignored.
  • Does not actually cause the named failure to be ignored.
  • A failure will be ignored whether or not this attribute is present.

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]

Â