8081566: java/lang/ProcessHandle/InfoTest.java failed on case sensitive command
authorrriggs
Mon, 01 Jun 2015 10:29:06 -0400
changeset 30903 0c7d705209c6
parent 30902 cf3d869e9f79
child 30904 ec0224270f90
child 30908 900ee6d02a1e
8081566: java/lang/ProcessHandle/InfoTest.java failed on case sensitive command Reviewed-by: lancea, alanb
jdk/test/java/lang/ProcessHandle/InfoTest.java
--- a/jdk/test/java/lang/ProcessHandle/InfoTest.java	Mon Jun 01 10:27:24 2015 -0400
+++ b/jdk/test/java/lang/ProcessHandle/InfoTest.java	Mon Jun 01 10:29:06 2015 -0400
@@ -25,6 +25,9 @@
 import java.io.BufferedReader;
 import java.io.IOException;
 import java.lang.ProcessBuilder;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
 import java.time.Duration;
 import java.time.Instant;
 import java.time.temporal.ChronoUnit;
@@ -148,8 +151,10 @@
                         String javaExe = System.getProperty("test.jdk") +
                                 File.separator + "bin" + File.separator + "java";
                         String expected = Platform.isWindows() ? javaExe + ".exe" : javaExe;
-                        Assert.assertEquals(command.get(), expected,
-                                "Command: expected: 'java'" + ", actual: " + command);
+                        Path expectedPath = Paths.get(expected);
+                        Path actualPath = Paths.get(command.get());
+                        Assert.assertTrue(Files.isSameFile(expectedPath, actualPath),
+                                "Command: expected: " + javaExe + ", actual: " + command.get());
                     }
 
                     if (info.arguments().isPresent()) {