Groovy Documentation

org.codehaus.groovy.grails.test.runner
[Groovy] Class GrailsProjectTestRunner

java.lang.Object
  org.codehaus.groovy.grails.cli.api.BaseSettingsApi
      org.codehaus.groovy.grails.test.runner.GrailsProjectTestRunner

class GrailsProjectTestRunner
extends BaseSettingsApi

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 TODO: Verify fitnesse, cucumber, guard, and clover plugins still work

Authors:
Graeme Rocher
Since:
2.3


Field Summary
static java.lang.String TEST_PHASE_AND_TYPE_SEPARATOR

static java.lang.String TEST_PHASE_WILDCARD

static java.lang.String TEST_TYPE_WILDCARD

 
Fields inherited from class BaseSettingsApi
appClassName, buildEventListener, buildProps, buildSettings, configSlurper, enableProfile, grailsAppName, grailsHome, isInteractive, metadata, metadataFile, pluginSettings, pluginsHome, resolver
 
Property Summary
groovy.util.AntBuilder ant

boolean createTestReports

java.io.File junitReportStyleDir

java.util.List phasesToRun

GrailsProjectPackager projectPackager

GrailsProjectTestCompiler projectTestCompiler

GrailsProjectWatcher projectWatcher

boolean reRunTests

java.util.List reportFormats

java.util.Map targetPhasesAndTypes

GrailsTestEventPublisher testEventPublisher

groovy.lang.Binding testExecutionContext

TestFeatureDiscoverySupport testFeatureDiscovery

java.util.List testNames

java.util.Map testOptions

java.io.File testReportsDir

java.io.File testSourceDir

java.util.Collection testTargetPatterns

boolean testsFailed

 
Constructor Summary
GrailsProjectTestRunner(GrailsProjectPackager projectPackager)

 
Method Summary
java.lang.Object getFailedTests()

void initialiseContext(groovy.lang.Binding context)

protected java.util.List 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 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)

 
Methods inherited from 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
 
Methods inherited from 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

TEST_PHASE_AND_TYPE_SEPARATOR

public static final java.lang.String TEST_PHASE_AND_TYPE_SEPARATOR


TEST_PHASE_WILDCARD

public static final java.lang.String TEST_PHASE_WILDCARD


TEST_TYPE_WILDCARD

public static final java.lang.String TEST_TYPE_WILDCARD


 
Property Detail

ant

groovy.util.AntBuilder ant


createTestReports

boolean createTestReports


junitReportStyleDir

java.io.File junitReportStyleDir


phasesToRun

java.util.List phasesToRun


projectPackager

GrailsProjectPackager projectPackager


projectTestCompiler

GrailsProjectTestCompiler projectTestCompiler


projectWatcher

GrailsProjectWatcher projectWatcher


reRunTests

boolean reRunTests


reportFormats

java.util.List reportFormats


targetPhasesAndTypes

java.util.Map targetPhasesAndTypes


testEventPublisher

GrailsTestEventPublisher testEventPublisher


testExecutionContext

groovy.lang.Binding testExecutionContext


testFeatureDiscovery

TestFeatureDiscoverySupport testFeatureDiscovery


testNames

java.util.List testNames


testOptions

java.util.Map testOptions


testReportsDir

java.io.File testReportsDir


testSourceDir

java.io.File testSourceDir


testTargetPatterns

java.util.Collection testTargetPatterns


testsFailed

boolean testsFailed


 
Constructor Detail

GrailsProjectTestRunner

GrailsProjectTestRunner(GrailsProjectPackager projectPackager)


 
Method Detail

getFailedTests

java.lang.Object getFailedTests()


initialiseContext

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


lookupTestPatterns

@groovy.transform.CompileStatic(TypeCheckingMode.SKIP)
protected java.util.List lookupTestPatterns()


processTests

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


runAllTests

@groovy.transform.CompileStatic
boolean runAllTests(java.util.Map 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


runAllTests

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


runTests

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


 

Groovy Documentation