74 } |
74 } |
75 |
75 |
76 void run() throws Exception { |
76 void run() throws Exception { |
77 compiler = ToolProvider.getSystemJavaCompiler(); |
77 compiler = ToolProvider.getSystemJavaCompiler(); |
78 fileManager = compiler.getStandardFileManager(null, null, null); |
78 fileManager = compiler.getStandardFileManager(null, null, null); |
79 |
79 try { |
80 // basic output path |
80 // basic output path |
81 testClassOutput(); |
81 testClassOutput(); |
82 |
82 |
83 // basic search paths |
83 // basic search paths |
84 testClassPath(); |
84 testClassPath(); |
85 testSourcePath(); |
85 testSourcePath(); |
86 testPlatformClassPath(); |
86 testPlatformClassPath(); |
87 |
87 |
88 // annotation processing |
88 // annotation processing |
89 testAnnotationProcessorPath(); |
89 testAnnotationProcessorPath(); |
90 testSourceOutput(); |
90 testSourceOutput(); |
91 |
91 |
92 // javah equivalent |
92 // javah equivalent |
93 testNativeHeaderOutput(); |
93 testNativeHeaderOutput(); |
94 |
94 |
95 // future-proof: guard against new StandardLocations being added |
95 // future-proof: guard against new StandardLocations being added |
96 if (!tested.equals(EnumSet.allOf(StandardLocation.class))) { |
96 if (!tested.equals(EnumSet.allOf(StandardLocation.class))) { |
97 error("not all standard locations have been tested"); |
97 error("not all standard locations have been tested"); |
98 out.println("not yet tested: " + EnumSet.complementOf(tested)); |
98 out.println("not yet tested: " + EnumSet.complementOf(tested)); |
99 } |
99 } |
100 |
100 |
101 if (errors > 0) { |
101 if (errors > 0) { |
102 throw new Exception(errors + " errors occurred"); |
102 throw new Exception(errors + " errors occurred"); |
|
103 } |
|
104 } finally { |
|
105 fileManager.close(); |
103 } |
106 } |
104 } |
107 } |
105 |
108 |
106 void testClassOutput() throws IOException { |
109 void testClassOutput() throws IOException { |
107 String test = "testClassOutput"; |
110 String test = "testClassOutput"; |