Browse Source

Simplify Gradle test task configuration

As an added bonus, AbstractViewTests is now executed in the build.
pull/23580/head
Sam Brannen 5 years ago
parent
commit
670cbb9aed
  1. 9
      build.gradle
  2. 5
      spring-test/spring-test.gradle

9
build.gradle

@ -317,16 +317,11 @@ configure([rootProject] + javaProjects) { project -> @@ -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 {

5
spring-test/spring-test.gradle

@ -74,22 +74,21 @@ dependencies { @@ -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…
Cancel
Save