Simplify Gradle test task configuration
As an added bonus, AbstractViewTests is now executed in the build.
This commit is contained in:
parent
280a1b8880
commit
670cbb9aed
|
@ -317,16 +317,11 @@ configure([rootProject] + javaProjects) { project ->
|
|||
}
|
||||
|
||||
test {
|
||||
useJUnitPlatform()
|
||||
include(["**/*Tests.class", "**/*Test.class"])
|
||||
systemProperty("java.awt.headless", "true")
|
||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||
systemProperty("io.netty.leakDetection.level", "paranoid")
|
||||
useJUnitPlatform()
|
||||
scanForTestClasses = false
|
||||
include(["**/*Tests.class", "**/*Test.class"])
|
||||
// Since we set scanForTestClasses to false, we need to filter out inner
|
||||
// classes with the "$" pattern; otherwise, using -Dtest.single=MyTests to
|
||||
// run MyTests by itself will fail if MyTests contains any inner classes.
|
||||
exclude(["**/Abstract*.class", '**/*$*'])
|
||||
}
|
||||
|
||||
checkstyle {
|
||||
|
|
|
@ -74,22 +74,21 @@ dependencies {
|
|||
|
||||
task junit(type: Test) {
|
||||
description = "Runs JUnit 4 and JUnit Jupiter tests."
|
||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||
useJUnitPlatform {
|
||||
excludeTags "failing-test-case"
|
||||
}
|
||||
include(["**/*Tests.class", "**/*Test.class"])
|
||||
exclude(["**/testng/**/*.*"])
|
||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||
// Java Util Logging for the JUnit Platform.
|
||||
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
|
||||
}
|
||||
|
||||
task testNG(type: Test) {
|
||||
description = "Runs TestNG tests."
|
||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||
useTestNG()
|
||||
scanForTestClasses = false
|
||||
include(["**/testng/**/*Tests.class", "**/testng/**/*Test.class"])
|
||||
systemProperty("testGroups", project.properties.get("testGroups"))
|
||||
// Show STD_OUT & STD_ERR of the test JVM(s) on the console:
|
||||
// testLogging.showStandardStreams = true
|
||||
// forkEvery 1
|
||||
|
|
Loading…
Reference in New Issue