Groovy Documentation

## org.codehaus.groovy.grails.test
[Groovy] Interface GrailsTestType

    interface GrailsTestType

Describes the contract that a test type must support to be runnable by `grails test-app`.

Method Summary
`void` | `cleanup()` Do any necessary tidy up.
`java.lang.String` | `getName()` A suitable display name for this test type.
`java.lang.String` | `getRelativeSourcePath()` The relative path from the configured test source directory to the particular directory that contains the tests for this test type.
`int` | `prepare(GrailsTestTargetPattern[] testTargetPatterns, java.io.File compiledClassesDir, groovy.lang.Binding buildBinding)` Perform any kind of initialisation, and return how many tests will be run.
`GrailsTestTypeResult` | `run(GrailsTestEventPublisher eventPublisher)` Runs the tests, appropriately calls GrailsTestEventPublisher and returns the GrailsTestTypeResult.

Method Detail

### cleanup

    void cleanup()

  Do any necessary tidy up.

### getName

    java.lang.String getName()

  A suitable display name for this test type. Can be called at any time.

### getRelativeSourcePath

    java.lang.String getRelativeSourcePath()

  The relative path from the configured test source directory to the particular directory that contains the tests for this test type. The build will compile the source in directory returned by this if it is not null and exists.
  Returns:
    the directory to compile relative to the build test directory, or `null` if there is nothing to compile.

### prepare

    int prepare(GrailsTestTargetPattern[] testTargetPatterns, java.io.File compiledClassesDir, groovy.lang.Binding buildBinding)

  Perform any kind of initialisation, and return how many tests will be run. If the value returned is less than 1, run(GrailsTestEventPublisher) will NOT be called.
  Parameters:
    `compiledClassesDir` - where the source was compiled to, or `null` if getRelativeSourcePath() returned `null`.
    `buildBinding` - the binding from the build environment
  Returns:
    the number of tests of this type.

### run

    GrailsTestTypeResult run(GrailsTestEventPublisher eventPublisher)

  Runs the tests, appropriately calls GrailsTestEventPublisher and returns the GrailsTestTypeResult.

Groovy Documentation