Package org.gradle.api.tasks.testing

# Class Test

java.lang.Object
org.gradle.api.internal.AbstractTask
org.gradle.api.DefaultTask
org.gradle.api.internal.ConventionTask
org.gradle.api.tasks.testing.AbstractTestTask
org.gradle.api.tasks.testing.Test

All Implemented Interfaces:
  `Comparable<Task>`, `org.gradle.api.internal.DynamicObjectAware`, `org.gradle.api.internal.IConventionAware`, `org.gradle.api.internal.TaskInternal`, `Named`, `ExtensionAware`, `Reporting<TestTaskReports>`, `Task`, `PatternFilterable`, `VerificationTask`, `JavaForkOptions`, `ProcessForkOptions`, `Configurable<Task>`

@NullMarked @CacheableTask public abstract class Test extends AbstractTestTask implements JavaForkOptions, PatternFilterable
Executes JUnit (3.8.x, 4.x or 5.x) or TestNG tests. Test are always run in (one or more) separate JVMs.

The sample below shows various configuration options.

     plugins {
         id("java-library") // adds 'test' task
     }

     test {
       // discover and execute JUnit4-based tests
       useJUnit()

       // discover and execute TestNG-based tests
       useTestNG()

       // discover and execute JUnit Platform-based tests
       useJUnitPlatform()

       // 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
       addTestListener(new TestListener() {
          void beforeTest(TestDescriptor descriptor) {
              logger.lifecycle("Running test: " + descriptor)
          }
       })

       // fail the 'test' task on the first test failure
       failFast = true

       // skip an actual test execution
       dryRun = true

       // listen to standard out and standard error of the test JVM(s)
       addTestOutputListener { 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

- ## Nested Class Summary

  Nested Classes
  Modifier and Type
  Class
  Description
  `(package private) static class`
  `Test.ForkEveryAdapter`
  `(package private) static class`
  `Test.MaxParallelForks`
  `(package private) static class`
  `Test.TestFrameworkAdapter`

  ## Nested classes/interfaces inherited from interface org.gradle.api.Named

  `Named.Namer`

- ## Field Summary

  ### Fields inherited from interface org.gradle.api.Task

  `TASK_ACTION, TASK_CONSTRUCTOR_ARGS, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

- ## Constructor Summary

  Constructors
  Constructor
  Description
  `Test()`

- ## Method Summary

  Modifier and Type
  Method
  Description
  `Test`
  `bootstrapClasspath(@Nullable Object... classpath)`
  Adds the given values to the end of the bootstrap classpath for the process.
  `Test`
  `copyTo(JavaForkOptions target)`
  Copies these options to the given options.
  `Test`
  `copyTo(ProcessForkOptions target)`
  Copies these options to the given target options.
  `protected org.gradle.api.internal.tasks.testing.TestExecuter<org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec>`
  `createTestExecuter()`
  Creates test executer.
  `protected org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec`
  `createTestExecutionSpec()`
  Creates test execution specification.
  `void`
  `debugOptions(Action<JavaDebugOptions> action)`
  Configures Java Debug Wire Protocol properties for the process.
  `Test`
  `environment(String name, Object value)`
  Adds an environment variable to the environment for this process.
  `Test`
  `environment(Map<String,?> environmentVariables)`
  Adds some environment variables to the environment for this process.
  `Test`
  `exclude(Closure excludeSpec)`
  Adds an exclude spec.
  `Test`
  `exclude(Iterable<String> excludes)`
  Adds exclude patterns for the files in the test classes directory (e.g.
  `Test`
  `exclude(String... excludes)`
  Adds exclude patterns for the files in the test classes directory (e.g.
  `Test`
  `exclude(Spec<FileTreeElement> excludeSpec)`
  Adds an exclude spec.
  `Test`
  `executable(Object executable)`
  Sets the name of the executable to use.
  `void`
  `executeTests()`
  `void`
  `filter(Action<TestFilter> action)`
  Executes the action against the `AbstractTestTask.getFilter()`.
  `protected abstract org.gradle.internal.actor.ActorFactory`
  `getActorFactory()`
  `Provider<List<String>>`
  `getAllJvmArgs()`
  Returns the full set of arguments to use to launch the JVM for the process.
  `ConfigurableFileCollection`
  `getBootstrapClasspath()`
  Returns the bootstrap classpath to use for the process.
  `FileTree`
  `getCandidateClassFiles()`
  Returns the classes files to scan for test classes.
  `abstract ConfigurableFileCollection`
  `getClasspath()`
  Returns the classpath to use to execute the tests.
  `Property<Boolean>`
  `getDebug()`
  Determines whether debugging is enabled for the test process.
  `JavaDebugOptions`
  `getDebugOptions()`
  Returns the Java Debug Wire Protocol properties for the process.
  `Property<String>`
  `getDefaultCharacterEncoding()`
  Returns the default character encoding to use.
  `abstract Property<Boolean>`
  `getDryRun()`
  Indicates if this task will skip individual test execution.
  `Property<Boolean>`
  `getEnableAssertions()`
  A flag that marks if assertions are enabled for the process.
  `MapProperty<String,Object>`
  `getEnvironment()`
  The environment variables to use for the process.
  `Set<String>`
  `getExcludes()`
  Returns the exclude patterns for test execution.
  `Property<String>`
  `getExecutable()`
  Returns the name of the executable to use.
  `boolean`
  `getFailFast()`
  Indicates if this task will fail on the first failed test
  `abstract Property<Long>`
  `getForkEvery()`
  Returns the maximum number of test classes to execute in a forked test process.
  `protected abstract org.gradle.process.internal.JavaForkOptionsFactory`
  `getForkOptionsFactory()`
  `Set<String>`
  `getIncludes()`
  Returns the include patterns for test execution.
  `Property<Boolean>`
  `getIsScanForTestClasses()`
  Added for Kotlin source compatibility.
  `abstract Property<JavaLauncher>`
  `getJavaLauncher()`
  Configures the java executable to be used to run the tests.
  `protected abstract org.gradle.internal.jvm.JavaModuleDetector`
  `getJavaModuleDetector()`
  `protected abstract JavaToolchainService`
  `getJavaToolchainService()`
  `Provider<JavaVersion>`
  `getJavaVersion()`
  Returns the version of Java used to run the tests based on the `JavaLauncher` specified by `getJavaLauncher()`, or the executable specified by `getExecutable()` if the `JavaLauncher` is not present.
  `ListProperty<String>`
  `getJvmArgs()`
  The extra arguments to use to launch the JVM for the process.
  `ListProperty<CommandLineArgumentProvider>`
  `getJvmArgumentProviders()`
  Command line argument providers for the java process to fork.
  `Property<String>`
  `getMaxHeapSize()`
  Returns the maximum heap size for the process, if any.
  `abstract Property<Integer>`
  `getMaxParallelForks()`
  Returns the maximum number of test processes to start in parallel.
  `Property<String>`
  `getMinHeapSize()`
  Returns the minimum heap size for the process, if any.
  `ModularitySpec`
  `getModularity()`
  Returns the module path handling of this test task.
  `protected abstract org.gradle.api.internal.classpath.ModuleRegistry`
  `getModuleRegistry()`
  `protected List<String>`
  `getNoMatchingTestErrorReasons()`
  Returns the reasons for no matching test error.
  `TestFrameworkOptions`
  `getOptions()`
  Returns test framework specific options.
  `protected abstract org.gradle.api.tasks.util.internal.PatternSetFactory`
  `getPatternSetFactory()`
  `protected abstract org.gradle.process.internal.worker.WorkerProcessFactory`
  `getProcessBuilderFactory()`
  `protected abstract org.gradle.api.internal.provider.PropertyFactory`
  `getPropertyFactory()`
  `protected abstract ProviderFactory`
  `getProviderFactory()`
  `protected int`
  `getReportEntrySkipLevels()`
  Returns the number of top level entries to skip in reports.
  `abstract Property<Boolean>`
  `getScanForTestClasses()`
  Specifies whether test classes should be detected.
  `protected FileCollection`
  `getStableClasspath()`
  Returns the classpath to use to execute the tests.
  `MapProperty<String,Object>`
  `getSystemProperties()`
  System properties which will be used for the process.
  `abstract ConfigurableFileCollection`
  `getTestClassesDirs()`
  The directories to scan for compiled test sources.
  `abstract ConfigurableFileCollection`
  `getTestDefinitionDirs()`
  Returns directories to scan for non-class-based test definition files.
  `abstract Property<org.gradle.api.internal.tasks.testing.TestFramework>`
  `getTestFramework()`
  Returns the configured `TestFramework`.
  `DirectoryProperty`
  `getWorkingDir()`
  Returns the working directory for the process.
  `Test`
  `include(Closure includeSpec)`
  Adds an include spec.
  `Test`
  `include(Iterable<String> includes)`
  Adds include patterns for the files in the test classes directory (e.g.
  `Test`
  `include(String... includes)`
  Adds include patterns for the files in the test classes directory (e.g.
  `Test`
  `include(Spec<FileTreeElement> includeSpec)`
  Adds an include spec.
  `Test`
  `jvmArgs(Iterable<?> arguments)`
  Adds some arguments to use to launch the JVM for the process.
  `Test`
  `jvmArgs(Object... arguments)`
  Adds some arguments to use to launch the JVM for the process.
  `TestFrameworkOptions`
  `options(Closure testFrameworkConfigure)`
  Configures test framework specific options.
  `TestFrameworkOptions`
  `options(Action<? super TestFrameworkOptions> testFrameworkConfigure)`
  Configures test framework specific options.
  `Test`
  `setExcludes(Iterable<String> excludes)`
  Sets the exclude patterns for test execution.
  `void`
  `setFailFast(boolean failFast)`
  Enables fail fast behavior causing the task to fail on the first failed test.
  `Test`
  `setIncludes(Iterable<String> includes)`
  Sets the include patterns for test execution.
  `(package private) void`
  `setTestExecuter(org.gradle.api.internal.tasks.testing.TestExecuter<org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec> testExecuter)`
  Sets the testExecuter property.
  `Test`
  `setTestNameIncludePatterns(List<String> testNamePattern)`
  Sets the test name patterns to be included in execution.
  `Test`
  `systemProperties(Map<String,? extends @Nullable Object> properties)`
  Adds some system properties to use for the process.
  `Test`
  `systemProperty(String name, @Nullable Object value)`
  Adds a system property to use for the process.
  `org.gradle.api.internal.tasks.testing.TestFramework`
  `testFramework(@Nullable Closure testFrameworkConfigure)`
  Deprecated.
  This will be removed in Gradle 10
  `(package private) boolean`
  `testsAreNotFiltered()`
  `void`
  `useJUnit()`
  Specifies that JUnit4 should be used to discover and execute the tests.
  `void`
  `useJUnit(@Nullable Closure testFrameworkConfigure)`
  Specifies that JUnit4 should be used to discover and execute the tests with additional configuration.
  `void`
  `useJUnit(Action<? super JUnitOptions> testFrameworkConfigure)`
  Specifies that JUnit4 should be used to discover and execute the tests with additional configuration.
  `void`
  `useJUnitPlatform()`
  Specifies that JUnit Platform should be used to discover and execute the tests.
  `void`
  `useJUnitPlatform(Action<? super JUnitPlatformOptions> testFrameworkConfigure)`
  Specifies that JUnit Platform should be used to discover and execute the tests with additional configuration.
  `(package private) void`
  `useTestFramework(org.gradle.api.internal.tasks.testing.TestFramework testFramework)`
  Set the framework, only if it is being changed to a new value.
  `void`
  `useTestNG()`
  Specifies that TestNG should be used to discover and execute the tests.
  `void`
  `useTestNG(Closure testFrameworkConfigure)`
  Specifies that TestNG should be used to discover and execute the tests with additional configuration.
  `void`
  `useTestNG(Action<? super TestNGOptions> testFrameworkConfigure)`
  Specifies that TestNG should be used to discover and execute the tests with additional configuration.
  `Test`
  `workingDir(Object dir)`
  Sets the working directory for the process.

  ### Methods inherited from class org.gradle.api.tasks.testing.AbstractTestTask

  `addTestListener, addTestMetadataListener, addTestOutputListener, afterSuite, afterTest, beforeSuite, beforeTest, getBinaryResultsDirectory, getBuildOperationExecutor, getBuildOperationRunner, getFailOnNoDiscoveredTests, getFileSystemOperations, getFilter, getHostnameLookup, getIgnoreFailures, getInstantiator, getListenerManager, getObjectFactory, getProgressLoggerFactory, getReports, getTestEventReporterFactory, getTestLogging, getTextOutputFactory, onOutput, removeTestListener, removeTestMetadataListener, removeTestOutputListener, reports, reports, setIgnoreFailures, setTestReporter, testLogging, testLogging`

  ### Methods inherited from class org.gradle.api.internal.ConventionTask

  `conventionMapping, conventionMapping, getConventionMapping`

  ### Methods inherited from class org.gradle.api.DefaultTask

  `compareTo, configure, dependsOn, doFirst, doFirst, doFirst, doLast, doLast, doLast, finalizedBy, getActions, getAnt, getDependsOn, getDescription, getDestroyables, getDidWork, getEnabled, getExtensions, getFinalizedBy, getGroup, getInputs, getLocalState, getLogger, getLogging, getMustRunAfter, getName, getOutputs, getPath, getProject, getShouldRunAfter, getState, getTaskDependencies, getTemporaryDir, getTimeout, hasProperty, mustRunAfter, onlyIf, onlyIf, onlyIf, property, setActions, setDependsOn, setDescription, setDidWork, setEnabled, setFinalizedBy, setGroup, setMustRunAfter, setOnlyIf, setOnlyIf, setOnlyIf, setProperty, setShouldRunAfter, shouldRunAfter, usesService`

  ### Methods inherited from class org.gradle.api.internal.AbstractTask

  `acceptServiceReferences, appendParallelSafeAction, doNotTrackState, doNotTrackStateIf, getAsDynamicObject, getIdentityPath, getImpliesSubProjects, getLifecycleDependencies, getOnlyIf, getReasonNotToTrackState, getReasonsNotToTrackState, getReasonTaskIsIncompatibleWithConfigurationCache, getRequiredServices, getServices, getSharedResources, getStandardOutputCapture, getTaskActions, getTaskIdentity, getTemporaryDirFactory, hasTaskActions, injectIntoNewInstance, isCompatibleWithConfigurationCache, isEnabled, isHasCustomActions, notCompatibleWithConfigurationCache, prependParallelSafeAction, restoreOnlyIf, restoreTaskActions, setImpliesSubProjects`

  ### Methods inherited from class java.lang.Object

  `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

  ### Methods inherited from interface org.gradle.api.Task

  `doNotTrackState, notCompatibleWithConfigurationCache`

- ## Constructor Details

  - ### Test

    public Test()

- ## Method Details

  - ### getWorkingDir

    @Internal public DirectoryProperty getWorkingDir()
    Returns the working directory for the process. Defaults to the project directory.
    Specified by:
      `getWorkingDir` in interface `ProcessForkOptions`
    Returns:
      The working directory. Never returns null.

  - ### workingDir

    public Test workingDir(Object dir)
    Sets the working directory for the process. The supplied argument is evaluated as per `Project.file(Object)`.
    Specified by:
      `workingDir` in interface `ProcessForkOptions`
    Parameters:
      `dir` - The working directory. Must not be null.
    Returns:
      this

  - ### getJavaVersion

    @Input public Provider<JavaVersion> getJavaVersion()
    Returns the version of Java used to run the tests based on the `JavaLauncher` specified by `getJavaLauncher()`, or the executable specified by `getExecutable()` if the `JavaLauncher` is not present.
    Since:
      3.3

  - ### getExecutable

    @Internal public Property<String> getExecutable()
    Returns the name of the executable to use.
    Specified by:
      `getExecutable` in interface `ProcessForkOptions`
    Returns:
      The executable.

  - ### executable

    public Test executable(Object executable)
    Sets the name of the executable to use.
    Specified by:
      `executable` in interface `ProcessForkOptions`
    Parameters:
      `executable` - The executable. Must not be null.
    Returns:
      this

  - ### getSystemProperties

    public MapProperty<String,Object> getSystemProperties()
    System properties which will be used for the process.
    Specified by:
      `getSystemProperties` in interface `JavaForkOptions`
    Returns:
      The system properties. Returns an empty map when there are no system properties.

  - ### systemProperties

    public Test systemProperties(Map<String,? extends @Nullable Object> properties)
    Adds some system properties to use for the process.
    Specified by:
      `systemProperties` in interface `JavaForkOptions`
    Parameters:
      `properties` - The system properties. Must not be null.
    Returns:
      this

  - ### systemProperty

    public Test systemProperty(String name, @Nullable Object value)
    Adds a system property to use for the process.
    Specified by:
      `systemProperty` in interface `JavaForkOptions`
    Parameters:
      `name` - The name of the property
      `value` - The value for the property. May be null.
    Returns:
      this

  - ### getBootstrapClasspath

    public ConfigurableFileCollection getBootstrapClasspath()
    Returns the bootstrap classpath to use for the process. The default bootstrap classpath for the JVM is used when this classpath is empty.
    Specified by:
      `getBootstrapClasspath` in interface `JavaForkOptions`
    Returns:
      The bootstrap classpath. Never returns null.

  - ### bootstrapClasspath

    public Test bootstrapClasspath(@Nullable Object... classpath)
    Adds the given values to the end of the bootstrap classpath for the process.
    Specified by:
      `bootstrapClasspath` in interface `JavaForkOptions`
    Parameters:
      `classpath` - The classpath.
    Returns:
      this

  - ### getMinHeapSize

    public Property<String> getMinHeapSize()
    Returns the minimum heap size for the process, if any. Supports the units megabytes (e.g. "512m") and gigabytes (e.g. "1g").
    Specified by:
      `getMinHeapSize` in interface `JavaForkOptions`
    Returns:
      The minimum heap size. Returns null if the default minimum heap size should be used.

  - ### getDefaultCharacterEncoding

    public Property<String> getDefaultCharacterEncoding()
    Returns the default character encoding to use.
    Specified by:
      `getDefaultCharacterEncoding` in interface `JavaForkOptions`
    Returns:
      The default character encoding. Returns null if the `default character encoding of this JVM` should be used.

  - ### getMaxHeapSize

    public Property<String> getMaxHeapSize()
    Returns the maximum heap size for the process, if any. Supports the units megabytes (e.g. "512m") and gigabytes (e.g. "1g").
    Specified by:
      `getMaxHeapSize` in interface `JavaForkOptions`
    Returns:
      The maximum heap size. Returns null if the default maximum heap size should be used.

  - ### getJvmArgs

    public ListProperty<String> getJvmArgs()
    The extra arguments to use to launch the JVM for the process.
    Specified by:
      `getJvmArgs` in interface `JavaForkOptions`
    Returns:
      The list of arguments. Returns an empty list if there are no arguments.

  - ### getJvmArgumentProviders

    public ListProperty<CommandLineArgumentProvider> getJvmArgumentProviders()
    Command line argument providers for the java process to fork.
    Specified by:
      `getJvmArgumentProviders` in interface `JavaForkOptions`

  - ### jvmArgs

    public Test jvmArgs(Iterable<?> arguments)
    Adds some arguments to use to launch the JVM for the process.
    Specified by:
      `jvmArgs` in interface `JavaForkOptions`
    Parameters:
      `arguments` - The arguments. Must not be null.
    Returns:
      this

  - ### jvmArgs

    public Test jvmArgs(Object... arguments)
    Adds some arguments to use to launch the JVM for the process.
    Specified by:
      `jvmArgs` in interface `JavaForkOptions`
    Parameters:
      `arguments` - The arguments.
    Returns:
      this

  - ### getEnableAssertions

    public Property<Boolean> getEnableAssertions()
    A flag that marks if assertions are enabled for the process.
    Specified by:
      `getEnableAssertions` in interface `JavaForkOptions`

  - ### getDebug

    public Property<Boolean> getDebug()
    Determines whether debugging is enabled for the test process. When enabled — `debug = true` — the process is started in a suspended state, listening on port 5005. You should disable parallel test execution when debugging and you will need to reattach the debugger occasionally if you use a non-zero value for `getForkEvery()`.

    Since Gradle 5.6, you can configure the port and other Java debug properties via `JavaForkOptions.debugOptions(Action)`.

    Specified by:
      `getDebug` in interface `JavaForkOptions`

  - ### getDebugOptions

    public JavaDebugOptions getDebugOptions()
    Returns the Java Debug Wire Protocol properties for the process. If enabled then the `-agentlib:jdwp=...` will be appended to the JVM arguments with the configuration from the parameter.
    Specified by:
      `getDebugOptions` in interface `JavaForkOptions`

  - ### debugOptions

    public void debugOptions(Action<JavaDebugOptions> action)
    Configures Java Debug Wire Protocol properties for the process. If `JavaForkOptions.getDebug()` (boolean)} is enabled then the `-agentlib:jdwp=...` will be appended to the JVM arguments with the configuration from the parameter.
    Specified by:
      `debugOptions` in interface `JavaForkOptions`
    Parameters:
      `action` - the Java debug configuration

  - ### setFailFast

    public void setFailFast(boolean failFast)
    Enables fail fast behavior causing the task to fail on the first failed test.
    Overrides:
      `setFailFast` in class `AbstractTestTask`

  - ### getFailFast

    public boolean getFailFast()
    Indicates if this task will fail on the first failed test
    Overrides:
      `getFailFast` in class `AbstractTestTask`
    Returns:
      whether this task will fail on the first failed test

  - ### getDryRun

    @Incubating @Input public abstract Property<Boolean> getDryRun()
    Indicates if this task will skip individual test execution.

    For JUnit 4 and 5, this will report tests that would have executed as skipped. For TestNG, this will report tests that would have executed as passed.

    Only versions of TestNG which support native dry-running are supported, i.e. TestNG 6.14 or later.

    Returns:
      property for whether this task will skip individual test execution
    Since:
      8.3

  - ### getAllJvmArgs

    public Provider<List<String>> getAllJvmArgs()
    Returns the full set of arguments to use to launch the JVM for the process. This includes arguments to define system properties, the minimum/maximum heap size, and the bootstrap classpath.
    Specified by:
      `getAllJvmArgs` in interface `JavaForkOptions`
    Returns:
      The immutable list of arguments. Returns an empty list if there are no arguments.

  - ### getEnvironment

    @Internal public MapProperty<String,Object> getEnvironment()
    The environment variables to use for the process. Defaults to the environment of this process.
    Specified by:
      `getEnvironment` in interface `ProcessForkOptions`
    Returns:
      The environment. Returns an empty map when there are no environment variables.

  - ### environment

    public Test environment(Map<String,?> environmentVariables)
    Adds some environment variables to the environment for this process.
    Specified by:
      `environment` in interface `ProcessForkOptions`
    Parameters:
      `environmentVariables` - The environment variables. Must not be null.
    Returns:
      this

  - ### environment

    public Test environment(String name, Object value)
    Adds an environment variable to the environment for this process.
    Specified by:
      `environment` in interface `ProcessForkOptions`
    Parameters:
      `name` - The name of the variable.
      `value` - The value for the variable. Must not be null.
    Returns:
      this

  - ### copyTo

    public Test copyTo(ProcessForkOptions target)
    Copies these options to the given target options.
    Specified by:
      `copyTo` in interface `ProcessForkOptions`
    Parameters:
      `target` - The target options
    Returns:
      this

  - ### copyTo

    public Test copyTo(JavaForkOptions target)
    Copies these options to the given options.
    Specified by:
      `copyTo` in interface `JavaForkOptions`
    Parameters:
      `target` - The target options.
    Returns:
      this

  - ### getModularity

    public ModularitySpec getModularity()
    Returns the module path handling of this test task.
    Since:
      6.4

  - ### createTestExecutionSpec

    protected org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec createTestExecutionSpec()
    Creates test execution specification. For internal use only.
    Specified by:
      `createTestExecutionSpec` in class `AbstractTestTask`
    Since:
      4.4

  - ### executeTests

    public void executeTests()
    Overrides:
      `executeTests` in class `AbstractTestTask`

  - ### createTestExecuter

    protected org.gradle.api.internal.tasks.testing.TestExecuter<org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec> createTestExecuter()
    Description copied from class: `AbstractTestTask`
    Creates test executer. For internal use only.
    Specified by:
      `createTestExecuter` in class `AbstractTestTask`

  - ### getNoMatchingTestErrorReasons

    protected List<String> getNoMatchingTestErrorReasons()
    Description copied from class: `AbstractTestTask`
    Returns the reasons for no matching test error.
    Overrides:
      `getNoMatchingTestErrorReasons` in class `AbstractTestTask`

  - ### getReportEntrySkipLevels

    protected int getReportEntrySkipLevels()
    Description copied from class: `AbstractTestTask`
    Returns the number of top level entries to skip in reports. For internal use only.
    Overrides:
      `getReportEntrySkipLevels` in class `AbstractTestTask`

  - ### include

    public Test include(String... includes)
    Adds include patterns for the files in the test classes directory (e.g. '**/*Test.class')).
    Specified by:
      `include` in interface `PatternFilterable`
    Parameters:
      `includes` - a vararg list of include patterns
    Returns:
      this
    See Also:
      - `setIncludes(Iterable)`

  - ### include

    public Test include(Iterable<String> includes)
    Adds include patterns for the files in the test classes directory (e.g. '**/*Test.class')).
    Specified by:
      `include` in interface `PatternFilterable`
    Parameters:
      `includes` - a Iterable providing more include patterns
    Returns:
      this
    See Also:
      - `setIncludes(Iterable)`

  - ### include

    public Test include(Spec<FileTreeElement> includeSpec)
    Adds an include spec. This method may be called multiple times to append new specs. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns or specs to be included.
    Specified by:
      `include` in interface `PatternFilterable`
    Parameters:
      `includeSpec` - the spec to add
    Returns:
      this
    See Also:
      - `Pattern Format`

  - ### include

    public Test include(Closure includeSpec)
    Adds an include spec. This method may be called multiple times to append new specs. The given closure is passed a `FileTreeElement` as its parameter. If includes are not provided, then all files in this container will be included. If includes are provided, then a file must match at least one of the include patterns or specs to be included.
    Specified by:
      `include` in interface `PatternFilterable`
    Parameters:
      `includeSpec` - the spec to add
    Returns:
      this
    See Also:
      - `Pattern Format`

  - ### exclude

    public Test exclude(String... excludes)
    Adds exclude patterns for the files in the test classes directory (e.g. '**/*Test.class')).
    Specified by:
      `exclude` in interface `PatternFilterable`
    Parameters:
      `excludes` - a vararg list of exclude patterns
    Returns:
      this
    See Also:
      - `setExcludes(Iterable)`

  - ### exclude

    public Test exclude(Iterable<String> excludes)
    Adds exclude patterns for the files in the test classes directory (e.g. '**/*Test.class')).
    Specified by:
      `exclude` in interface `PatternFilterable`
    Parameters:
      `excludes` - a Iterable providing new exclude patterns
    Returns:
      this
    See Also:
      - `setExcludes(Iterable)`

  - ### exclude

    public Test exclude(Spec<FileTreeElement> excludeSpec)
    Adds an exclude spec. This method may be called multiple times to append new specs. If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.
    Specified by:
      `exclude` in interface `PatternFilterable`
    Parameters:
      `excludeSpec` - the spec to add
    Returns:
      this
    See Also:
      - `Pattern Format`

  - ### exclude

    public Test exclude(Closure excludeSpec)
    Adds an exclude spec. This method may be called multiple times to append new specs.The given closure is passed a `FileTreeElement` as its parameter. The closure should return true or false. Example:

         copySpec {
           from 'source'
           into 'destination'
           //an example of excluding files from certain configuration:
           exclude { it.file in configurations.someConf.files }
         }

    If excludes are not provided, then no files will be excluded. If excludes are provided, then files must not match any exclude pattern to be processed.
    Specified by:
      `exclude` in interface `PatternFilterable`
    Parameters:
      `excludeSpec` - the spec to add
    Returns:
      this
    See Also:
      - `FileTreeElement`

  - ### setTestNameIncludePatterns

    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`
    Overrides:
      `setTestNameIncludePatterns` in class `AbstractTestTask`

  - ### getTestClassesDirs

    @Internal public abstract ConfigurableFileCollection getTestClassesDirs()
    The directories to scan for compiled test sources. Typically, this would be configured to use the output of a source set:

         plugins {
             id 'java'
         }

         sourceSets {
            integrationTest {
               compileClasspath += main.output
               runtimeClasspath += main.output
            }
         }

         task integrationTest(type: Test) {
             // Runs tests from src/integrationTest
             testClassesDirs = sourceSets.integrationTest.output.classesDirs
             classpath = sourceSets.integrationTest.runtimeClasspath
         }

    Returns:
      All test class directories to be used.
    Since:
      4.0

  - ### getTestDefinitionDirs

    @Incubating @InputFiles @SkipWhenEmpty @IgnoreEmptyDirectories @PathSensitive(RELATIVE) public abstract ConfigurableFileCollection getTestDefinitionDirs()
    Returns directories to scan for non-class-based test definition files.
    Returns:
      The directories holding non-class-based test definition files.
    Since:
      9.4.0

  - ### getIncludes

    @Internal public Set<String> getIncludes()
    Returns the include patterns for test execution.
    Specified by:
      `getIncludes` in interface `PatternFilterable`
    Returns:
      The include patterns. Returns an empty set when there are no include patterns.
    See Also:
      - `include(String...)`

  - ### setIncludes

    public Test setIncludes(Iterable<String> includes)
    Sets the include patterns for test execution.
    Specified by:
      `setIncludes` in interface `PatternFilterable`
    Parameters:
      `includes` - The patterns list
    Returns:
      this
    See Also:
      - `include(String...)`

  - ### getExcludes

    @Internal public Set<String> getExcludes()
    Returns the exclude patterns for test execution.
    Specified by:
      `getExcludes` in interface `PatternFilterable`
    Returns:
      The exclude patterns. Returns an empty set when there are no exclude patterns.
    See Also:
      - `exclude(String...)`

  - ### setExcludes

    public Test setExcludes(Iterable<String> excludes)
    Sets the exclude patterns for test execution.
    Specified by:
      `setExcludes` in interface `PatternFilterable`
    Parameters:
      `excludes` - The patterns list
    Returns:
      this
    See Also:
      - `exclude(String...)`

  - ### getTestFramework

    public abstract Property<org.gradle.api.internal.tasks.testing.TestFramework> getTestFramework()
    Returns the configured `TestFramework`.
    Since:
      7.3

  - ### testFramework

    @Deprecated public org.gradle.api.internal.tasks.testing.TestFramework testFramework(@Nullable Closure testFrameworkConfigure)
    Deprecated.
    This will be removed in Gradle 10
    Do not call this method.

  - ### getOptions

    public TestFrameworkOptions getOptions()
    Returns test framework specific options. Make sure to call `useJUnit()`, `useJUnitPlatform()` or `useTestNG()` before using this method.
    Returns:
      The test framework options.

  - ### options

    public TestFrameworkOptions options(@DelegatesTo(TestFrameworkOptions.class) Closure testFrameworkConfigure)
    Configures test framework specific options.

    When a `Test` task is created outside of Test Suites, you should call `useJUnit()`, `useJUnitPlatform()` or `useTestNG()` before using this method. If no test framework has been set, the task will assume JUnit4.

    Returns:
      The test framework options.

  - ### options

    public TestFrameworkOptions options(Action<? super TestFrameworkOptions> testFrameworkConfigure)
    Configures test framework specific options.

    When a `Test` task is created outside of Test Suites, you should call `useJUnit()`, `useJUnitPlatform()` or `useTestNG()` before using this method. If no test framework has been set, the task will assume JUnit4.

    Returns:
      The test framework options.
    Since:
      3.5

  - ### useJUnit

    public void useJUnit()
    Specifies that JUnit4 should be used to discover and execute the tests.
    See Also:
      - `Configure JUnit4 specific options.`

  - ### useJUnit

    public void useJUnit(@DelegatesTo(JUnitOptions.class) @Nullable Closure testFrameworkConfigure)
    Specifies that JUnit4 should be used to discover and execute the tests with additional configuration.

    The supplied action configures an instance of `JUnit4 specific options`.

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

  - ### useJUnit

    public void useJUnit(Action<? super JUnitOptions> testFrameworkConfigure)
    Specifies that JUnit4 should be used to discover and execute the tests with additional configuration.

    The supplied action configures an instance of `JUnit4 specific options`.

    Parameters:
      `testFrameworkConfigure` - An action used to configure JUnit4 options.
    Since:
      3.5

  - ### useJUnitPlatform

    public void useJUnitPlatform()
    Specifies that JUnit Platform should be used to discover and execute the tests.

    Use this option if your tests use JUnit Jupiter/JUnit5.

    JUnit Platform supports multiple test engines, which allows other testing frameworks to be built on top of it. You may need to use this option even if you are not using JUnit directly.

    Since:
      4.6
    See Also:
      - `Configure JUnit Platform specific options.`

  - ### useJUnitPlatform

    public void useJUnitPlatform(Action<? super JUnitPlatformOptions> testFrameworkConfigure)
    Specifies that JUnit Platform should be used to discover and execute the tests with additional configuration.

    Use this option if your tests use JUnit Jupiter/JUnit5.

    JUnit Platform supports multiple test engines, which allows other testing frameworks to be built on top of it. You may need to use this option even if you are not using JUnit directly.

    The supplied action configures an instance of `JUnit Platform specific options`.

    Parameters:
      `testFrameworkConfigure` - A closure used to configure JUnit platform options.
    Since:
      4.6

  - ### useTestNG

    public void useTestNG()
    Specifies that TestNG should be used to discover and execute the tests.
    See Also:
      - `Configure TestNG specific options.`

  - ### useTestNG

    public void useTestNG(@DelegatesTo(TestNGOptions.class) Closure testFrameworkConfigure)
    Specifies that TestNG should be used to discover and execute the tests with additional configuration.

    The supplied action configures an instance of `TestNG specific options`.

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

  - ### useTestNG

    public void useTestNG(Action<? super TestNGOptions> testFrameworkConfigure)
    Specifies that TestNG should be used to discover and execute the tests with additional configuration.

    The supplied action configures an instance of `TestNG specific options`.

    Parameters:
      `testFrameworkConfigure` - An action used to configure TestNG options.
    Since:
      3.5

  - ### useTestFramework

    void useTestFramework(org.gradle.api.internal.tasks.testing.TestFramework testFramework)
    Set the framework, only if it is being changed to a new value. If we are setting a framework to its existing value, no-op so as not to overwrite existing options here. We need to allow this especially for the default test task, so that existing builds that configure options and then call useJunit() don't clear out their options.

  - ### getStableClasspath

    @Classpath protected FileCollection getStableClasspath()
    Returns the classpath to use to execute the tests.
    Since:
      6.6

  - ### getClasspath

    @Internal("captured by stableClasspath") public abstract ConfigurableFileCollection getClasspath()
    Returns the classpath to use to execute the tests.

  - ### getScanForTestClasses

    @Input public abstract Property<Boolean> getScanForTestClasses()
    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.

  - ### getIsScanForTestClasses

    @Internal public Property<Boolean> getIsScanForTestClasses()
    Added for Kotlin source compatibility. Use `getScanForTestClasses()` instead.

  - ### getForkEvery

    @Internal public abstract Property<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.

    By default, Gradle automatically uses a separate JVM when executing tests.

    - A value of `0` (no limit) means to reuse the test process for all test classes. This is the default.
    - A value of `1` means that a new test process is started for every test class. This is very expensive.
    - A value of `N` means that a new test process is started after `N` test classes.
    This property can have a large impact on performance due to the cost of stopping and starting each test process. It is unusual for this property to be changed from the default.
    Returns:
      The maximum number of test classes to execute in a test process. Returns 0 when there is no maximum.

  - ### getMaxParallelForks

    @Internal public abstract Property<Integer> getMaxParallelForks()
    Returns the maximum number of test processes to start in parallel.

    By default, Gradle executes a single test class at a time.

    - A value of `1` means to only execute a single test class in a single test process at a time. This is the default.
    - A value of `N` means that up to `N` test processes will be started to execute test classes. This can improve test execution time by running multiple test classes in parallel.
    This property cannot exceed the value of max-workers for the current build. Gradle will also limit the number of started test processes across all `Test` tasks.
    Returns:
      The maximum number of forked test processes.

  - ### getCandidateClassFiles

    @InputFiles @SkipWhenEmpty @IgnoreEmptyDirectories @PathSensitive(RELATIVE) public FileTree getCandidateClassFiles()
    Returns the classes files to scan for test classes.
    Returns:
      The candidate class files.

  - ### filter

    public void filter(Action<TestFilter> action)
    Executes the action against the `AbstractTestTask.getFilter()`.
    Parameters:
      `action` - configuration of the test filter
    Since:
      1.10

  - ### setTestExecuter

    void setTestExecuter(org.gradle.api.internal.tasks.testing.TestExecuter<org.gradle.api.internal.tasks.testing.JvmTestExecutionSpec> testExecuter)
    Sets the testExecuter property.
    Since:
      4.2

  - ### getJavaLauncher

    public abstract Property<JavaLauncher> getJavaLauncher()
    Configures the java executable to be used to run the tests.
    Since:
      6.7

  - ### testsAreNotFiltered

    boolean testsAreNotFiltered()
    Overrides:
      `testsAreNotFiltered` in class `AbstractTestTask`

  - ### getPropertyFactory

    @Inject protected abstract org.gradle.api.internal.provider.PropertyFactory getPropertyFactory()

  - ### getJavaToolchainService

    @Inject protected abstract JavaToolchainService getJavaToolchainService()

  - ### getProviderFactory

    @Inject protected abstract ProviderFactory getProviderFactory()

  - ### getActorFactory

    @Inject protected abstract org.gradle.internal.actor.ActorFactory getActorFactory()

  - ### getProcessBuilderFactory

    @Inject protected abstract org.gradle.process.internal.worker.WorkerProcessFactory getProcessBuilderFactory()

  - ### getPatternSetFactory

    @Inject protected abstract org.gradle.api.tasks.util.internal.PatternSetFactory getPatternSetFactory()

  - ### getForkOptionsFactory

    @Inject protected abstract org.gradle.process.internal.JavaForkOptionsFactory getForkOptionsFactory()

  - ### getModuleRegistry

    @Inject protected abstract org.gradle.api.internal.classpath.ModuleRegistry getModuleRegistry()

  - ### getJavaModuleDetector

    @Inject protected abstract org.gradle.internal.jvm.JavaModuleDetector getJavaModuleDetector()