Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## 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.Test

All Implemented Interfaces:
  Comparable<Task>, org.gradle.api.internal.DynamicObjectAware, org.gradle.api.internal.IConventionAware, org.gradle.api.internal.TaskInternal, Task, PatternFilterable, VerificationTask, JavaForkOptions, ProcessForkOptions, org.gradle.util.Configurable<Task>

    public class Test

extends org.gradle.api.internal.ConventionTask
implements JavaForkOptions, PatternFilterable, VerificationTask

Executes tests. Supports JUnit (3.8.x or 4.x) or TestNG tests.

Field Summary

Fields inherited from interface org.gradle.api.Task
`TASK_ACTION, TASK_DEPENDS_ON, TASK_DESCRIPTION, TASK_GROUP, TASK_NAME, TASK_OVERWRITE, TASK_TYPE`

Constructor Summary
`Test()`

Method Summary
`void` | `addTestListener(TestListener listener)` Registers a test listener with this task.
`void` | `afterSuite(Closure closure)` Adds a closure to be notified after a test suite has executed.
`void` | `afterTest(Closure closure)` Adds a closure to be notified after a test has executed.
`void` | `beforeSuite(Closure closure)` Adds a closure to be notified before a test suite is executed.
`void` | `beforeTest(Closure closure)` Adds a closure to be notified before a test is executed.
`Test` | `bootstrapClasspath(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.
`void` | `disableTestReport()`
`void` | `enableTestReport()`
`Test` | `environment(Map<String,?> environmentVariables)` Adds some environment variables to the environment for this process.
`Test` | `environment(String name, Object value)` Adds an environment variable 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(Spec<FileTreeElement> excludeSpec)` Adds an exclude spec.
`Test` | `exclude(String... excludes)` Adds exclude patterns for the files in the test classes directory (e.g.
`Test` | `executable(Object executable)` Sets the name of the executable to use.
`void` | `executeTests()`
`List<String>` | `getAllJvmArgs()` Returns the full set of arguments to use to launch the JVM for the process.
`FileCollection` | `getBootstrapClasspath()` Returns the bootstrap classpath to use for the process.
`FileTree` | `getCandidateClassFiles()` Returns the classes files to scan for test classes.
`FileCollection` | `getClasspath()` Returns the classpath to use to execute the tests.
`boolean` | `getDebug()` Returns true if debugging is enabled for the process.
`boolean` | `getEnableAssertions()` Returns true if assertions are enabled for the process.
`Map<String,Object>` | `getEnvironment()` The environment variables to use for the process.
`Set<String>` | `getExcludes()` Returns the exclude patterns for test execution.
`String` | `getExecutable()` Returns the name of the executable to use.
`long` | `getForkEvery()` Returns the maximum number of test classes to execute in a forked test process.
`Set<String>` | `getIncludes()` Returns the include patterns for test execution.
`List<String>` | `getJvmArgs()` Returns the extra arguments to use to launch the JVM for the process.
`String` | `getMaxHeapSize()` Returns the maximum heap size for the process, if any.
`int` | `getMaxParallelForks()` Returns the maximum number of forked test processes to execute in parallel.
`TestFrameworkOptions` | `getOptions()` Returns the test options options.
`Map<String,Object>` | `getSystemProperties()` Returns the system properties which will be used for the process.
`File` | `getTestClassesDir()` Returns the root folder for the compiled test sources.
`org.gradle.api.internal.tasks.testing.TestFramework` | `getTestFramework()`
`File` | `getTestReportDir()` Returns the root folder for the test reports.
`File` | `getTestResultsDir()` Returns the root folder for the test results.
`List<File>` | `getTestSrcDirs()` Returns the directories containing the test source.
`File` | `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(Spec<FileTreeElement> includeSpec)` Adds an include spec.
`Test` | `include(String... includes)` Adds include patterns for the files in the test classes directory (e.g.
`boolean` | `isIgnoreFailures()` Specifies whether the build should break when the verifications performed by this task fail.
`boolean` | `isScanForTestClasses()` Specifies whether test classes should be detected.
`boolean` | `isTestReport()` Specifies whether the test report should be generated.
`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)`
`void` | `removeTestListener(TestListener listener)` Unregisters a test listener with this task.
`void` | `setAllJvmArgs(Iterable<?> arguments)` Sets the full set of arguments to use to launch the JVM for the process.
`void` | `setBootstrapClasspath(FileCollection classpath)` Sets the bootstrap classpath to use for the process.
`void` | `setClasspath(FileCollection classpath)`
`void` | `setDebug(boolean enabled)` Enable or disable debugging for the process.
`void` | `setEnableAssertions(boolean enabled)` Enable or disable assertions for the process.
`void` | `setEnvironment(Map<String,?> environmentVariables)` Sets the environment variable to use for the process.
`Test` | `setExcludes(Iterable<String> excludes)` Sets the exclude patterns for test execution.
`void` | `setExecutable(Object executable)` Sets the name of the executable to use.
`void` | `setForkEvery(Long forkEvery)` Sets the maximum number of test classes to execute in a forked test process.
`Test` | `setIgnoreFailures(boolean ignoreFailures)` Specifies whether the build should break when the verifications performed by this task fail.
`Test` | `setIncludes(Iterable<String> includes)` Sets the include patterns for test execution.
`void` | `setJvmArgs(Iterable<?> arguments)` Sets the extra arguments to use to launch the JVM for the process.
`void` | `setMaxHeapSize(String heapSize)` Sets the maximum heap size for the process.
`void` | `setMaxParallelForks(int maxParallelForks)` Sets the maximum number of forked test processes to execute in parallel.
`void` | `setScanForTestClasses(boolean scanForTestClasses)`
`void` | `setSystemProperties(Map<String,?> properties)` Sets the system properties to use for the process.
`void` | `setTestClassesDir(File testClassesDir)` Sets the root folder for the compiled test sources.
`void` | `setTestReport(boolean testReport)`
`void` | `setTestReportDir(File testReportDir)` Sets the root folder for the test reports.
`void` | `setTestResultsDir(File testResultsDir)` Sets the root folder for the test results.
`void` | `setTestSrcDirs(List<File> testSrcDir)`
`void` | `setWorkingDir(Object dir)` Sets the working directory for the process.
`Test` | `systemProperties(Map<String,?> properties)` Adds some system properties to use for the process.
`Test` | `systemProperty(String name, Object value)` Adds a system property to use for the process.
`org.gradle.api.internal.tasks.testing.TestFramework` | `testFramework(Closure testFrameworkConfigure)`
`void` | `useJUnit()` Specifies that JUnit should be used to execute the tests.
`void` | `useJUnit(Closure testFrameworkConfigure)` Specifies that JUnit should be used to execute the tests.
`void` | `useTestNG()` Specifies that TestNG should be used to execute the tests.
`void` | `useTestNG(Closure testFrameworkConfigure)` Specifies that TestNG should be used to execute the tests.
`Test` | `workingDir(Object dir)` Sets the working directory for the process.

Methods inherited from class org.gradle.api.internal.ConventionTask
`conventionMapping, getConventionMapping, setConventionMapping`

Methods inherited from class org.gradle.api.internal.AbstractTask
`captureStandardOutput, compareTo, configure, deleteAllActions, dependsOn, dependsOnTaskDidWork, disableStandardOutputCapture, doFirst, doFirst, doLast, doLast, equals, execute, getActions, getAdditionalProperties, getAnt, getAsDynamicObject, getConvention, getDependsOn, getDescription, getDidWork, getDynamicObjectHelper, getEnabled, getExecuter, getGroup, getInputs, getLogger, getLogging, getName, getOnlyIf, getOutputs, getPath, getProject, getServices, getStandardOutputCapture, getState, getTaskDependencies, getTemporaryDir, hashCode, hasProperty, injectIntoNewInstance, isEnabled, leftShift, onlyIf, onlyIf, property, setActions, setConvention, setDependsOn, setDescription, setDidWork, setEnabled, setExecuter, setGroup, setName, setOnlyIf, setOnlyIf, setProject, setProperty, toString`

Methods inherited from class java.lang.Object
`clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

Constructor Detail

### Test

    public Test()

Method Detail

### getWorkingDir

    public File 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.

### setWorkingDir

    public void setWorkingDir(Object dir)

  Sets the working directory for the process. The supplied argument is evaluated as for `Project.file(Object)`.

  Specified by:
    `setWorkingDir` in interface `ProcessForkOptions`
  Parameters:
    `dir` - The working directory. Must not be null.

### workingDir

    public Test workingDir(Object dir)

  Sets the working directory for the process. The supplied argument is evaluated as for `Project.file(Object)`.

  Specified by:
    `workingDir` in interface `ProcessForkOptions`
  Parameters:
    `dir` - The working directory. Must not be null.
  Returns:
    this

### getExecutable

    public 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

### setExecutable

    public void setExecutable(Object executable)

  Sets the name of the executable to use.

  Specified by:
    `setExecutable` in interface `ProcessForkOptions`
  Parameters:
    `executable` - The executable. Must not be null.

### getSystemProperties

    public Map<String,Object> getSystemProperties()

  Returns the 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.

### setSystemProperties

    public void setSystemProperties(Map<String,?> properties)

  Sets the system properties to use for the process.

  Specified by:
    `setSystemProperties` in interface `JavaForkOptions`
  Parameters:
    `properties` - The system properties. Must not be null.

### systemProperties

    public Test systemProperties(Map<String,?> 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,
                               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 FileCollection 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.

### setBootstrapClasspath

    public void setBootstrapClasspath(FileCollection classpath)

  Sets the bootstrap classpath to use for the process. Set to an empty classpath to use the default bootstrap classpath for the specified JVM.

  Specified by:
    `setBootstrapClasspath` in interface `JavaForkOptions`
  Parameters:
    `classpath` - The classpath. Must not be null. Can be empty.

### bootstrapClasspath

    public Test bootstrapClasspath(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

### getMaxHeapSize

    public String getMaxHeapSize()

  Returns the maximum heap size for the process, if any.

  Specified by:
    `getMaxHeapSize` in interface `JavaForkOptions`
  Returns:
    The maximum heap size. Returns null if the default maximum heap size should be used.

### setMaxHeapSize

    public void setMaxHeapSize(String heapSize)

  Sets the maximum heap size for the process.

  Specified by:
    `setMaxHeapSize` in interface `JavaForkOptions`
  Parameters:
    `heapSize` - The heap size. Use null for the default maximum heap size.

### getJvmArgs

    public List<String> getJvmArgs()

  Returns the extra arguments to use to launch the JVM for the process. Does not include system properties and the maximum heap size.

  Specified by:
    `getJvmArgs` in interface `JavaForkOptions`
  Returns:
    The arguments. Returns an empty list if there are no arguments.

### setJvmArgs

    public void setJvmArgs(Iterable<?> arguments)

  Sets the extra arguments to use to launch the JVM for the process. System properties and maximum heap size are updated.

  Specified by:
    `setJvmArgs` in interface `JavaForkOptions`
  Parameters:
    `arguments` - The arguments. Must not be null.

### 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 boolean getEnableAssertions()

  Returns true if assertions are enabled for the process.

  Specified by:
    `getEnableAssertions` in interface `JavaForkOptions`
  Returns:
    true if assertions are enabled, false if disabled

### setEnableAssertions

    public void setEnableAssertions(boolean enabled)

  Enable or disable assertions for the process.

  Specified by:
    `setEnableAssertions` in interface `JavaForkOptions`
  Parameters:
    `enabled` - true to enable assertions, false to disable.

### getDebug

    public boolean getDebug()

  Returns true if debugging is enabled for the process. When enabled, the process is started suspended and listening on port 5005.

  Specified by:
    `getDebug` in interface `JavaForkOptions`
  Returns:
    true when debugging is enabled, false to disable.

### setDebug

    public void setDebug(boolean enabled)

  Enable or disable debugging for the process. When enabled, the process is started suspended and listening on port 5005.

  Specified by:
    `setDebug` in interface `JavaForkOptions`
  Parameters:
    `enabled` - true to enable debugging, false to disable.

### getAllJvmArgs

    public 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 maximum heap size, and the bootstrap classpath.

  Specified by:
    `getAllJvmArgs` in interface `JavaForkOptions`
  Returns:
    The arguments. Returns an empty list if there are no arguments.

### setAllJvmArgs

    public void setAllJvmArgs(Iterable<?> arguments)

  Sets the full set of arguments to use to launch the JVM for the process. Overwrites any previously set system properties, maximum heap size, assertions, and bootstrap classpath.

  Specified by:
    `setAllJvmArgs` in interface `JavaForkOptions`
  Parameters:
    `arguments` - The arguments. Must not be null.

### getEnvironment

    public Map<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

### setEnvironment

    public void setEnvironment(Map<String,?> environmentVariables)

  Sets the environment variable to use for the process.

  Specified by:
    `setEnvironment` in interface `ProcessForkOptions`
  Parameters:
    `environmentVariables` - The environment variables. Must not be null.

### 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

### executeTests

    public void executeTests()

### addTestListener

    public void addTestListener(TestListener listener)

  Registers a test listener with this task. This listener will NOT be notified of tests executed by other tasks. To get that behavior, use `Gradle.addListener(Object)`.

  Parameters:
    `listener` - The listener to add.

### removeTestListener

    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(Object)` this method will not do anything. Instead, use `Gradle.removeListener(Object)`.

  Parameters:
    `listener` - The listener to remove.

### beforeSuite

    public void beforeSuite(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.

### afterSuite

    public void afterSuite(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.

### beforeTest

    public void beforeTest(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.

### afterTest

    public void afterTest(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.

### include

    public Test include(String... includes)

  Adds include patterns for the files in the test classes directory (e.g. '**F;*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. '**F;*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)

  Description copied from interface: `PatternFilterable`
  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)

  Description copied from interface: `PatternFilterable`
  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. '**F;*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. '**F;*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)

  Description copied from interface: `PatternFilterable`
  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)

  Description copied from interface: `PatternFilterable`
  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. 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`

### getTestClassesDir

    public File getTestClassesDir()

  Returns the root folder for the compiled test sources.

  Returns:
    All test class directories to be used.

### setTestClassesDir

    public void setTestClassesDir(File testClassesDir)

  Sets the root folder for the compiled test sources.

  Parameters:
    `testClassesDir` - The root folder

### getTestResultsDir

    public File getTestResultsDir()

  Returns the root folder for the test results.

  Returns:
    the test result directory, containing the internal test results, mostly in xml form.

### setTestResultsDir

    public void setTestResultsDir(File testResultsDir)

  Sets the root folder for the test results.

  Parameters:
    `testResultsDir` - The root folder

### getTestReportDir

    public File getTestReportDir()

  Returns the root folder for the test reports.

  Returns:
    the test report directory, containing the test report mostly in HTML form.

### setTestReportDir

    public void setTestReportDir(File testReportDir)

  Sets the root folder for the test reports.

  Parameters:
    `testReportDir` - The root folder

### getIncludes

    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

    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...)`

### isIgnoreFailures

    public boolean isIgnoreFailures()

  Specifies whether the build should break when the verifications performed by this task fail.

  Specified by:
    `isIgnoreFailures` in interface `VerificationTask`
  Returns:
    false, when the build should break on failure, true when the failures should be ignored.

### setIgnoreFailures

    public Test setIgnoreFailures(boolean ignoreFailures)

  Specifies whether the build should break when the verifications performed by this task fail.

  Specified by:
    `setIgnoreFailures` in interface `VerificationTask`
  Parameters:
    `ignoreFailures` - false to break the build on failure, true to ignore the failures. The default is false.
  Returns:
    this

### getTestFramework

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

### testFramework

    public org.gradle.api.internal.tasks.testing.TestFramework testFramework(Closure testFrameworkConfigure)

### getOptions

    public TestFrameworkOptions getOptions()

  Returns the test options options.

  Be sure to call the appropriate `useJUnit()` or `useTestNG()` method before using this method.

  Returns:
    The testframework options.

### options

    public TestFrameworkOptions options(Closure testFrameworkConfigure)

### useJUnit

    public void useJUnit()

  Specifies that JUnit should be used to execute the tests.

### useJUnit

    public void useJUnit(Closure testFrameworkConfigure)

  Specifies that JUnit should be used to execute the tests.

  Parameters:
    `testFrameworkConfigure` - A closure used to configure the JUint options. This closure is passed an instance of type `JUnitOptions`.

### useTestNG

    public void useTestNG()

  Specifies that TestNG should be used to execute the tests.

### useTestNG

    public void useTestNG(Closure testFrameworkConfigure)

  Specifies that TestNG should be used to execute the tests.

  Parameters:
    `testFrameworkConfigure` - A closure used to configure the JUint options. This closure is passed an instance of type `JUnitOptions`.

### getClasspath

    public FileCollection getClasspath()

  Returns the classpath to use to execute the tests.

### setClasspath

    public void setClasspath(FileCollection classpath)

### isTestReport

    public boolean isTestReport()

  Specifies whether the test report should be generated.

### setTestReport

    public void setTestReport(boolean testReport)

### enableTestReport

    public void enableTestReport()

### disableTestReport

    public void disableTestReport()

### getTestSrcDirs

    public List<File> getTestSrcDirs()

  Returns the directories containing the test source.

### setTestSrcDirs

    public void setTestSrcDirs(List<File> testSrcDir)

### isScanForTestClasses

    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.

### setScanForTestClasses

    public void setScanForTestClasses(boolean scanForTestClasses)

### getForkEvery

    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.

### setForkEvery

    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.

### getMaxParallelForks

    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.

### setMaxParallelForks

    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.

### getCandidateClassFiles

    public FileTree getCandidateClassFiles()

  Returns the classes files to scan for test classes.

  Returns:
    The candidate class files.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD