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

Package: org.codehaus.groovy.grails.test.event

## [Groovy] Class GrailsTestEventPublisher

- org.codehaus.groovy.grails.test.event.GrailsTestEventPublisher

- Publishes test related events to the Grails build system.

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `protected GrailsBuildEventListener` | `buildEventListener` |

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsTestEventPublisher (GrailsBuildEventListener buildEventListener)` @param event the "event" closure from the Grails build system

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `testCaseEnd(java.lang.String name, java.lang.String out = null, java.lang.String err = null)` Signifies the end of a "unit" of tests.
    `void` | `testCaseStart(java.lang.String name)` Signifies the start of a "unit" of tests.
    `void` | `testEnd(java.lang.String name)` Signifies that a test has ended.
    `void` | `testFailure(java.lang.String name, java.lang.Throwable failure, boolean isError = false)` Signifies that a test did not complete successfully.
    `void` | `testFailure(java.lang.String name, java.lang.String failure = null, boolean isError = false)` Signifies that a test did not complete successfully.
    `void` | `testStart(java.lang.String name)` Signifies the start of an individual test, inside a parent "unit".

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class java.lang.Object` | `java.lang.Object#wait(long, int), java.lang.Object#wait(long), java.lang.Object#wait(), java.lang.Object#equals(java.lang.Object), java.lang.Object#toString(), java.lang.Object#hashCode(), java.lang.Object#getClass(), java.lang.Object#notify(), java.lang.Object#notifyAll()`

- - ### Field Detail

    - #### protected GrailsBuildEventListener buildEventListener

  - ### Constructor Detail

    - #### GrailsTestEventPublisher(GrailsBuildEventListener buildEventListener)

      Parameters:
        `event` - the "event" closure from the Grails build system

  - ### Method Detail

    - #### void testCaseEnd(java.lang.String name, java.lang.String out = null, java.lang.String err = null)

      Signifies the end of a "unit" of tests. (e.g. A JUnit TestCase). Must be called after testEnd(java.lang.String) with the same name as the most recent call to testCaseStart(java.lang.String). Publishes the event `TestCaseEnd` with `name` as the parameter.

      Parameters:
        `name` - a logical name for the test "unit"

    - #### void testCaseStart(java.lang.String name)

      Signifies the start of a "unit" of tests. (e.g. A JUnit TestCase). Must be called first, or after testCaseEnd(String,String,String). Publishes the event `TestCaseStart` with `name` as the parameter.

      Parameters:
        `name` - a logical name for the test "unit"

    - #### void testEnd(java.lang.String name)

      Signifies that a test has ended. Must be called after testStart(java.lang.String) with the same name, or testStart(java.lang.String, java.lang.String, boolean) or testStart(java.lang.String, java.lang.Throwable, boolean) with the same name. Publishes the event `TestEnd` with `name` as the parameter.

      Parameters:
        `name` - a logical name for the test
        `failure` - a description of the failure
        `isError` - true if this failure was due to an indirect error, false if this failure was a direct assertion failure or incorrect assumption

    - #### void testFailure(java.lang.String name, java.lang.Throwable failure, boolean isError = false)

      Signifies that a test did not complete successfully. Must be called after testStart(java.lang.String) with the same `name`. Publishes the event `TestFailure` with `name`, `failure` and `isError` as the parameters.

      Parameters:
        `name` - a logical name for the test
        `failure` - the throwable raised from the failure
        `isError` - true if this failure was due to an indirect error, false if this failure was a direct assertion failure or incorrect assumption

    - #### void testFailure(java.lang.String name, java.lang.String failure = null, boolean isError = false)

      Signifies that a test did not complete successfully. Must be called after testStart(java.lang.String) with the same name. Publishes the event `TestFailure` with `name`, `failure` and `isError` as the parameters.

      Parameters:
        `name` - a logical name for the test
        `failure` - a description of the failure
        `isError` - true if this failure was due to an indirect error, false if this failure was a direct assertion failure or incorrect assumption

    - #### void testStart(java.lang.String name)

      Signifies the start of an individual test, inside a parent "unit". Must be called after testCaseStart(java.lang.String) or after testEnd(java.lang.String). Publishes the event `TestStart` with `name` as the parameter.

      Parameters:
        `name` - a logical name for the test