1 /* |
1 /* |
2 * Copyright (c) 2006, 2015, Oracle and/or its affiliates. All rights reserved. |
2 * Copyright (c) 2006, 2016, 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. |
47 useRawMessages.setBoolean(null, true); |
47 useRawMessages.setBoolean(null, true); |
48 ByteArrayOutputStream out = new ByteArrayOutputStream(); |
48 ByteArrayOutputStream out = new ByteArrayOutputStream(); |
49 compiler.run(null, null, out, "-d", source, source); |
49 compiler.run(null, null, out, "-d", source, source); |
50 System.err.println(">>>" + out + "<<<"); |
50 System.err.println(">>>" + out + "<<<"); |
51 useRawMessages.setBoolean(null, false); |
51 useRawMessages.setBoolean(null, false); |
52 if (!out.toString().equals(String.format("%s%n%s%n", |
52 if (!out.toString().equals(String.format("%s%n", |
53 "javac: javac.err.file.not.directory", |
53 "javac: javac.err.file.not.directory"))) { |
54 "javac.msg.usage"))) { |
|
55 throw new AssertionError(out); |
54 throw new AssertionError(out); |
56 } |
55 } |
57 System.out.println("Test PASSED. Running javac again to see localized output:"); |
56 System.out.println("Test PASSED. Running javac again to see localized output:"); |
58 compiler.run(null, null, System.out, "-d", source, source); |
57 compiler.run(null, null, System.out, "-d", source, source); |
59 } |
58 } |