com.sun.tools.doclint.DocLint.BadArgs Java Examples
The following examples show how to use
com.sun.tools.doclint.DocLint.BadArgs.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source Project: TencentKona-8 Author: Tencent File: RunTest.java License: GNU General Public License v2.0 | 6 votes |
void testArgsNoFiles() throws BadArgs, IOException { System.err.println("test args, no files"); DocLint dl = new DocLint(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, "-Xmsgs"); pw.close(); String out = sw.toString(); String expect = "No files given"; if (!Objects.equals(out.trim(), expect)) { error("unexpected output"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println("FOUND>>" + out + "<<"); } }
Example #2
Source Project: TencentKona-8 Author: Tencent File: PathsTest.java License: GNU General Public License v2.0 | 6 votes |
void test(String file, String pathOpt, String path) throws BadArgs, IOException { System.err.println("test " + pathOpt); String out1 = doclint("-Xmsgs", file); if (!pkgNotFound.matcher(out1).find()) error("message not found: " + pkgNotFound); String out2 = doclint("-Xmsgs", pathOpt, path, file); if (pkgNotFound.matcher(out2).find()) error("unexpected message found: " + pkgNotFound); if (!badHtmlEntity.matcher(out1).find()) error("message not found: " + badHtmlEntity); try { doclint("-Xmsgs", pathOpt); error("expected exception not thrown"); } catch (BadArgs e) { System.err.println(e); } }
Example #3
Source Project: jdk8u60 Author: chenghanpeng File: RunTest.java License: GNU General Public License v2.0 | 6 votes |
void testArgsNoFiles() throws BadArgs, IOException { System.err.println("test args, no files"); DocLint dl = new DocLint(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, "-Xmsgs"); pw.close(); String out = sw.toString(); String expect = "No files given"; if (!Objects.equals(out.trim(), expect)) { error("unexpected output"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println("FOUND>>" + out + "<<"); } }
Example #4
Source Project: jdk8u60 Author: chenghanpeng File: PathsTest.java License: GNU General Public License v2.0 | 6 votes |
void test(String file, String pathOpt, String path) throws BadArgs, IOException { System.err.println("test " + pathOpt); String out1 = doclint("-Xmsgs", file); if (!pkgNotFound.matcher(out1).find()) error("message not found: " + pkgNotFound); String out2 = doclint("-Xmsgs", pathOpt, path, file); if (pkgNotFound.matcher(out2).find()) error("unexpected message found: " + pkgNotFound); if (!badHtmlEntity.matcher(out1).find()) error("message not found: " + badHtmlEntity); try { doclint("-Xmsgs", pathOpt); error("expected exception not thrown"); } catch (BadArgs e) { System.err.println(e); } }
Example #5
Source Project: openjdk-jdk8u Author: AdoptOpenJDK File: RunTest.java License: GNU General Public License v2.0 | 6 votes |
void testArgsNoFiles() throws BadArgs, IOException { System.err.println("test args, no files"); DocLint dl = new DocLint(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, "-Xmsgs"); pw.close(); String out = sw.toString(); String expect = "No files given"; if (!Objects.equals(out.trim(), expect)) { error("unexpected output"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println("FOUND>>" + out + "<<"); } }
Example #6
Source Project: openjdk-jdk8u Author: AdoptOpenJDK File: PathsTest.java License: GNU General Public License v2.0 | 6 votes |
void test(String file, String pathOpt, String path) throws BadArgs, IOException { System.err.println("test " + pathOpt); String out1 = doclint("-Xmsgs", file); if (!pkgNotFound.matcher(out1).find()) error("message not found: " + pkgNotFound); String out2 = doclint("-Xmsgs", pathOpt, path, file); if (pkgNotFound.matcher(out2).find()) error("unexpected message found: " + pkgNotFound); if (!badHtmlEntity.matcher(out1).find()) error("message not found: " + badHtmlEntity); try { doclint("-Xmsgs", pathOpt); error("expected exception not thrown"); } catch (BadArgs e) { System.err.println(e); } }
Example #7
Source Project: openjdk-jdk8u-backup Author: AdoptOpenJDK File: RunTest.java License: GNU General Public License v2.0 | 6 votes |
void testArgsNoFiles() throws BadArgs, IOException { System.err.println("test args, no files"); DocLint dl = new DocLint(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, "-Xmsgs"); pw.close(); String out = sw.toString(); String expect = "No files given"; if (!Objects.equals(out.trim(), expect)) { error("unexpected output"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println("FOUND>>" + out + "<<"); } }
Example #8
Source Project: openjdk-jdk8u-backup Author: AdoptOpenJDK File: PathsTest.java License: GNU General Public License v2.0 | 6 votes |
void test(String file, String pathOpt, String path) throws BadArgs, IOException { System.err.println("test " + pathOpt); String out1 = doclint("-Xmsgs", file); if (!pkgNotFound.matcher(out1).find()) error("message not found: " + pkgNotFound); String out2 = doclint("-Xmsgs", pathOpt, path, file); if (pkgNotFound.matcher(out2).find()) error("unexpected message found: " + pkgNotFound); if (!badHtmlEntity.matcher(out1).find()) error("message not found: " + badHtmlEntity); try { doclint("-Xmsgs", pathOpt); error("expected exception not thrown"); } catch (BadArgs e) { System.err.println(e); } }
Example #9
Source Project: openjdk-jdk9 Author: AdoptOpenJDK File: RunTest.java License: GNU General Public License v2.0 | 6 votes |
void testArgsNoFiles() throws BadArgs, IOException { System.err.println("test args, no files"); DocLint dl = new DocLint(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, "-Xmsgs"); pw.close(); String out = sw.toString(); String expect = "No files given"; if (!Objects.equals(out.trim(), expect)) { error("unexpected output"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println("FOUND>>" + out + "<<"); } }
Example #10
Source Project: openjdk-jdk9 Author: AdoptOpenJDK File: PathsTest.java License: GNU General Public License v2.0 | 6 votes |
void test(String file, String pathOpt, String path) throws BadArgs, IOException { System.err.println("test " + pathOpt); String out1 = doclint("-Xmsgs", file); if (!pkgNotFound.matcher(out1).find()) error("message not found: " + pkgNotFound); String out2; if (needTarget8(pathOpt)) { out2 = doclint("-Xmsgs", "-source", "8", "-target", "8", pathOpt, path, file); } else { out2 = doclint("-Xmsgs", pathOpt, path, file); } if (pkgNotFound.matcher(out2).find()) error("unexpected message found: " + pkgNotFound); if (!badHtmlEntity.matcher(out1).find()) error("message not found: " + badHtmlEntity); try { doclint("-Xmsgs", pathOpt); error("expected exception not thrown"); } catch (BadArgs e) { System.err.println(e); } }
Example #11
Source Project: hottub Author: dsrg-uoft File: RunTest.java License: GNU General Public License v2.0 | 6 votes |
void testArgsNoFiles() throws BadArgs, IOException { System.err.println("test args, no files"); DocLint dl = new DocLint(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, "-Xmsgs"); pw.close(); String out = sw.toString(); String expect = "No files given"; if (!Objects.equals(out.trim(), expect)) { error("unexpected output"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println("FOUND>>" + out + "<<"); } }
Example #12
Source Project: hottub Author: dsrg-uoft File: PathsTest.java License: GNU General Public License v2.0 | 6 votes |
void test(String file, String pathOpt, String path) throws BadArgs, IOException { System.err.println("test " + pathOpt); String out1 = doclint("-Xmsgs", file); if (!pkgNotFound.matcher(out1).find()) error("message not found: " + pkgNotFound); String out2 = doclint("-Xmsgs", pathOpt, path, file); if (pkgNotFound.matcher(out2).find()) error("unexpected message found: " + pkgNotFound); if (!badHtmlEntity.matcher(out1).find()) error("message not found: " + badHtmlEntity); try { doclint("-Xmsgs", pathOpt); error("expected exception not thrown"); } catch (BadArgs e) { System.err.println(e); } }
Example #13
Source Project: openjdk-8-source Author: keerath File: RunTest.java License: GNU General Public License v2.0 | 6 votes |
void testArgsNoFiles() throws BadArgs, IOException { System.err.println("test args, no files"); DocLint dl = new DocLint(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, "-Xmsgs"); pw.close(); String out = sw.toString(); String expect = "No files given"; if (!Objects.equals(out.trim(), expect)) { error("unexpected output"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println("FOUND>>" + out + "<<"); } }
Example #14
Source Project: openjdk-8-source Author: keerath File: PathsTest.java License: GNU General Public License v2.0 | 6 votes |
void test(String file, String pathOpt, String path) throws BadArgs, IOException { System.err.println("test " + pathOpt); String out1 = doclint("-Xmsgs", file); if (!pkgNotFound.matcher(out1).find()) error("message not found: " + pkgNotFound); String out2 = doclint("-Xmsgs", pathOpt, path, file); if (pkgNotFound.matcher(out2).find()) error("unexpected message found: " + pkgNotFound); if (!badHtmlEntity.matcher(out1).find()) error("message not found: " + badHtmlEntity); try { doclint("-Xmsgs", pathOpt); error("expected exception not thrown"); } catch (BadArgs e) { System.err.println(e); } }
Example #15
Source Project: openjdk-8 Author: bpupadhyaya File: RunTest.java License: GNU General Public License v2.0 | 6 votes |
void testArgsNoFiles() throws BadArgs, IOException { System.err.println("test args, no files"); DocLint dl = new DocLint(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, "-Xmsgs"); pw.close(); String out = sw.toString(); String expect = "No files given"; if (!Objects.equals(out.trim(), expect)) { error("unexpected output"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println("FOUND>>" + out + "<<"); } }
Example #16
Source Project: openjdk-8 Author: bpupadhyaya File: PathsTest.java License: GNU General Public License v2.0 | 6 votes |
void test(String file, String pathOpt, String path) throws BadArgs, IOException { System.err.println("test " + pathOpt); String out1 = doclint("-Xmsgs", file); if (!pkgNotFound.matcher(out1).find()) error("message not found: " + pkgNotFound); String out2 = doclint("-Xmsgs", pathOpt, path, file); if (pkgNotFound.matcher(out2).find()) error("unexpected message found: " + pkgNotFound); if (!badHtmlEntity.matcher(out1).find()) error("message not found: " + badHtmlEntity); try { doclint("-Xmsgs", pathOpt); error("expected exception not thrown"); } catch (BadArgs e) { System.err.println(e); } }
Example #17
Source Project: TencentKona-8 Author: Tencent File: RunTest.java License: GNU General Public License v2.0 | 5 votes |
void testRun() throws BadArgs, IOException { System.err.println("test run(String[])"); DocLint dl = new DocLint(); String[] args = { "-help" }; ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; try { System.setOut(ps); dl.run(args); } finally { System.setOut(prev); } ps.close(); String stdout = baos.toString(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, args); pw.close(); String direct = sw.toString(); if (!stdout.equals(direct)) { error("unexpected output"); System.err.println("EXPECT>>" + direct + "<<"); System.err.println("FOUND>>" + stdout + "<<"); } }
Example #18
Source Project: TencentKona-8 Author: Tencent File: PathsTest.java License: GNU General Public License v2.0 | 5 votes |
String doclint(String... args) throws BadArgs, IOException { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); DocLint dl = new DocLint(); dl.run(pw, args); pw.close(); String out = sw.toString(); if (!out.isEmpty()) System.err.println(out); return out; }
Example #19
Source Project: TencentKona-8 Author: Tencent File: DocLintTester.java License: GNU General Public License v2.0 | 5 votes |
void check(List<String> opts, List<File> files, boolean expectBadArgs, File refFile) throws Exception { List<String> args = new ArrayList<String>(); args.addAll(opts); for (File file: files) args.add(file.getPath()); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); try { new DocLint().run(pw, args.toArray(new String[args.size()])); if (expectBadArgs) error("expected exception not thrown"); } catch (BadArgs e) { if (!expectBadArgs) error("unexpected exception caught: " + e); } pw.flush(); String out = normalizeNewlines(removeFileNames(sw.toString())).trim(); if (out != null) System.err.println("Output:\n" + out); if (refFile == null) { if (!out.isEmpty()) error("unexpected output"); } else { String expect = readFile(refFile); if (!expect.equals(out)) { error("expected output not found"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println(" FOUND>>" + out + "<<"); } } }
Example #20
Source Project: jdk8u60 Author: chenghanpeng File: RunTest.java License: GNU General Public License v2.0 | 5 votes |
void testRun() throws BadArgs, IOException { System.err.println("test run(String[])"); DocLint dl = new DocLint(); String[] args = { "-help" }; ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; try { System.setOut(ps); dl.run(args); } finally { System.setOut(prev); } ps.close(); String stdout = baos.toString(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, args); pw.close(); String direct = sw.toString(); if (!stdout.equals(direct)) { error("unexpected output"); System.err.println("EXPECT>>" + direct + "<<"); System.err.println("FOUND>>" + stdout + "<<"); } }
Example #21
Source Project: jdk8u60 Author: chenghanpeng File: PathsTest.java License: GNU General Public License v2.0 | 5 votes |
String doclint(String... args) throws BadArgs, IOException { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); DocLint dl = new DocLint(); dl.run(pw, args); pw.close(); String out = sw.toString(); if (!out.isEmpty()) System.err.println(out); return out; }
Example #22
Source Project: jdk8u60 Author: chenghanpeng File: DocLintTester.java License: GNU General Public License v2.0 | 5 votes |
void check(List<String> opts, List<File> files, boolean expectBadArgs, File refFile) throws Exception { List<String> args = new ArrayList<String>(); args.addAll(opts); for (File file: files) args.add(file.getPath()); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); try { new DocLint().run(pw, args.toArray(new String[args.size()])); if (expectBadArgs) error("expected exception not thrown"); } catch (BadArgs e) { if (!expectBadArgs) error("unexpected exception caught: " + e); } pw.flush(); String out = normalizeNewlines(removeFileNames(sw.toString())).trim(); if (out != null) System.err.println("Output:\n" + out); if (refFile == null) { if (!out.isEmpty()) error("unexpected output"); } else { String expect = readFile(refFile); if (!expect.equals(out)) { error("expected output not found"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println(" FOUND>>" + out + "<<"); } } }
Example #23
Source Project: openjdk-jdk8u Author: AdoptOpenJDK File: RunTest.java License: GNU General Public License v2.0 | 5 votes |
void testRun() throws BadArgs, IOException { System.err.println("test run(String[])"); DocLint dl = new DocLint(); String[] args = { "-help" }; ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; try { System.setOut(ps); dl.run(args); } finally { System.setOut(prev); } ps.close(); String stdout = baos.toString(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, args); pw.close(); String direct = sw.toString(); if (!stdout.equals(direct)) { error("unexpected output"); System.err.println("EXPECT>>" + direct + "<<"); System.err.println("FOUND>>" + stdout + "<<"); } }
Example #24
Source Project: openjdk-jdk8u Author: AdoptOpenJDK File: PathsTest.java License: GNU General Public License v2.0 | 5 votes |
String doclint(String... args) throws BadArgs, IOException { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); DocLint dl = new DocLint(); dl.run(pw, args); pw.close(); String out = sw.toString(); if (!out.isEmpty()) System.err.println(out); return out; }
Example #25
Source Project: openjdk-jdk8u Author: AdoptOpenJDK File: DocLintTester.java License: GNU General Public License v2.0 | 5 votes |
void check(List<String> opts, List<File> files, boolean expectBadArgs, File refFile) throws Exception { List<String> args = new ArrayList<String>(); args.addAll(opts); for (File file: files) args.add(file.getPath()); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); try { new DocLint().run(pw, args.toArray(new String[args.size()])); if (expectBadArgs) error("expected exception not thrown"); } catch (BadArgs e) { if (!expectBadArgs) error("unexpected exception caught: " + e); } pw.flush(); String out = normalizeNewlines(removeFileNames(sw.toString())).trim(); if (out != null) System.err.println("Output:\n" + out); if (refFile == null) { if (!out.isEmpty()) error("unexpected output"); } else { String expect = readFile(refFile); if (!expect.equals(out)) { error("expected output not found"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println(" FOUND>>" + out + "<<"); } } }
Example #26
Source Project: openjdk-jdk8u-backup Author: AdoptOpenJDK File: RunTest.java License: GNU General Public License v2.0 | 5 votes |
void testRun() throws BadArgs, IOException { System.err.println("test run(String[])"); DocLint dl = new DocLint(); String[] args = { "-help" }; ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; try { System.setOut(ps); dl.run(args); } finally { System.setOut(prev); } ps.close(); String stdout = baos.toString(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, args); pw.close(); String direct = sw.toString(); if (!stdout.equals(direct)) { error("unexpected output"); System.err.println("EXPECT>>" + direct + "<<"); System.err.println("FOUND>>" + stdout + "<<"); } }
Example #27
Source Project: openjdk-jdk8u-backup Author: AdoptOpenJDK File: PathsTest.java License: GNU General Public License v2.0 | 5 votes |
String doclint(String... args) throws BadArgs, IOException { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); DocLint dl = new DocLint(); dl.run(pw, args); pw.close(); String out = sw.toString(); if (!out.isEmpty()) System.err.println(out); return out; }
Example #28
Source Project: openjdk-jdk8u-backup Author: AdoptOpenJDK File: DocLintTester.java License: GNU General Public License v2.0 | 5 votes |
void check(List<String> opts, List<File> files, boolean expectBadArgs, File refFile) throws Exception { List<String> args = new ArrayList<String>(); args.addAll(opts); for (File file: files) args.add(file.getPath()); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); try { new DocLint().run(pw, args.toArray(new String[args.size()])); if (expectBadArgs) error("expected exception not thrown"); } catch (BadArgs e) { if (!expectBadArgs) error("unexpected exception caught: " + e); } pw.flush(); String out = normalizeNewlines(removeFileNames(sw.toString())).trim(); if (out != null) System.err.println("Output:\n" + out); if (refFile == null) { if (!out.isEmpty()) error("unexpected output"); } else { String expect = readFile(refFile); if (!expect.equals(out)) { error("expected output not found"); System.err.println("EXPECT>>" + expect + "<<"); System.err.println(" FOUND>>" + out + "<<"); } } }
Example #29
Source Project: openjdk-jdk9 Author: AdoptOpenJDK File: RunTest.java License: GNU General Public License v2.0 | 5 votes |
void testRun() throws BadArgs, IOException { System.err.println("test run(String[])"); DocLint dl = new DocLint(); String[] args = { "-help" }; ByteArrayOutputStream baos = new ByteArrayOutputStream(); PrintStream ps = new PrintStream(baos); PrintStream prev = System.out; try { System.setOut(ps); dl.run(args); } finally { System.setOut(prev); } ps.close(); String stdout = baos.toString(); StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); dl.run(pw, args); pw.close(); String direct = sw.toString(); if (!stdout.equals(direct)) { error("unexpected output"); System.err.println("EXPECT>>" + direct + "<<"); System.err.println("FOUND>>" + stdout + "<<"); } }
Example #30
Source Project: openjdk-jdk9 Author: AdoptOpenJDK File: PathsTest.java License: GNU General Public License v2.0 | 5 votes |
String doclint(String... args) throws BadArgs, IOException { StringWriter sw = new StringWriter(); PrintWriter pw = new PrintWriter(sw); DocLint dl = new DocLint(); dl.run(pw, args); pw.close(); String out = sw.toString(); if (!out.isEmpty()) System.err.println(out); return out; }