@Incubating public interface JvmTestSuite extends TestSuite, Buildable
Each test suite consists of
SourceSetcompile and runtime dependenciestargetsBased on the testing framework declared, Gradle will automatically add the appropriate dependencies and configure the underlying test task.
Named.Namer| Modifier and Type | Method | Description |
|---|---|---|
void |
dependencies(Action<? super JvmComponentDependencies> dependencies) |
Configure dependencies for this component.
|
JvmComponentDependencies |
getDependencies() |
Dependency handler for this component.
|
SourceSet |
getSources() |
Returns the container of
JvmTestSuiteTarget objects part of this suite. |
ExtensiblePolymorphicDomainObjectContainer<? extends JvmTestSuiteTarget> |
getTargets() |
Collection of test suite targets.
|
void |
sources(Action<? super SourceSet> configuration) |
Configure the sources for this test suite.
|
void |
useJUnit() |
Use the JUnit4 testing framework.
|
void |
useJUnit(String version) |
Use the JUnit4 testing framework with a specific version.
|
void |
useJUnitJupiter() |
Use the JUnit Jupiter testing framework.
|
void |
useJUnitJupiter(String version) |
Use the JUnit Jupiter testing framework with a specific version.
|
void |
useKotlinTest() |
Use the kotlin.test testing framework.
|
void |
useKotlinTest(String version) |
Use the kotlin.test testing framework with a specific version.
|
void |
useSpock() |
Use the Spock Framework testing framework.
|
void |
useSpock(String version) |
Use the Spock Framework testing framework with a specific version.
|
void |
useTestNG() |
Use the TestNG testing framework.
|
void |
useTestNG(String version) |
Use the TestNG testing framework with a specific version.
|
getBuildDependenciesSourceSet getSources()
JvmTestSuiteTarget objects part of this suite.
Source set associated with this test suite. The name of this source set is the same as the test suite.void sources(Action<? super SourceSet> configuration)
configuration - configuration applied against the SourceSet for this test suiteExtensiblePolymorphicDomainObjectContainer<? extends JvmTestSuiteTarget> getTargets()
getTargets in interface TestSuitevoid useJUnitJupiter()
Gradle will provide the version of JUnit Jupiter to use. Defaults to version 5.7.1
void useJUnitJupiter(String version)
version - version of JUnit Jupiter to usevoid useJUnit()
Gradle will provide the version of JUnit4 to use. Defaults to version 4.13
void useJUnit(String version)
version - version of JUnit4 to usevoid useSpock()
Gradle will provide the version of Spock to use. Defaults to version 2.0-groovy-3.0
void useSpock(String version)
version - the version of Spock to usevoid useKotlinTest()
Gradle will provide the version of kotlin.test to use. Defaults to version 1.5.31
void useKotlinTest(String version)
version - the version of kotlin.test to usevoid useTestNG()
Gradle will provide the version of TestNG to use. Defaults to version 7.4.0
void useTestNG(String version)
version - version of TestNG to useJvmComponentDependencies getDependencies()
void dependencies(Action<? super JvmComponentDependencies> dependencies)