File tree 2 files changed +12
-8
lines changed
buildSrc/src/main/java/org/springframework/build
2 files changed +12
-8
lines changed Original file line number Diff line number Diff line change 21
21
import org .gradle .api .Project ;
22
22
import org .gradle .api .plugins .JavaBasePlugin ;
23
23
import org .gradle .api .tasks .testing .Test ;
24
+ import org .gradle .api .tasks .testing .TestFrameworkOptions ;
25
+ import org .gradle .api .tasks .testing .junitplatform .JUnitPlatformOptions ;
24
26
import org .gradle .testretry .TestRetryPlugin ;
25
27
import org .gradle .testretry .TestRetryTaskExtension ;
26
28
34
36
*
35
37
* @author Brian Clozel
36
38
* @author Andy Wilkinson
39
+ * @author Sam Brannen
37
40
*/
38
41
class TestConventions {
39
42
@@ -50,7 +53,12 @@ private void configureTestConventions(Project project) {
50
53
}
51
54
52
55
private void configureTests (Project project , Test test ) {
53
- test .useJUnitPlatform ();
56
+ TestFrameworkOptions existingOptions = test .getOptions ();
57
+ test .useJUnitPlatform (options -> {
58
+ if (existingOptions instanceof JUnitPlatformOptions junitPlatformOptions ) {
59
+ options .copyFrom (junitPlatformOptions );
60
+ }
61
+ });
54
62
test .include ("**/*Tests.class" , "**/*Test.class" );
55
63
test .setSystemProperties (Map .of (
56
64
"java.awt.headless" , "true" ,
Original file line number Diff line number Diff line change @@ -104,14 +104,10 @@ test {
104
104
description = " Runs JUnit 4, JUnit Jupiter, and TestNG tests."
105
105
useJUnitPlatform {
106
106
includeEngines " junit-vintage" , " junit-jupiter" , " testng"
107
- excludeTags " failing-test-case"
108
107
}
109
- // We use `include` instead of `filter.includeTestsMatching`, since
110
- // the latter results in some tests being executed/reported
111
- // multiple times.
112
- include([" **/*Tests.class" , " **/*Test.class" ])
108
+ // `include` test filters and system properties are configured in
109
+ // org.springframework.build.TestConventions in buildSrc.
113
110
filter. excludeTestsMatching(" *TestCase" )
114
- systemProperty(" testGroups" , project. properties. get(" testGroups" ))
115
- // Java Util Logging for the JUnit Platform.
111
+ // Optionally configure Java Util Logging for the JUnit Platform.
116
112
// systemProperty("java.util.logging.manager", "org.apache.logging.log4j.jul.LogManager")
117
113
}
You can’t perform that action at this time.
0 commit comments