@@ -36,7 +36,7 @@ class ModulePluginSmokeTest {
3636 @ SuppressWarnings ("unused" )
3737 private enum GradleVersion {
3838 v8_11 , v8_14_3 ,
39- v9_0 , v9_1_0
39+ v9_0 , v9_2_0
4040 ;
4141
4242 @ Override
@@ -58,14 +58,11 @@ void before() throws IOException {
5858 void smokeTest (
5959 @ CartesianTest .Values (strings = {
6060 "test-project" ,
61- "test-project-kotlin-pre-1-7" ,
6261 "test-project-kotlin" ,
6362 "test-project-groovy"
6463 }) String projectName ,
6564 @ CartesianTest .Enum GradleVersion gradleVersion ) {
6665 LOGGER .lifecycle ("Executing smokeTest of {} with Gradle {}" , projectName , gradleVersion );
67- assumeTrue (jdkSupported (gradleVersion ));
68- assumeTrue (checkKotlinCombination (projectName , gradleVersion ));
6966 var result = GradleRunner .create ()
7067 .withProjectDir (new File (projectName + "/" ))
7168 .withPluginClasspath (pluginClasspath )
@@ -88,14 +85,11 @@ void smokeTest(
8885 void smokeTestRun (
8986 @ CartesianTest .Values (strings = {
9087 "test-project" ,
91- "test-project-kotlin-pre-1-7" ,
9288 "test-project-kotlin" ,
9389 "test-project-groovy"
9490 }) String projectName ,
9591 @ CartesianTest .Enum GradleVersion gradleVersion ) {
9692 LOGGER .lifecycle ("Executing smokeTestRun of {} with Gradle {}" , projectName , gradleVersion );
97- assumeTrue (jdkSupported (gradleVersion ));
98- assumeTrue (checkKotlinCombination (projectName , gradleVersion ));
9993 var writer = new StringWriter (256 );
10094 var result = GradleRunner .create ()
10195 .withProjectDir (new File (projectName + "/" ))
@@ -117,18 +111,14 @@ void smokeTestRun(
117111 @ CartesianTest (name = "smokeTestJunit5({arguments})" )
118112 void smokeTestJunit5 (
119113 @ CartesianTest .Values (strings = {
120- "5.4.2/1.4.2" ,
121- "5.5.2/1.5.2" ,
122- "5.7.1/1.7.1" ,
123114 "5.8.0/1.8.0" ,
124- "5.10.2/1.10.2"
115+ "5.10.2/1.10.2" ,
116+ "5.14.0/1.14.0"
125117 }) String junitVersionPair ,
126118 @ CartesianTest .Enum GradleVersion gradleVersion ) {
127119 LOGGER .lifecycle ("Executing smokeTestJunit5 with junitVersionPair {} and Gradle {}" , junitVersionPair , gradleVersion );
128- assumeTrue (jdkSupported (gradleVersion ));
129120 var junitVersionParts = junitVersionPair .split ("/" );
130121 final String junitVersion = junitVersionParts [0 ];
131- assumeTrue (checkJUnitCombination (junitVersion , gradleVersion ));
132122 var junitVersionProperty = String .format ("-PjUnitVersion=%s" , junitVersion );
133123 var junitPlatformVersionProperty = String .format ("-PjUnitPlatformVersion=%s" , junitVersionParts [1 ]);
134124 var result = GradleRunner .create ()
@@ -148,7 +138,6 @@ void smokeTestJunit5(
148138 @ CartesianTest (name = "smokeTestMixed({arguments})" )
149139 void smokeTestMixed (@ CartesianTest .Enum GradleVersion gradleVersion ) {
150140 LOGGER .lifecycle ("Executing smokeTestMixed with Gradle {}" , gradleVersion );
151- assumeTrue (jdkSupported (gradleVersion ));
152141 var result = GradleRunner .create ()
153142 .withProjectDir (new File ("test-project-mixed" ))
154143 .withPluginClasspath (pluginClasspath )
@@ -200,14 +189,11 @@ private static void assertExpectedClassFileFormats(
200189 void smokeTestDist (
201190 @ CartesianTest .Values (strings = {
202191 "test-project" ,
203- "test-project-kotlin-pre-1-7" ,
204192 "test-project-kotlin" ,
205193 "test-project-groovy"
206194 }) String projectName ,
207195 @ CartesianTest .Enum GradleVersion gradleVersion ) {
208196 LOGGER .lifecycle ("Executing smokeTestDist of {} with Gradle {}" , projectName , gradleVersion );
209- assumeTrue (jdkSupported (gradleVersion ));
210- assumeTrue (checkKotlinCombination (projectName , gradleVersion ));
211197 var result = GradleRunner .create ()
212198 .withProjectDir (new File (projectName + "/" ))
213199 .withPluginClasspath (pluginClasspath )
@@ -247,14 +233,11 @@ void smokeTestDist(
247233 void smokeTestRunDemo (
248234 @ CartesianTest .Values (strings = {
249235 "test-project" ,
250- "test-project-kotlin-pre-1-7" ,
251236 "test-project-kotlin" ,
252237 "test-project-groovy"
253238 }) String projectName ,
254239 @ CartesianTest .Enum GradleVersion gradleVersion ) {
255240 LOGGER .lifecycle ("Executing smokeTestRunDemo of {} with Gradle {}" , projectName , gradleVersion );
256- assumeTrue (jdkSupported (gradleVersion ));
257- assumeTrue (checkKotlinCombination (projectName , gradleVersion ));
258241 var result = GradleRunner .create ()
259242 .withProjectDir (new File (projectName + "/" ))
260243 .withPluginClasspath (pluginClasspath )
@@ -272,14 +255,11 @@ void smokeTestRunDemo(
272255 void smokeTestRunStartScripts (
273256 @ CartesianTest .Values (strings = {
274257 "test-project" ,
275- "test-project-kotlin-pre-1-7" ,
276258 "test-project-kotlin" ,
277259 "test-project-groovy"
278260 }) String projectName ,
279261 @ CartesianTest .Enum GradleVersion gradleVersion ) {
280262 LOGGER .lifecycle ("Executing smokeTestRunScripts of {} with Gradle {}" , projectName , gradleVersion );
281- assumeTrue (jdkSupported (gradleVersion ));
282- assumeTrue (checkKotlinCombination (projectName , gradleVersion ));
283263 var result = GradleRunner .create ()
284264 .withProjectDir (new File (projectName + "/" ))
285265 .withPluginClasspath (pluginClasspath )
@@ -313,54 +293,4 @@ private static void assertOutputDoesNotContain(BuildResult result, String text)
313293 final String output = result .getOutput ();
314294 assertFalse (output .contains (text ), "Output should not contain '" + text + "', but was: " + output );
315295 }
316-
317- private static boolean checkKotlinCombination (String projectName , GradleVersion gradleVersion ) {
318- final boolean kotlin_NotSupported = projectName .startsWith ("test-project-kotlin" ) && gradleVersion .toString ().compareTo ("6.4" ) < 0 ;
319- final boolean kotlinPost1_7_NotSupported = projectName .equals ("test-project-kotlin" ) && gradleVersion .toString ().compareTo ("6.6" ) < 0 ;
320- final boolean kotlinPre1_7_NotSupported = projectName .equals ("test-project-kotlin-pre-1-7" ) && gradleVersion .toString ().compareTo ("8.0" ) >= 0 ;
321- if (kotlin_NotSupported || kotlinPost1_7_NotSupported || kotlinPre1_7_NotSupported ) {
322- LOGGER .lifecycle ("Unsupported combination: {} / Gradle {}. Test skipped" , projectName , gradleVersion );
323- return false ;
324- }
325- return true ;
326- }
327-
328- private boolean checkJUnitCombination (final String junitVersion , final GradleVersion gradleVersion ) {
329- final boolean gradleEighthPlus = gradleVersion .ordinal () >= GradleVersion .v8_11 .ordinal ();
330- final Matcher m = SEMANTIC_VERSION .matcher (junitVersion );
331- assumeTrue (m .matches (), "JUnit version not semantic: " + junitVersion );
332- final boolean junitOlderThan5_8_0 = Integer .parseInt (m .group ("major" )) < 5 ||
333- (Integer .parseInt (m .group ("major" )) == 5 && Integer .parseInt (m .group ("minor" )) < 8 );
334-
335- if (gradleEighthPlus && junitOlderThan5_8_0 ) {
336- LOGGER .lifecycle ("Unsupported JUnit and Gradle combination. Gradle: {}, JUnit: {}: Test skipped" , gradleVersion , junitVersion );
337- return false ;
338- }
339- return true ;
340- }
341-
342- private static int javaMajorVersion () {
343- final String version = System .getProperty ("java.version" );
344-
345- // Java 9+ (9.0.1, 11.0.2, 17.0.2 format)
346- int dotIndex = version .indexOf ("." );
347- if (dotIndex == -1 ) {
348- // Handle cases like "17" without dot
349- return Integer .parseInt (version );
350- }
351-
352- return Integer .parseInt (version .substring (0 , dotIndex ));
353- }
354-
355- private boolean jdkSupported (final GradleVersion gradleVersion ) {
356- final int javaMajor = javaMajorVersion ();
357-
358- // All supported Gradle versions (8.11+) require Java 17+
359- if (javaMajor < 17 ) {
360- LOGGER .lifecycle ("Gradle {} requires Java 17+, but running Java {}: Test skipped" , gradleVersion , javaMajor );
361- return false ;
362- }
363-
364- return true ;
365- }
366296}
0 commit comments