1 /* |
1 /* |
2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
4 * |
4 * |
5 * This code is free software; you can redistribute it and/or modify it |
5 * This code is free software; you can redistribute it and/or modify it |
6 * under the terms of the GNU General Public License version 2 only, as |
6 * under the terms of the GNU General Public License version 2 only, as |
7 * published by the Free Software Foundation. |
7 * published by the Free Software Foundation. |
56 System.exit(1); |
56 System.exit(1); |
57 } |
57 } |
58 } |
58 } |
59 }; |
59 }; |
60 |
60 |
61 StandardJavaFileManager sjfm = javac.getStandardFileManager(dl,null,null); |
61 try (StandardJavaFileManager sjfm = javac.getStandardFileManager(dl,null,null)) { |
62 |
62 |
63 List<String> opts = new ArrayList<String>(); |
63 List<String> opts = new ArrayList<String>(); |
64 opts.add("-proc:only"); |
64 opts.add("-proc:only"); |
65 opts.add("-processor"); |
65 opts.add("-processor"); |
66 opts.add("AnnoProcessor"); |
66 opts.add("AnnoProcessor"); |
67 |
67 |
68 boolean xxx; |
68 boolean xxx; |
69 |
69 |
70 System.err.println("\n-- " + name); |
70 System.err.println("\n-- " + name); |
71 task2 = javac.getTask(pw, sjfm, dl, opts, Arrays.asList(name), null); |
71 task2 = javac.getTask(pw, sjfm, dl, opts, Arrays.asList(name), null); |
72 xxx = task2.call(); |
72 xxx = task2.call(); |
73 |
73 |
74 String out = sw.toString(); |
74 String out = sw.toString(); |
75 System.err.println(out); |
75 System.err.println(out); |
76 if (out.contains("Assert")) { |
76 if (out.contains("Assert")) { |
77 System.err.println("--Failed: Assertion failure"); |
77 System.err.println("--Failed: Assertion failure"); |
78 System.exit(1); |
78 System.exit(1); |
79 } |
79 } |
80 if (!out.contains(expectedMsg)) { |
80 if (!out.contains(expectedMsg)) { |
81 System.err.println("--Failed: Expected diagnostic not found"); |
81 System.err.println("--Failed: Expected diagnostic not found"); |
82 System.exit(1); |
82 System.exit(1); |
|
83 } |
83 } |
84 } |
84 } |
85 } |
85 } |
86 } |