Tue, 03 Jan 2012 17:18:10 -0800
7046929: tools/javac/api/T6397104.java fails
Reviewed-by: jjg
test/tools/javac/api/T6397104.java | file | annotate | diff | comparison | revisions |
1.1 --- a/test/tools/javac/api/T6397104.java Tue Jan 03 11:37:00 2012 -0800 1.2 +++ b/test/tools/javac/api/T6397104.java Tue Jan 03 17:18:10 2012 -0800 1.3 @@ -26,10 +26,10 @@ 1.4 * @bug 6397104 1.5 * @summary JSR 199: JavaFileManager.getFileForOutput should have sibling argument 1.6 * @author Peter von der Ah\u00e9 1.7 - * @ignore this test should be rewritten when fixing 6473901 1.8 */ 1.9 1.10 import java.io.File; 1.11 +import java.net.URI; 1.12 import java.util.Arrays; 1.13 import javax.tools.*; 1.14 import javax.tools.JavaFileManager.Location; 1.15 @@ -52,10 +52,14 @@ 1.16 : fm.getJavaFileObjectsFromFiles(Arrays.asList(siblingFile)).iterator().next(); 1.17 FileObject fileObject = 1.18 fm.getFileForOutput(location, "java.lang", relName, sibling); 1.19 - if (!fileObject.toUri().getPath().equals(expectedPath)) 1.20 - throw new AssertionError("Expected " + expectedPath + 1.21 - ", got " + fileObject.toUri().getPath()); 1.22 - System.out.format("OK: (%s, %s) => %s%n", siblingFile, relName, fileObject.toUri()); 1.23 + 1.24 + File expectedFile = new File(expectedPath).getCanonicalFile(); 1.25 + File fileObjectFile = new File(fileObject.toUri()).getCanonicalFile(); 1.26 + 1.27 + if (!fileObjectFile.equals(expectedFile)) 1.28 + throw new AssertionError("Expected " + expectedFile + 1.29 + ", got " + fileObjectFile); 1.30 + System.out.format("OK: (%s, %s) => %s%n", siblingFile, relName, fileObjectFile); 1.31 } 1.32 1.33 void test(boolean hasLocation, File siblingFile, String relName, String expectedPath)