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

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

## [Groovy] Class GrailsProjectTestRunner

- org.codehaus.groovy.grails.test.runner.GrailsProjectTestRunner

- The default test runner that runs Grails tests. By default configured to run only unit tests. To run other kinds of tests (functional, integration etc.) additional TestPhaseConfigurer instances need to be registered with the #testFeatureDiscovery property

  Authors:
    Graeme Rocher
  Since:
    2.3

- - ### Field Summary

    Fields
    Modifiers | Name | Description
    --- | --- | ---
    `static java.lang.String` | `TEST_PHASE_AND_TYPE_SEPARATOR` |
    `static java.lang.String` | `TEST_PHASE_WILDCARD` |
    `static java.lang.String` | `TEST_TYPE_WILDCARD` |

  - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class BaseSettingsApi` | `appClassName, buildEventListener, buildProps, buildSettings, configSlurper, enableProfile, grailsAppName, grailsHome, isInteractive, metadata, metadataFile, pluginSettings, pluginsHome, resolver`

  - ### Properties Summary

    Properties
    Type | Name and description
    --- | ---
    `groovy.util.AntBuilder` | `ant`
    `boolean` | `createTestReports`
    `java.io.File` | `junitReportStyleDir`
    `java.util.List<java.lang.String>` | `phasesToRun`
    `GrailsProjectPackager` | `projectPackager`
    `GrailsProjectTestCompiler` | `projectTestCompiler`
    `GrailsProjectWatcher` | `projectWatcher`
    `boolean` | `reRunTests`
    `java.util.List<java.lang.String>` | `reportFormats`
    `java.util.Map<java.lang.String, java.util.List<java.lang.String>>` | `targetPhasesAndTypes`
    `GrailsTestEventPublisher` | `testEventPublisher`
    `groovy.lang.Binding` | `testExecutionContext`
    `TestFeatureDiscoverySupport` | `testFeatureDiscovery`
    `java.util.List<java.lang.String>` | `testNames`
    `java.util.Map` | `testOptions`
    `java.io.File` | `testReportsDir`
    `java.io.File` | `testSourceDir`
    `java.util.Collection<GrailsTestTargetPattern>` | `testTargetPatterns`
    `boolean` | `testsFailed`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `GrailsProjectTestRunner (GrailsProjectPackager projectPackager)`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `java.lang.Object` | `getFailedTests()`
    `void` | `initialiseContext(groovy.lang.Binding context)`
    `protected java.util.List<java.lang.String>` | `lookupTestPatterns()`
    `void` | `processTests(GrailsTestType type)` Compiles and runs all the tests of the given type and then generates the reports for them.
    `boolean` | `runAllTests(java.util.Map<java.lang.String, java.lang.String> argsMap, boolean triggerEvents = true)` Run all tests in a Grails application
    `boolean` | `runAllTests(boolean triggerEvents = true)` Run all tests in a Grails application
    `void` | `runTests(GrailsTestType type, java.io.File compiledClassesDir)`

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class BaseSettingsApi` | `confirmInput, confirmInput, copyGrailsResource, copyGrailsResource, copyGrailsResources, copyGrailsResources, createXmlSlurper, enableUaa, exit, getAppClassName, getAppGrailsVersion, getBuildEventListener, getBuildProps, getBuildSettings, getConfigSlurper, getGrailsAppName, getGrailsAppVersion, getGrailsHome, getIsInteractive, getMetadata, getMetadataFile, getPluginBuildSettings, getPluginSettings, getPluginsHome, getPropertyValue, getResolver, getServerHost, getServerPort, getServerPortHttps, getServletVersion, grailsResource, isDeclared, isEnableProfile, logError, logErrorAndExit, makeApiAvailableToScripts, makeRelative, makeRelative, profile, readAllPluginXmlMetadata, readPluginXmlMetadata, resolveResources, updateMetadata, updateMetadata`
    `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

    - #### public static final java.lang.String TEST_PHASE_AND_TYPE_SEPARATOR

    - #### public static final java.lang.String TEST_PHASE_WILDCARD

    - #### public static final java.lang.String TEST_TYPE_WILDCARD

  - ### Property Detail

    - #### groovy.util.AntBuilder ant

    - #### boolean createTestReports

    - #### java.io.File junitReportStyleDir

    - #### java.util.List<java.lang.String> phasesToRun

    - #### GrailsProjectPackager projectPackager

    - #### GrailsProjectTestCompiler projectTestCompiler

    - #### GrailsProjectWatcher projectWatcher

    - #### boolean reRunTests

    - #### java.util.List<java.lang.String> reportFormats

    - #### java.util.Map<java.lang.String, java.util.List<java.lang.String>> targetPhasesAndTypes

    - #### GrailsTestEventPublisher testEventPublisher

    - #### groovy.lang.Binding testExecutionContext

    - #### TestFeatureDiscoverySupport testFeatureDiscovery

    - #### java.util.List<java.lang.String> testNames

    - #### java.util.Map testOptions

    - #### java.io.File testReportsDir

    - #### java.io.File testSourceDir

    - #### java.util.Collection<GrailsTestTargetPattern> testTargetPatterns

    - #### boolean testsFailed

  - ### Constructor Detail

    - #### GrailsProjectTestRunner(GrailsProjectPackager projectPackager)

  - ### Method Detail

    - #### java.lang.Object getFailedTests()

    - #### @groovy.transform.CompileStatic void initialiseContext(groovy.lang.Binding context)

    - #### @groovy.transform.CompileStatic(TypeCheckingMode.SKIP) protected java.util.List<java.lang.String> lookupTestPatterns()

    - #### @groovy.transform.CompileStatic void processTests(GrailsTestType type)

      Compiles and runs all the tests of the given type and then generates the reports for them.

      Parameters:
        `type` - The type of the tests to compile (not the test phase!) For example, "unit", "jsunit", "webtest", etc.

    - #### @groovy.transform.CompileStatic boolean runAllTests(java.util.Map<java.lang.String, java.lang.String> argsMap, boolean triggerEvents = true)

      Run all tests in a Grails application

      Parameters:
        `argsMap` - test run parameters
        `triggerEvents` - Whether to trigger events on start and finish of the test run (optional)
      Returns:
        true if the tests passed

    - #### boolean runAllTests(boolean triggerEvents = true)

      Run all tests in a Grails application

      Parameters:
        `triggerEvents` - Whether to trigger events on start and finish of the test run (optional)
      Returns:
        true if the tests passed

    - #### @groovy.transform.CompileStatic void runTests(GrailsTestType type, java.io.File compiledClassesDir)