@Incubating public interface JvmTestSuite extends TestSuite, Buildable
Each test suite consists of
SourceSet
compile and runtime dependencies
targets
Based 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.
|
Property<java.lang.String> |
getTestType() |
Get the test type for this test suite.
|
void |
sources(Action<? super SourceSet> configuration) |
Configure the sources for this test suite.
|
void |
useJUnit() |
Use the JUnit4 testing framework.
|
void |
useJUnit(java.lang.String version) |
Use the JUnit4 testing framework with a specific version.
|
void |
useJUnit(Provider<java.lang.String> version) |
Use the JUnit4 testing framework with a specific version.
|
void |
useJUnitJupiter() |
Use the JUnit Jupiter testing framework.
|
void |
useJUnitJupiter(java.lang.String version) |
Use the JUnit Jupiter testing framework with a specific version.
|
void |
useJUnitJupiter(Provider<java.lang.String> version) |
Use the JUnit Jupiter testing framework with a specific version.
|
void |
useKotlinTest() |
Use the kotlin.test testing framework.
|
void |
useKotlinTest(java.lang.String version) |
Use the kotlin.test testing framework with a specific version.
|
void |
useKotlinTest(Provider<java.lang.String> version) |
Use the kotlin.test testing framework with a specific version.
|
void |
useSpock() |
Use the Spock Framework testing framework.
|
void |
useSpock(java.lang.String version) |
Use the Spock Framework testing framework with a specific version.
|
void |
useSpock(Provider<java.lang.String> version) |
Use the Spock Framework testing framework with a specific version.
|
void |
useTestNG() |
Use the TestNG testing framework.
|
void |
useTestNG(java.lang.String version) |
Use the TestNG testing framework with a specific version.
|
void |
useTestNG(Provider<java.lang.String> version) |
Use the TestNG testing framework with a specific version.
|
getBuildDependencies
SourceSet 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 TestSuite
Property<java.lang.String> getTestType()
UNIT_TEST
constant defined in TestSuiteType
for the built-in test suite, and to the dash-case name of the
test suite for custom test suites. Test suite types must be unique across all test suites within a project.void useJUnitJupiter()
Gradle will provide the version of JUnit Jupiter to use. Defaults to version 5.8.2
void useJUnitJupiter(java.lang.String version)
version
- version of JUnit Jupiter to usevoid useJUnitJupiter(Provider<java.lang.String> version)
version
- provider supplying the version of JUnit Jupiter to usevoid useJUnit()
Gradle will provide the version of JUnit4 to use. Defaults to version 4.13.2
void useJUnit(java.lang.String version)
version
- version of JUnit4 to usevoid useJUnit(Provider<java.lang.String> version)
version
- provider supplying the version of JUnit4 to usevoid useSpock()
Gradle will provide the version of Spock to use. Defaults to version 2.2-groovy-3.0
void useSpock(java.lang.String version)
version
- the version of Spock to usevoid useSpock(Provider<java.lang.String> version)
version
- provider supplying the version of Spock to usevoid useKotlinTest()
Gradle will provide the version of kotlin.test to use. Defaults to version 1.6.20
void useKotlinTest(java.lang.String version)
version
- the version of kotlin.test to usevoid useKotlinTest(Provider<java.lang.String> version)
version
- provider supplying 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(java.lang.String version)
version
- version of TestNG to usevoid useTestNG(Provider<java.lang.String> version)
version
- provider supplying the version of TestNG to useJvmComponentDependencies getDependencies()
void dependencies(Action<? super JvmComponentDependencies> dependencies)