8081566: java/lang/ProcessHandle/InfoTest.java failed on case sensitive command

Reviewed-by: lancea, alanb
This commit is contained in:
Roger Riggs 2015-06-01 10:29:06 -04:00
parent 0b4d0d4fec
commit ea68abc64e

View File

@ -25,6 +25,9 @@ import java.io.File;
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 @@ public class InfoTest {
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()) {