Java Code Examples for com.sun.tools.doclint.DocLint#run()

The following examples show how to use com.sun.tools.doclint.DocLint#run() . 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: jdk8u60   File: RunTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
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
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 3
Source Project: openjdk-8   File: RunTest.java    License: GNU General Public License v2.0 6 votes vote down vote up
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
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 5
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 6
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 7
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 8
Source Project: hottub   File: RunTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
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 9
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 10
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 11
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 12
Source Project: hottub   File: PathsTest.java    License: GNU General Public License v2.0 5 votes vote down vote up
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 13
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 14
@Test
void testMain(PrintWriter pw) throws BadArgs, IOException {
    String[] args = { "-Xmsgs", thisFile.getPath() };
    DocLint d = new DocLint();
    d.run(pw, args);
}
 
Example 15
Source Project: openjdk-8   File: RunTest.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Test
void testMain(PrintWriter pw) throws BadArgs, IOException {
    String[] args = { "-Xmsgs", thisFile.getPath() };
    DocLint d = new DocLint();
    d.run(pw, args);
}
 
Example 16
@Test
void testMain(PrintWriter pw) throws BadArgs, IOException {
    String[] args = { "-Xmsgs", thisFile.getPath() };
    DocLint d = new DocLint();
    d.run(pw, args);
}
 
Example 17
Source Project: hottub   File: RunTest.java    License: GNU General Public License v2.0 4 votes vote down vote up
@Test
void testMain(PrintWriter pw) throws BadArgs, IOException {
    String[] args = { "-Xmsgs", thisFile.getPath() };
    DocLint d = new DocLint();
    d.run(pw, args);
}
 
Example 18
@Test
void testMain(PrintWriter pw) throws BadArgs, IOException {
    String[] args = { "-Xmsgs", thisFile.getPath() };
    DocLint d = new DocLint();
    d.run(pw, args);
}
 
Example 19
@Test
void testMain(PrintWriter pw) throws BadArgs, IOException {
    String[] args = { "-Xmsgs", thisFile.getPath() };
    DocLint d = new DocLint();
    d.run(pw, args);
}
 
Example 20
@Test
void testMain(PrintWriter pw) throws BadArgs, IOException {
    String[] args = { "-Xmsgs", thisFile.getPath() };
    DocLint d = new DocLint();
    d.run(pw, args);
}