53 FileObject cls = fm.getFileForOutput(CLASS_OUTPUT, |
53 FileObject cls = fm.getFileForOutput(CLASS_OUTPUT, |
54 "com.sun.foo.bar.baz", |
54 "com.sun.foo.bar.baz", |
55 "package-info.class", |
55 "package-info.class", |
56 src); |
56 src); |
57 File expect = new File(test_src, "package-info.class"); |
57 File expect = new File(test_src, "package-info.class"); |
58 File got = getUnderlyingFile(cls); |
58 File got = fm.asPath(cls).toFile(); |
59 if (!got.equals(expect)) |
59 if (!got.equals(expect)) |
60 throw new AssertionError(String.format("Expected: %s; got: %s", expect, got)); |
60 throw new AssertionError(String.format("Expected: %s; got: %s", expect, got)); |
61 System.err.println("Expected: " + expect); |
61 System.err.println("Expected: " + expect); |
62 System.err.println("Got: " + got); |
62 System.err.println("Got: " + got); |
63 } |
|
64 |
|
65 private File getUnderlyingFile(FileObject o) throws Exception { |
|
66 Field file = o.getClass().getDeclaredField("file"); // assumes RegularFileObject |
|
67 file.setAccessible(true); |
|
68 return ((Path)file.get(o)).toFile(); |
|
69 } |
63 } |
70 |
64 |
71 public static void main(String... args) throws Exception { |
65 public static void main(String... args) throws Exception { |
72 try (T6440528 t = new T6440528()) { |
66 try (T6440528 t = new T6440528()) { |
73 t.test(args); |
67 t.test(args); |