Package org.gradle.api.plugins.jvm
Interface JvmTestSuite
A test suite is a collection of JVM-based tests.
 
Each test suite consists of
- A SourceSet
- A set of compile and runtime dependencies
- One or more targets
- A testing framework
Based on the testing framework declared, Gradle will automatically add the appropriate dependencies and configure the underlying test task.
- Since:
- 7.3
- 
Nested Class SummaryNested classes/interfaces inherited from interface org.gradle.api.NamedNamed.Namer
- 
Method SummaryModifier and TypeMethodDescriptionvoiddependencies(Action<? super JvmComponentDependencies> dependencies) Configure dependencies for this component.Dependency handler for this component.Returns the container ofJvmTestSuiteTargetobjects part of this suite.Collection of test suite targets.voidConfigure the sources for this test suite.voiduseJUnit()Use the JUnit4 testing framework.voidUse the JUnit4 testing framework with a specific version.voidUse the JUnit4 testing framework with a specific version.voidUse the JUnit Jupiter testing framework.voiduseJUnitJupiter(String version) Use the JUnit Jupiter testing framework with a specific version.voiduseJUnitJupiter(Provider<String> version) Use the JUnit Jupiter testing framework with a specific version.voidUse the kotlin.test testing framework.voiduseKotlinTest(String version) Use the kotlin.test testing framework with a specific version.voiduseKotlinTest(Provider<String> version) Use the kotlin.test testing framework with a specific version.voiduseSpock()Use the Spock Framework testing framework.voidUse the Spock Framework testing framework with a specific version.voidUse the Spock Framework testing framework with a specific version.voidUse the TestNG testing framework.voidUse the TestNG testing framework with a specific version.voidUse the TestNG testing framework with a specific version.Methods inherited from interface org.gradle.api.BuildablegetBuildDependencies
- 
Method Details- 
getSourcesSourceSet getSources()Returns the container ofJvmTestSuiteTargetobjects part of this suite. Source set associated with this test suite. The name of this source set is the same as the test suite.- Returns:
- source set for this test suite.
 
- 
sourcesConfigure the sources for this test suite.- Parameters:
- configuration- configuration applied against the SourceSet for this test suite
 
- 
getTargetsExtensiblePolymorphicDomainObjectContainer<? extends JvmTestSuiteTarget> getTargets()Collection of test suite targets. Each test suite target executes the tests in this test suite with a particular context and task.- Specified by:
- getTargetsin interface- TestSuite
- Returns:
- collection of test suite targets.
 
- 
useJUnitJupitervoid useJUnitJupiter()Use the JUnit Jupiter testing framework.Gradle will provide the version of JUnit Jupiter to use. Defaults to version 5.8.2
- 
useJUnitJupiterUse the JUnit Jupiter testing framework with a specific version.- Parameters:
- version- version of JUnit Jupiter to use
 
- 
useJUnitJupiterUse the JUnit Jupiter testing framework with a specific version.- Parameters:
- version- provider supplying the version of JUnit Jupiter to use
- Since:
- 7.6
 
- 
useJUnitvoid useJUnit()Use the JUnit4 testing framework.Gradle will provide the version of JUnit4 to use. Defaults to version 4.13.2
- 
useJUnitUse the JUnit4 testing framework with a specific version.- Parameters:
- version- version of JUnit4 to use
 
- 
useJUnitUse the JUnit4 testing framework with a specific version.- Parameters:
- version- provider supplying the version of JUnit4 to use
- Since:
- 7.6
 
- 
useSpockvoid useSpock()Use the Spock Framework testing framework.Gradle will provide the version of Spock to use. Defaults to version 2.2-groovy-3.0
- 
useSpockUse the Spock Framework testing framework with a specific version.- Parameters:
- version- the version of Spock to use
 
- 
useSpockUse the Spock Framework testing framework with a specific version.- Parameters:
- version- provider supplying the version of Spock to use
- Since:
- 7.6
 
- 
useKotlinTestvoid useKotlinTest()Use the kotlin.test testing framework.Gradle will provide the version of kotlin.test to use. Defaults to version 1.6.20
- 
useKotlinTestUse the kotlin.test testing framework with a specific version.- Parameters:
- version- the version of kotlin.test to use
 
- 
useKotlinTestUse the kotlin.test testing framework with a specific version.- Parameters:
- version- provider supplying the version of kotlin.test to use
- Since:
- 7.6
 
- 
useTestNGvoid useTestNG()Use the TestNG testing framework.Gradle will provide the version of TestNG to use. Defaults to version 7.4.0
- 
useTestNGUse the TestNG testing framework with a specific version.- Parameters:
- version- version of TestNG to use
 
- 
useTestNGUse the TestNG testing framework with a specific version.- Parameters:
- version- provider supplying the version of TestNG to use
- Since:
- 7.6
 
- 
getDependenciesJvmComponentDependencies getDependencies()Dependency handler for this component.- Returns:
- dependency handler
 
- 
dependenciesConfigure dependencies for this component.
 
-