From 670cbb9aedc3100621a57d161179179b693b378c Mon Sep 17 00:00:00 2001 From: Sam Brannen Date: Tue, 3 Sep 2019 12:40:26 +0200 Subject: [PATCH] Simplify Gradle test task configuration As an added bonus, AbstractViewTests is now executed in the build. --- build.gradle | 9 ++------- spring-test/spring-test.gradle | 5 ++--- 2 files changed, 4 insertions(+), 10 deletions(-) diff --git a/build.gradle b/build.gradle index 972dea20c7..47deb5a118 100644 --- a/build.gradle +++ b/build.gradle @@ -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 { diff --git a/spring-test/spring-test.gradle b/spring-test/spring-test.gradle index eecb34b843..894a06344f 100644 --- a/spring-test/spring-test.gradle +++ b/spring-test/spring-test.gradle @@ -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