From 9a43d063f755a3fb2e300668f1cd5aac27019205 Mon Sep 17 00:00:00 2001 From: Michael Osipov Date: Wed, 5 Jun 2024 14:10:32 +0200 Subject: [PATCH] [SUREFIRE-1939] Build fails if java.home has <=2 path components Removes an invalid test which passes a JDK or JRE home to a method which expects the path to the Java executable. Therefore the invalid input leads to an exception. This closes #743 --- .../org/apache/maven/surefire/booter/SystemUtilsTest.java | 8 -------- 1 file changed, 8 deletions(-) diff --git a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java index 2e7017d0fc..6752ba75b8 100644 --- a/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java +++ b/surefire-booter/src/test/java/org/apache/maven/surefire/booter/SystemUtilsTest.java @@ -73,14 +73,6 @@ public void shouldParseProprietaryReleaseFile() throws IOException { assertThat(SystemUtils.isJava9AtLeast(path.getAbsolutePath())).isTrue(); } - @Test - public void incorrectJdkPath() { - File jre = new File(System.getProperty("java.home")); - File jdk = jre.getParentFile(); - File incorrect = jdk.getParentFile(); - assertThat(SystemUtils.isJava9AtLeast(incorrect.getAbsolutePath())).isFalse(); - } - @Test public void shouldHaveJavaPath() { String javaPath = System.getProperty("java.home") + separator + "bin" + separator + "java";