Mercurial > hg > openjdk > jdk9 > langtools
changeset 1171:a07eef109532
7046929: tools/javac/api/T6397104.java fails
Reviewed-by: jjg
author | jjh |
---|---|
date | Tue, 03 Jan 2012 17:18:10 -0800 |
parents | 7a836147b266 |
children | 4e8aa6eca726 70d92518063e |
files | test/tools/javac/api/T6397104.java |
diffstat | 1 files changed, 9 insertions(+), 5 deletions(-) [+] |
line wrap: on
line diff
--- a/test/tools/javac/api/T6397104.java Tue Jan 03 11:37:00 2012 -0800 +++ b/test/tools/javac/api/T6397104.java Tue Jan 03 17:18:10 2012 -0800 @@ -26,10 +26,10 @@ * @bug 6397104 * @summary JSR 199: JavaFileManager.getFileForOutput should have sibling argument * @author Peter von der Ah\u00e9 - * @ignore this test should be rewritten when fixing 6473901 */ import java.io.File; +import java.net.URI; import java.util.Arrays; import javax.tools.*; import javax.tools.JavaFileManager.Location; @@ -52,10 +52,14 @@ : fm.getJavaFileObjectsFromFiles(Arrays.asList(siblingFile)).iterator().next(); FileObject fileObject = fm.getFileForOutput(location, "java.lang", relName, sibling); - if (!fileObject.toUri().getPath().equals(expectedPath)) - throw new AssertionError("Expected " + expectedPath + - ", got " + fileObject.toUri().getPath()); - System.out.format("OK: (%s, %s) => %s%n", siblingFile, relName, fileObject.toUri()); + + File expectedFile = new File(expectedPath).getCanonicalFile(); + File fileObjectFile = new File(fileObject.toUri()).getCanonicalFile(); + + if (!fileObjectFile.equals(expectedFile)) + throw new AssertionError("Expected " + expectedFile + + ", got " + fileObjectFile); + System.out.format("OK: (%s, %s) => %s%n", siblingFile, relName, fileObjectFile); } void test(boolean hasLocation, File siblingFile, String relName, String expectedPath)