langtools/test/tools/javac/fatalErrors/NoJavaLangTest.java
changeset 36778 e04318f39f92
parent 36526 3b41f1c69604
child 40308 274367a99f98
--- a/langtools/test/tools/javac/fatalErrors/NoJavaLangTest.java	Thu Mar 31 14:56:33 2016 -0700
+++ b/langtools/test/tools/javac/fatalErrors/NoJavaLangTest.java	Thu Mar 31 15:20:50 2016 -0700
@@ -24,18 +24,20 @@
 /*
  * @test
  * @bug 4263768 4785453
- * @summary Verify that the compiler does not crash when java.lang is not
+ * @summary Verify that the compiler does not crash when java.lang is not available
  * @library /tools/lib
  * @modules jdk.compiler/com.sun.tools.javac.api
- *          jdk.compiler/com.sun.tools.javac.file
  *          jdk.compiler/com.sun.tools.javac.main
- *          jdk.jdeps/com.sun.tools.javap
- * @build ToolBox
+ * @build toolbox.ToolBox toolbox.JavacTask
  * @run main NoJavaLangTest
  */
 
 import java.nio.file.*;
 
+import toolbox.JavacTask;
+import toolbox.Task;
+import toolbox.ToolBox;
+
 public class NoJavaLangTest {
 
     private static final String noJavaLangSrc =
@@ -64,7 +66,7 @@
 
     // sanity check, with java.lang available
     void testStandard() {
-        tb.new JavacTask()
+        new JavacTask(tb)
                 .sources(noJavaLangSrc)
                 .run();
     }
@@ -80,7 +82,7 @@
     void testModulePath() throws Exception {
         // need to ensure there is an empty java.base to avoid different error message
         Files.createDirectories(Paths.get("modules/java.base"));
-        tb.new JavacTask()
+        new JavacTask(tb)
                 .sources("module java.base { }")
                 .outdir("modules/java.base")
                 .run();
@@ -93,12 +95,12 @@
     private void test(String[] options, String expect) {
         System.err.println("Testing " + java.util.Arrays.toString(options));
 
-        String out = tb.new JavacTask()
+        String out = new JavacTask(tb)
                 .options(options)
                 .sources(noJavaLangSrc)
-                .run(ToolBox.Expect.FAIL, 3)
+                .run(Task.Expect.FAIL, 3)
                 .writeAll()
-                .getOutput(ToolBox.OutputKind.DIRECT);
+                .getOutput(Task.OutputKind.DIRECT);
 
         if (!out.trim().equals(expect)) {
             throw new AssertionError("javac generated error output is not correct");