GrailsTestType (Grails 2.4.4)
Date: 2014-10-28

Package: org.codehaus.groovy.grails.test

## [Groovy] Interface GrailsTestType

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

- - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `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 eventPublisher and returns the test result.

- - ### Method Detail

    - #### void cleanup()

      Do any necessary tidy up.

    - #### java.lang.String getName()

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

    - #### 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.

    - #### 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.

    - #### GrailsTestTypeResult run(GrailsTestEventPublisher eventPublisher)

      Runs the tests, appropriately calls eventPublisher and returns the test result.