Test (Gradle API 2.14)
Date: 2016-06-14

Package: org.gradle.api.tasks.testing

## [Java] Class Test

- org.gradle.api.tasks.testing.Test

- All Implemented Interfaces and Traits:
    JavaForkOptions, PatternFilterable, Reporting, VerificationTask

      @ParallelizableTask
      public class Test
      extends org.gradle.api.internal.ConventionTask

  Executes JUnit (3.8.x or 4.x) or TestNG tests. Test are always run in (one or more) separate JVMs. The sample below shows various configuration options.

       apply plugin: 'java' // adds 'test' task

       test {
         // enable TestNG support (default is JUnit)
         useTestNG()

         // set a system property for the test JVM(s)
         systemProperty 'some.prop', 'value'

         // explicitly include or exclude tests
         include 'org/foo/**'
         exclude 'org/boo/**'

         // show standard out and standard error of the test JVM(s) on the console
         testLogging.showStandardStreams = true

         // set heap size for the test JVM(s)
         minHeapSize = "128m"
         maxHeapSize = "512m"

         // set JVM arguments for the test JVM(s)
         jvmArgs '-XX:MaxPermSize=256m'

         // listen to events in the test execution lifecycle
         beforeTest { descriptor ->
            logger.lifecycle("Running test: " + descriptor)
         }

         // listen to standard out and standard error of the test JVM(s)
         onOutput { descriptor, event ->
            logger.lifecycle("Test: " + descriptor + " produced standard out/err: " + event.message )
         }
       }

  The test process can be started in debug mode (see getDebug()) in an ad-hoc manner by supplying the `--debug-jvm` switch when invoking the build.

       gradle someTestTask --debug-jvm

- - Inherited fields
    Fields inherited from class | Fields
    --- | ---
    `class org.gradle.api.internal.ConventionTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`
    `class DefaultTask` | `TASK_NAME, TASK_DESCRIPTION, TASK_GROUP, TASK_TYPE, TASK_DEPENDS_ON, TASK_OVERWRITE, TASK_ACTION`

  - ### Constructor Summary

    Constructors
    Constructor and description
    `Test ()`

  - ### Methods Summary

    Methods
    Type | Name and description
    --- | ---
    `void` | `addTestListener(TestListener listener)` Registers a test listener with this task.
    `void` | `addTestOutputListener(TestOutputListener listener)` Registers a output listener with this task.
    `void` | `afterSuite(groovy.lang.Closure closure)`
    `void` | `afterTest(groovy.lang.Closure closure)` Adds a closure to be notified after a test has executed.
    `void` | `beforeSuite(groovy.lang.Closure closure)`
    `void` | `beforeTest(groovy.lang.Closure closure)` Adds a closure to be notified before a test is executed.
    `Test` | `bootstrapClasspath(Object... classpath)` {@inheritDoc}
    `Test` | `copyTo(ProcessForkOptions target)` {@inheritDoc}
    `Test` | `copyTo(JavaForkOptions target)` {@inheritDoc}
    `Test` | `environment(Map<String, ?> environmentVariables)` {@inheritDoc}
    `Test` | `environment(String name, Object value)` {@inheritDoc}
    `Test` | `exclude(String... excludes)` Adds exclude patterns for the files in the test classes directory (e.g. '**F;*Test.class')).
    `Test` | `exclude(Iterable<String> excludes)` Adds exclude patterns for the files in the test classes directory (e.g. '**F;*Test.class')).
    `Test` | `exclude(Spec<FileTreeElement> excludeSpec)` {@inheritDoc}
    `Test` | `exclude(groovy.lang.Closure excludeSpec)` {@inheritDoc}
    `Test` | `executable(Object executable)` {@inheritDoc}
    `void` | `executeTests()`
    `void` | `filter(Action<TestFilter> action)` Executes the action against the getFilter().
    `protected org.gradle.internal.actor.ActorFactory` | `getActorFactory()`
    `List<String>` | `getAllJvmArgs()` {@inheritDoc}
    `File` | `getBinResultsDir()` Returns the root folder for the test results in internal binary format.
    `FileCollection` | `getBootstrapClasspath()` {@inheritDoc}
    `protected org.gradle.internal.operations.BuildOperationProcessor` | `getBuildOperationProcessor()`
    `FileTree` | `getCandidateClassFiles()` Returns the classes files to scan for test classes.
    `protected org.gradle.api.internal.initialization.loadercache.ClassLoaderCache` | `getClassLoaderCache()`
    `FileCollection` | `getClasspath()` Returns the classpath to use to execute the tests.
    `boolean` | `getDebug()` {@inheritDoc}
    `String` | `getDefaultCharacterEncoding()` {@inheritDoc}
    `boolean` | `getEnableAssertions()` {@inheritDoc}
    `Map<String, Object>` | `getEnvironment()` {@inheritDoc}
    `Set<String>` | `getExcludes()` Returns the exclude patterns for test execution.
    `String` | `getExecutable()` {@inheritDoc}
    `protected org.gradle.api.internal.file.FileResolver` | `getFileResolver()`
    `TestFilter` | `getFilter()` Allows filtering tests for execution.
    `long` | `getForkEvery()` Returns the maximum number of test classes to execute in a forked test process.
    `boolean` | `getIgnoreFailures()` {@inheritDoc}
    `Set<String>` | `getIncludes()` Returns the include patterns for test execution.
    `protected org.gradle.internal.reflect.Instantiator` | `getInstantiator()`
    `List<String>` | `getJvmArgs()` {@inheritDoc}
    `protected org.gradle.internal.event.ListenerManager` | `getListenerManager()`
    `String` | `getMaxHeapSize()` {@inheritDoc}
    `int` | `getMaxParallelForks()` Returns the maximum number of forked test processes to execute in parallel.
    `String` | `getMinHeapSize()` {@inheritDoc}
    `protected org.gradle.api.internal.classpath.ModuleRegistry` | `getModuleRegistry()`
    `TestFrameworkOptions` | `getOptions()` Returns test framework specific options.
    `protected org.gradle.process.internal.worker.WorkerProcessFactory` | `getProcessBuilderFactory()`
    `protected org.gradle.internal.logging.progress.ProgressLoggerFactory` | `getProgressLoggerFactory()`
    `TestTaskReports` | `getReports()` The reports that this task potentially produces.
    `Map<String, Object>` | `getSystemProperties()` {@inheritDoc}
    `File` | `getTestClassesDir()` Returns the root folder for the compiled test sources.
    `org.gradle.api.internal.tasks.testing.TestFramework` | `getTestFramework()`
    `TestLoggingContainer` | `getTestLogging()` Allows to set options related to which test events are logged to the console, and on which detail level.
    `List<File>` | `getTestSrcDirs()` Returns the directories containing the test source.
    `protected org.gradle.internal.logging.text.StyledTextOutputFactory` | `getTextOutputFactory()`
    `File` | `getWorkingDir()` {@inheritDoc}
    `Test` | `include(String... includes)` Adds include patterns for the files in the test classes directory (e.g. '**F;*Test.class')).
    `Test` | `include(Iterable<String> includes)` Adds include patterns for the files in the test classes directory (e.g. '**F;*Test.class')).
    `Test` | `include(Spec<FileTreeElement> includeSpec)` {@inheritDoc}
    `Test` | `include(groovy.lang.Closure includeSpec)` {@inheritDoc}
    `boolean` | `isScanForTestClasses()` Specifies whether test classes should be detected.
    `Test` | `jvmArgs(Iterable<?> arguments)` {@inheritDoc}
    `Test` | `jvmArgs(Object... arguments)` {@inheritDoc}
    `void` | `onOutput(groovy.lang.Closure closure)` Adds a closure to be notified when output from the test received.
    `TestFrameworkOptions` | `options(groovy.lang.Closure testFrameworkConfigure)` Configures test framework specific options.
    `void` | `removeTestListener(TestListener listener)` Unregisters a test listener with this task.
    `void` | `removeTestOutputListener(TestOutputListener listener)` Unregisters a test output listener with this task.
    `TestTaskReports` | `reports(groovy.lang.Closure closure)` Configures the reports that this task potentially produces.
    `void` | `setAllJvmArgs(Iterable<?> arguments)` {@inheritDoc}
    `void` | `setBinResultsDir(File binResultsDir)` Sets the root folder for the test results in internal binary format.
    `void` | `setBootstrapClasspath(FileCollection classpath)` {@inheritDoc}
    `void` | `setClasspath(FileCollection classpath)`
    `void` | `setDebug(boolean enabled)` {@inheritDoc}
    `void` | `setDefaultCharacterEncoding(String defaultCharacterEncoding)` {@inheritDoc}
    `void` | `setEnableAssertions(boolean enabled)` {@inheritDoc}
    `void` | `setEnvironment(Map<String, ?> environmentVariables)` {@inheritDoc}
    `Test` | `setExcludes(Iterable<String> excludes)` Sets the exclude patterns for test execution.
    `void` | `setExecutable(Object executable)` {@inheritDoc}
    `void` | `setForkEvery(Long forkEvery)` Sets the maximum number of test classes to execute in a forked test process.
    `void` | `setIgnoreFailures(boolean ignoreFailures)` {@inheritDoc}
    `Test` | `setIncludes(Iterable<String> includes)` Sets the include patterns for test execution.
    `void` | `setJvmArgs(Iterable<?> arguments)` {@inheritDoc}
    `void` | `setMaxHeapSize(String heapSize)` {@inheritDoc}
    `void` | `setMaxParallelForks(int maxParallelForks)` Sets the maximum number of forked test processes to execute in parallel.
    `void` | `setMinHeapSize(String heapSize)` {@inheritDoc}
    `void` | `setScanForTestClasses(boolean scanForTestClasses)`
    `void` | `setSystemProperties(Map<String, ?> properties)` {@inheritDoc}
    `void` | `setTestClassesDir(File testClassesDir)` Sets the root folder for the compiled test sources.
    `Test` | `setTestNameIncludePatterns(List<String> testNamePattern)` Sets the test name patterns to be included in execution.
    `void` | `setTestSrcDirs(List<File> testSrcDir)`
    `void` | `setWorkingDir(Object dir)` {@inheritDoc}
    `Test` | `systemProperties(Map<String, ?> properties)` {@inheritDoc}
    `Test` | `systemProperty(String name, Object value)` {@inheritDoc}
    `org.gradle.api.internal.tasks.testing.TestFramework` | `testFramework(groovy.lang.Closure testFrameworkConfigure)`
    `void` | `testLogging(groovy.lang.Closure closure)` Allows configuring the logging of the test execution, for example log eagerly the standard output, etc.
    `void` | `useJUnit()` Specifies that JUnit should be used to execute the tests.
    `void` | `useJUnit(groovy.lang.Closure testFrameworkConfigure)` Specifies that JUnit should be used to execute the tests, configuring JUnit specific options.
    `void` | `useTestNG()` Specifies that TestNG should be used to execute the tests.
    `void` | `useTestNG(groovy.lang.Closure testFrameworkConfigure)` Specifies that TestNG should be used to execute the tests, configuring TestNG specific options.
    `Test` | `workingDir(Object dir)` {@inheritDoc}

  - ### Inherited Methods Summary

    Inherited Methods
    Methods inherited from class | Name
    --- | ---
    `class org.gradle.api.internal.ConventionTask` | `org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, groovy.lang.Closure), org.gradle.api.internal.ConventionTask#conventionMapping(java.lang.String, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#getConventionMapping(), org.gradle.api.internal.ConventionTask#setProperty(java.lang.String, java.lang.Object), org.gradle.api.internal.ConventionTask#toString(), org.gradle.api.internal.ConventionTask#compareTo(org.gradle.api.Task), org.gradle.api.internal.ConventionTask#compareTo(java.lang.Object), org.gradle.api.internal.ConventionTask#getName(), org.gradle.api.internal.ConventionTask#getActions(), org.gradle.api.internal.ConventionTask#setName(java.lang.String), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getState(), org.gradle.api.internal.ConventionTask#getPath(), org.gradle.api.internal.ConventionTask#getExtensions(), org.gradle.api.internal.ConventionTask#getLogger(), org.gradle.api.internal.ConventionTask#execute(), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#configure(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#getDescription(), org.gradle.api.internal.ConventionTask#leftShift(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#property(java.lang.String), org.gradle.api.internal.ConventionTask#isEnabled(), org.gradle.api.internal.ConventionTask#setEnabled(boolean), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#getLogging(), org.gradle.api.internal.ConventionTask#hasProperty(java.lang.String), org.gradle.api.internal.ConventionTask#setDescription(java.lang.String), org.gradle.api.internal.ConventionTask#getGroup(), org.gradle.api.internal.ConventionTask#setGroup(java.lang.String), org.gradle.api.internal.ConventionTask#dependsOnTaskDidWork(), org.gradle.api.internal.ConventionTask#getInputs(), org.gradle.api.internal.ConventionTask#getTemporaryDir(), org.gradle.api.internal.ConventionTask#mustRunAfter([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setMustRunAfter(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getMustRunAfter(), org.gradle.api.internal.ConventionTask#finalizedBy([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setFinalizedBy(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getFinalizedBy(), org.gradle.api.internal.ConventionTask#shouldRunAfter([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setShouldRunAfter(java.lang.Iterable), org.gradle.api.internal.ConventionTask#getShouldRunAfter(), org.gradle.api.internal.ConventionTask#onlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#onlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setOnlyIf(org.gradle.api.specs.Spec), org.gradle.api.internal.ConventionTask#setOnlyIf(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#setDidWork(boolean), org.gradle.api.internal.ConventionTask#getDidWork(), org.gradle.api.internal.ConventionTask#doFirst(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doFirst(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#doLast(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#doLast(groovy.lang.Closure), org.gradle.api.internal.ConventionTask#deleteAllActions(), org.gradle.api.internal.ConventionTask#getEnabled(), org.gradle.api.internal.ConventionTask#getAnt(), org.gradle.api.internal.ConventionTask#getConvention(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getTaskDependencies(), org.gradle.api.internal.ConventionTask#getDependsOn(), org.gradle.api.internal.ConventionTask#setDependsOn(java.lang.Iterable), org.gradle.api.internal.ConventionTask#dependsOn([Ljava.lang.Object;), org.gradle.api.internal.ConventionTask#setActions(java.util.List), org.gradle.api.internal.ConventionTask#getProject(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getOutputs(), org.gradle.api.internal.ConventionTask#getStandardOutputCapture(), org.gradle.api.internal.ConventionTask#getAsDynamicObject(), org.gradle.api.internal.ConventionTask#setProject(org.gradle.api.Project), org.gradle.api.internal.ConventionTask#prependParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#injectIntoNewInstance(org.gradle.api.internal.project.ProjectInternal, java.lang.String, java.lang.Class, java.util.concurrent.Callable), org.gradle.api.internal.ConventionTask#appendParallelSafeAction(org.gradle.api.Action), org.gradle.api.internal.ConventionTask#isHasCustomActions(), org.gradle.api.internal.ConventionTask#getOnlyIf(), org.gradle.api.internal.ConventionTask#getImpliesSubProjects(), org.gradle.api.internal.ConventionTask#setImpliesSubProjects(boolean), org.gradle.api.internal.ConventionTask#getExecuter(), org.gradle.api.internal.ConventionTask#setExecuter(org.gradle.api.internal.tasks.TaskExecuter), org.gradle.api.internal.ConventionTask#getTemporaryDirFactory(), org.gradle.api.internal.ConventionTask#addValidator(org.gradle.api.internal.tasks.execution.TaskValidator), org.gradle.api.internal.ConventionTask#getValidators(), org.gradle.api.internal.ConventionTask#getTaskActions(), org.gradle.api.internal.ConventionTask#wait(long, int), org.gradle.api.internal.ConventionTask#wait(long), org.gradle.api.internal.ConventionTask#wait(), org.gradle.api.internal.ConventionTask#equals(java.lang.Object), org.gradle.api.internal.ConventionTask#hashCode(), org.gradle.api.internal.ConventionTask#getClass(), org.gradle.api.internal.ConventionTask#notify(), org.gradle.api.internal.ConventionTask#notifyAll()`
    `class DefaultTask` | `setProperty, toString, compareTo, compareTo, getName, getActions, setName, getState, getState, getPath, getExtensions, getLogger, execute, configure, configure, getDescription, leftShift, property, isEnabled, setEnabled, getLogging, getLogging, hasProperty, setDescription, getGroup, setGroup, dependsOnTaskDidWork, getInputs, getTemporaryDir, mustRunAfter, setMustRunAfter, getMustRunAfter, finalizedBy, setFinalizedBy, getFinalizedBy, shouldRunAfter, setShouldRunAfter, getShouldRunAfter, onlyIf, onlyIf, setOnlyIf, setOnlyIf, setDidWork, getDidWork, doFirst, doFirst, doLast, doLast, deleteAllActions, getEnabled, getAnt, getConvention, getTaskDependencies, getTaskDependencies, getDependsOn, setDependsOn, dependsOn, setActions, getProject, getOutputs, getOutputs, getStandardOutputCapture, getAsDynamicObject, setProject, prependParallelSafeAction, injectIntoNewInstance, appendParallelSafeAction, isHasCustomActions, getOnlyIf, getImpliesSubProjects, setImpliesSubProjects, getExecuter, setExecuter, getTemporaryDirFactory, addValidator, getValidators, getTaskActions, wait, wait, wait, equals, hashCode, getClass, notify, notifyAll`

- - ### Constructor Detail

    - #### public Test()

  - ### Method Detail

    - #### public void addTestListener(TestListener listener)

      Registers a test listener with this task. Consider also the following handy methods for quicker hooking into test execution: beforeTest(groovy.lang.Closure), afterTest(groovy.lang.Closure), beforeSuite(groovy.lang.Closure), afterSuite(groovy.lang.Closure)

      This listener will NOT be notified of tests executed by other tasks. To get that behavior, use Gradle.addListener.

      Parameters:
        `listener` - The listener to add.

    - #### public void addTestOutputListener(TestOutputListener listener)

      Registers a output listener with this task. Quicker way of hooking into output events is using the onOutput(groovy.lang.Closure) method.

      Parameters:
        `listener` - The listener to add.

    - #### public void afterSuite(groovy.lang.Closure closure)

      Adds a closure to be notified after a test suite has executed. A TestDescriptor and TestResult instance are passed to the closure as a parameter.

      This method is also called after all test suites are executed. The provided descriptor will have a null parent suite.

      Parameters:
        `closure` - The closure to call.

    - #### public void afterTest(groovy.lang.Closure closure)

      Adds a closure to be notified after a test has executed. A TestDescriptor and TestResult instance are passed to the closure as a parameter.

      Parameters:
        `closure` - The closure to call.

    - #### public void beforeSuite(groovy.lang.Closure closure)

      Adds a closure to be notified before a test suite is executed. A TestDescriptor instance is passed to the closure as a parameter.

      This method is also called before any test suites are executed. The provided descriptor will have a null parent suite.

      Parameters:
        `closure` - The closure to call.

    - #### public void beforeTest(groovy.lang.Closure closure)

      Adds a closure to be notified before a test is executed. A TestDescriptor instance is passed to the closure as a parameter.

      Parameters:
        `closure` - The closure to call.

    - #### @Override public Test bootstrapClasspath(Object... classpath)

      {@inheritDoc}

    - #### @Override public Test copyTo(ProcessForkOptions target)

      {@inheritDoc}

    - #### @Override public Test copyTo(JavaForkOptions target)

      {@inheritDoc}

    - #### @Override public Test environment(Map<String, ?> environmentVariables)

      {@inheritDoc}

    - #### @Override public Test environment(String name, Object value)

      {@inheritDoc}

    - #### @Override public Test exclude(String... excludes)

      Adds exclude patterns for the files in the test classes directory (e.g. '**F;*Test.class')).

      See Also:
        setExcludes(Iterable)

    - #### @Override public Test exclude(Iterable<String> excludes)

      Adds exclude patterns for the files in the test classes directory (e.g. '**F;*Test.class')).

      See Also:
        setExcludes(Iterable)

    - #### @Override public Test exclude(Spec<FileTreeElement> excludeSpec)

      {@inheritDoc}

    - #### @Override public Test exclude(groovy.lang.Closure excludeSpec)

      {@inheritDoc}

    - #### @Override public Test executable(Object executable)

      {@inheritDoc}

    - #### @TaskAction public void executeTests()

    - #### @Incubating public void filter(Action<TestFilter> action)

      Executes the action against the getFilter().

      Parameters:
        `action` - configuration of the test filter
      Since:
        1.10

    - #### @javax.inject.Inject protected org.gradle.internal.actor.ActorFactory getActorFactory()

    - #### @Override public List<String> getAllJvmArgs()

      {@inheritDoc}

    - #### @OutputDirectory @Incubating public File getBinResultsDir()

      Returns the root folder for the test results in internal binary format.

      Returns:
        the test result directory, containing the test results in binary format.

    - #### @Override @Input public FileCollection getBootstrapClasspath()

      {@inheritDoc}

    - #### @javax.inject.Inject protected org.gradle.internal.operations.BuildOperationProcessor getBuildOperationProcessor()

    - #### public FileTree getCandidateClassFiles()

      Returns the classes files to scan for test classes.

      Returns:
        The candidate class files.

    - #### @javax.inject.Inject protected org.gradle.api.internal.initialization.loadercache.ClassLoaderCache getClassLoaderCache()

    - #### @InputFiles public FileCollection getClasspath()

      Returns the classpath to use to execute the tests.

    - #### @Override public boolean getDebug()

      {@inheritDoc}

    - #### @Override public String getDefaultCharacterEncoding()

      {@inheritDoc}

    - #### @Override @Input public boolean getEnableAssertions()

      {@inheritDoc}

    - #### @Override public Map<String, Object> getEnvironment()

      {@inheritDoc}

    - #### @Override public Set<String> getExcludes()

      Returns the exclude patterns for test execution.

      See Also:
        exclude(String...)

    - #### @Override @Input public String getExecutable()

      {@inheritDoc}

    - #### @javax.inject.Inject protected org.gradle.api.internal.file.FileResolver getFileResolver()

    - #### @Incubating @Nested public TestFilter getFilter()

      Allows filtering tests for execution.

      Returns:
        filter object
      Since:
        1.10

    - #### public long getForkEvery()

      Returns the maximum number of test classes to execute in a forked test process. The forked test process will be restarted when this limit is reached. The default value is 0 (no maximum).

      Returns:
        The maximum number of test classes. Returns 0 when there is no maximum.

    - #### @Override @Input public boolean getIgnoreFailures()

      {@inheritDoc}

    - #### @Override public Set<String> getIncludes()

      Returns the include patterns for test execution.

      See Also:
        include(String...)

    - #### @javax.inject.Inject protected org.gradle.internal.reflect.Instantiator getInstantiator()

    - #### @Override @Input public List<String> getJvmArgs()

      {@inheritDoc}

    - #### @javax.inject.Inject protected org.gradle.internal.event.ListenerManager getListenerManager()

    - #### @Override public String getMaxHeapSize()

      {@inheritDoc}

    - #### public int getMaxParallelForks()

      Returns the maximum number of forked test processes to execute in parallel. The default value is 1 (no parallel test execution).

      Returns:
        The maximum number of forked test processes.

    - #### @Override public String getMinHeapSize()

      {@inheritDoc}

    - #### @javax.inject.Inject protected org.gradle.api.internal.classpath.ModuleRegistry getModuleRegistry()

    - #### @Nested public TestFrameworkOptions getOptions()

      Returns test framework specific options. Make sure to call useJUnit() or useTestNG() before using this method.

      Returns:
        The test framework options.

    - #### @javax.inject.Inject protected org.gradle.process.internal.worker.WorkerProcessFactory getProcessBuilderFactory()

    - #### @javax.inject.Inject protected org.gradle.internal.logging.progress.ProgressLoggerFactory getProgressLoggerFactory()

    - #### @Override public TestTaskReports getReports()

      The reports that this task potentially produces.

      Returns:
        The reports that this task potentially produces

    - #### @Override @Input public Map<String, Object> getSystemProperties()

      {@inheritDoc}

    - #### public File getTestClassesDir()

      Returns the root folder for the compiled test sources.

      Returns:
        All test class directories to be used.

    - #### public org.gradle.api.internal.tasks.testing.TestFramework getTestFramework()

    - #### public TestLoggingContainer getTestLogging()

      Allows to set options related to which test events are logged to the console, and on which detail level. For example, to show more information about exceptions use:

           apply plugin: 'java'

           test.testLogging { exceptionFormat "full" }

      For further information see TestLoggingContainer.
      Returns:
        this

    - #### @InputFiles @Deprecated public List<File> getTestSrcDirs()

      Returns the directories containing the test source.

      deprecated:
        Support for TestNG Javadoc annotations will be removed in Gradle 3.0

    - #### @javax.inject.Inject protected org.gradle.internal.logging.text.StyledTextOutputFactory getTextOutputFactory()

    - #### @Override @Input public File getWorkingDir()

      {@inheritDoc}

    - #### @Override public Test include(String... includes)

      Adds include patterns for the files in the test classes directory (e.g. '**F;*Test.class')).

      See Also:
        setIncludes(Iterable)

    - #### @Override public Test include(Iterable<String> includes)

      Adds include patterns for the files in the test classes directory (e.g. '**F;*Test.class')).

      See Also:
        setIncludes(Iterable)

    - #### @Override public Test include(Spec<FileTreeElement> includeSpec)

      {@inheritDoc}

    - #### @Override public Test include(groovy.lang.Closure includeSpec)

      {@inheritDoc}

    - #### @Input public boolean isScanForTestClasses()

      Specifies whether test classes should be detected. When `true` the classes which match the include and exclude patterns are scanned for test classes, and any found are executed. When `false` the classes which match the include and exclude patterns are executed.

    - #### @Override public Test jvmArgs(Iterable<?> arguments)

      {@inheritDoc}

    - #### @Override public Test jvmArgs(Object... arguments)

      {@inheritDoc}

    - #### public void onOutput(groovy.lang.Closure closure)

      Adds a closure to be notified when output from the test received. A TestDescriptor and TestOutputEvent instance are passed to the closure as a parameter.

           apply plugin: 'java'

           test { onOutput { descriptor, event -> if (event.destination == TestOutputEvent.Destination.StdErr) { logger.error("Test: " + descriptor + ", error: " + event.message) } } }

      Parameters:
        `closure` - The closure to call.

    - #### public TestFrameworkOptions options(groovy.lang.Closure testFrameworkConfigure)

      Configures test framework specific options. Make sure to call useJUnit() or useTestNG() before using this method.

      Returns:
        The test framework options.

    - #### public void removeTestListener(TestListener listener)

      Unregisters a test listener with this task. This method will only remove listeners that were added by calling addTestListener(org.gradle.api.tasks.testing.TestListener) on this task. If the listener was registered with Gradle using Gradle.addListener this method will not do anything. Instead, use Gradle.removeListener.

      Parameters:
        `listener` - The listener to remove.

    - #### public void removeTestOutputListener(TestOutputListener listener)

      Unregisters a test output listener with this task. This method will only remove listeners that were added by calling addTestOutputListener(org.gradle.api.tasks.testing.TestOutputListener) on this task. If the listener was registered with Gradle using Gradle.addListener this method will not do anything. Instead, use Gradle.removeListener.

      Parameters:
        `listener` - The listener to remove.

    - #### @Override public TestTaskReports reports(groovy.lang.Closure closure)

      Configures the reports that this task potentially produces.

      Parameters:
        `closure` - The configuration
      Returns:
        The reports that this task potentially produces

    - #### @Override public void setAllJvmArgs(Iterable<?> arguments)

      {@inheritDoc}

    - #### @Incubating public void setBinResultsDir(File binResultsDir)

      Sets the root folder for the test results in internal binary format.

      Parameters:
        `binResultsDir` - The root folder

    - #### @Override public void setBootstrapClasspath(FileCollection classpath)

      {@inheritDoc}

    - #### public void setClasspath(FileCollection classpath)

    - #### @Override @org.gradle.api.internal.tasks.options.Option(option = "debug-jvm", description = "Enable debugging for the test process. The process is started suspended and listening on port 5005. [INCUBATING]") public void setDebug(boolean enabled)

      {@inheritDoc}

    - #### @Override public void setDefaultCharacterEncoding(String defaultCharacterEncoding)

      {@inheritDoc}

    - #### @Override public void setEnableAssertions(boolean enabled)

      {@inheritDoc}

    - #### @Override public void setEnvironment(Map<String, ?> environmentVariables)

      {@inheritDoc}

    - #### @Override public Test setExcludes(Iterable<String> excludes)

      Sets the exclude patterns for test execution.

      Parameters:
        `excludes` - The patterns list
      See Also:
        exclude(String...)

    - #### @Override public void setExecutable(Object executable)

      {@inheritDoc}

    - #### public void setForkEvery(Long forkEvery)

      Sets the maximum number of test classes to execute in a forked test process. Use null or 0 to use no maximum.

      Parameters:
        `forkEvery` - The maximum number of test classes. Use null or 0 to specify no maximum.

    - #### @Override public void setIgnoreFailures(boolean ignoreFailures)

      {@inheritDoc}

    - #### @Override public Test setIncludes(Iterable<String> includes)

      Sets the include patterns for test execution.

      Parameters:
        `includes` - The patterns list
      See Also:
        include(String...)

    - #### @Override public void setJvmArgs(Iterable<?> arguments)

      {@inheritDoc}

    - #### @Override public void setMaxHeapSize(String heapSize)

      {@inheritDoc}

    - #### public void setMaxParallelForks(int maxParallelForks)

      Sets the maximum number of forked test processes to execute in parallel. Set to 1 to disable parallel test execution.

      Parameters:
        `maxParallelForks` - The maximum number of forked test processes.

    - #### @Override public void setMinHeapSize(String heapSize)

      {@inheritDoc}

    - #### public void setScanForTestClasses(boolean scanForTestClasses)

    - #### @Override public void setSystemProperties(Map<String, ?> properties)

      {@inheritDoc}

    - #### public void setTestClassesDir(File testClassesDir)

      Sets the root folder for the compiled test sources.

      Parameters:
        `testClassesDir` - The root folder

    - #### @org.gradle.api.internal.tasks.options.Option(option = "tests", description = "Sets test class or method name to be included, '*' is supported.") @Incubating public Test setTestNameIncludePatterns(List<String> testNamePattern)

      Sets the test name patterns to be included in execution. Classes or method names are supported, wildcard '*' is supported. For more information see the user guide chapter on testing. For more information on supported patterns see TestFilter

    - #### @Deprecated public void setTestSrcDirs(List<File> testSrcDir)

    - #### @Override public void setWorkingDir(Object dir)

      {@inheritDoc}

    - #### @Override public Test systemProperties(Map<String, ?> properties)

      {@inheritDoc}

    - #### @Override public Test systemProperty(String name, Object value)

      {@inheritDoc}

    - #### public org.gradle.api.internal.tasks.testing.TestFramework testFramework(groovy.lang.Closure testFrameworkConfigure)

    - #### public void testLogging(groovy.lang.Closure closure)

      Allows configuring the logging of the test execution, for example log eagerly the standard output, etc.

           apply plugin: 'java'

           //makes the standard streams (err and out) visible at console when running tests test.testLogging { showStandardStreams = true }

      Parameters:
        `closure` - configure closure

    - #### public void useJUnit()

      Specifies that JUnit should be used to execute the tests.

      To configure JUnit specific options, see useJUnit(groovy.lang.Closure).

    - #### public void useJUnit(groovy.lang.Closure testFrameworkConfigure)

      Specifies that JUnit should be used to execute the tests, configuring JUnit specific options.

      The supplied closure configures an instance of JUnitOptions, which can be used to configure how JUnit runs.

      Parameters:
        `testFrameworkConfigure` - A closure used to configure the JUnit options.

    - #### public void useTestNG()

      Specifies that TestNG should be used to execute the tests.

      To configure TestNG specific options, see useTestNG(Closure).

    - #### public void useTestNG(groovy.lang.Closure testFrameworkConfigure)

      Specifies that TestNG should be used to execute the tests, configuring TestNG specific options.

      The supplied closure configures an instance of TestNGOptions, which can be used to configure how TestNG runs.

      Parameters:
        `testFrameworkConfigure` - A closure used to configure the TestNG options.

    - #### @Override public Test workingDir(Object dir)

      {@inheritDoc}