langtools/test/tools/javac/util/context/T7021650.java
changeset 10638 c8e9604cf151
parent 8614 06e42328ddab
child 14963 974d4423c999
equal deleted inserted replaced
10637:2ea5fbb913ac 10638:c8e9604cf151
    99 
    99 
   100     void compile(Context context, String... args) throws Exception {
   100     void compile(Context context, String... args) throws Exception {
   101         StringWriter sw = new StringWriter();
   101         StringWriter sw = new StringWriter();
   102         PrintWriter pw = new PrintWriter(sw);
   102         PrintWriter pw = new PrintWriter(sw);
   103         Main m = new Main("javac", pw);
   103         Main m = new Main("javac", pw);
   104         int rc = m.compile(args, context);
   104         Main.Result res = m.compile(args, context);
   105         pw.close();
   105         pw.close();
   106         String out = sw.toString();
   106         String out = sw.toString();
   107         if (!out.isEmpty())
   107         if (!out.isEmpty())
   108             System.err.println(out);
   108             System.err.println(out);
   109         if (rc != 0)
   109         if (!res.isOK())
   110             throw new Exception("compilation failed unexpectedly: rc=" + rc);
   110             throw new Exception("compilation failed unexpectedly: result=" + res);
   111     }
   111     }
   112 
   112 
   113     void checkEqual(String label, int found, int expect) throws Exception {
   113     void checkEqual(String label, int found, int expect) throws Exception {
   114         if (found != expect)
   114         if (found != expect)
   115             throw new Exception("unexpected value for " + label
   115             throw new Exception("unexpected value for " + label