25 * @test |
25 * @test |
26 * @bug 4638723 8015882 |
26 * @bug 4638723 8015882 |
27 * @summary Test to ensure that the refactored version of the standard |
27 * @summary Test to ensure that the refactored version of the standard |
28 * doclet still works with Taglets that implement the 1.4.0 interface. |
28 * doclet still works with Taglets that implement the 1.4.0 interface. |
29 * @author jamieh |
29 * @author jamieh |
30 * @library ../lib/ |
30 * @library ../lib |
31 * @compile ../lib/JavadocTester.java TestLegacyTaglet.java ToDoTaglet.java UnderlineTaglet.java Check.java |
31 * @build JavadocTester ToDoTaglet UnderlineTaglet Check |
32 * @run main TestLegacyTaglet |
32 * @run main TestLegacyTaglet |
33 */ |
33 */ |
34 |
34 |
35 public class TestLegacyTaglet extends JavadocTester { |
35 public class TestLegacyTaglet extends JavadocTester { |
36 |
36 |
37 private static final String[] ARGS = |
37 public static void main(String... args) throws Exception { |
38 new String[] {"-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, |
38 TestLegacyTaglet tester = new TestLegacyTaglet(); |
39 "-tagletpath", SRC_DIR, "-taglet", "ToDoTaglet", "-taglet", "Check", |
39 tester.runTests(); |
40 "-taglet", "UnderlineTaglet", SRC_DIR + "/C.java"}; |
40 } |
41 |
41 |
42 private static final String[][] TEST = new String[][] { |
42 @Test |
43 { "C.html", "This is an <u>underline</u>"}, |
43 void test() { |
44 { "C.html", |
44 javadoc("-d", "out", |
45 "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" + |
45 "-sourcepath", testSrc, |
46 "<td bgcolor=\"yellow\">Finish this class.</td></tr></table></DD>"}, |
46 "-tagletpath", testSrc, |
47 { "C.html", |
47 "-taglet", "ToDoTaglet", |
|
48 "-taglet", "Check", |
|
49 "-taglet", "UnderlineTaglet", |
|
50 testSrc("C.java")); |
|
51 checkExit(Exit.OK); |
|
52 checkOutput("C.html", true, |
|
53 "This is an <u>underline</u>", |
48 "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" + |
54 "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" + |
49 "<td bgcolor=\"yellow\">Tag in Method.</td></tr></table></DD>"} |
55 "<td bgcolor=\"yellow\">Finish this class.</td></tr></table></DD>", |
50 }; |
56 "<DT><B>To Do:</B><DD><table cellpadding=2 cellspacing=0><tr>" + |
51 |
57 "<td bgcolor=\"yellow\">Tag in Method.</td></tr></table></DD>"); |
52 /** |
58 checkOutput(Output.STDERR, false, |
53 * The entry point of the test. |
59 "NullPointerException"); |
54 * @param args the array of command line arguments. |
|
55 */ |
|
56 public static void main(String[] args) { |
|
57 TestLegacyTaglet tester = new TestLegacyTaglet(); |
|
58 tester.run(ARGS, TEST, NO_TEST); |
|
59 if (tester.getErrorOutput().contains("NullPointerException")) { |
|
60 throw new AssertionError("javadoc threw NullPointerException"); |
|
61 } |
|
62 tester.printSummary(); |
|
63 } |
60 } |
64 } |
61 } |