23 |
23 |
24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @summary Test for nested inline tags. * |
26 * @summary Test for nested inline tags. * |
27 * @author jamieh |
27 * @author jamieh |
28 * @library ../lib/ |
28 * @library ../lib |
29 * @build JavadocTester |
29 * @build JavadocTester |
30 * @build testtaglets.UnderlineTaglet |
30 * @build testtaglets.UnderlineTaglet |
31 * @build testtaglets.BoldTaglet |
31 * @build testtaglets.BoldTaglet |
32 * @build testtaglets.GreenTaglet |
32 * @build testtaglets.GreenTaglet |
33 * @build TestNestedInlineTag |
|
34 * @run main TestNestedInlineTag |
33 * @run main TestNestedInlineTag |
35 */ |
34 */ |
36 |
35 |
37 /** |
36 /** |
38 * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} . |
37 * This should be green, underlined and bold (Class): {@underline {@bold {@green My test}}} . |
39 */ |
38 */ |
40 public class TestNestedInlineTag extends JavadocTester { |
39 public class TestNestedInlineTag extends JavadocTester { |
41 |
|
42 /** |
40 /** |
43 * This should be green, underlined and bold (Field): {@underline {@bold {@green My test}}} . |
41 * This should be green, underlined and bold (Field): {@underline {@bold {@green My test}}} . |
44 */ |
42 */ |
45 public int field; |
43 public int field; |
46 |
44 |
52 /** |
50 /** |
53 * This should be green, underlined and bold (Method): {@underline {@bold {@green My test}}} . |
51 * This should be green, underlined and bold (Method): {@underline {@bold {@green My test}}} . |
54 */ |
52 */ |
55 public void method(){} |
53 public void method(){} |
56 |
54 |
57 private static final String[][] TEST = { |
|
58 //Test nested inline tag in class description. |
|
59 { "TestNestedInlineTag.html", |
|
60 "This should be green, underlined and bold (Class): <u><b><font color=\"green\">My test</font></b></u>" |
|
61 }, |
|
62 |
|
63 //Test nested inline tag in field description. |
|
64 { "TestNestedInlineTag.html", |
|
65 "This should be green, underlined and bold (Field): <u><b><font color=\"green\">My test</font></b></u>" |
|
66 }, |
|
67 |
|
68 //Test nested inline tag in constructor description. |
|
69 { "TestNestedInlineTag.html", |
|
70 "This should be green, underlined and bold (Constructor): <u><b><font color=\"green\">My test</font></b></u>" |
|
71 }, |
|
72 |
|
73 //Test nested inline tag in method description. |
|
74 { "TestNestedInlineTag.html", |
|
75 "This should be green, underlined and bold (Method): <u><b><font color=\"green\">My test</font></b></u>" |
|
76 } |
|
77 }; |
|
78 |
|
79 private static final String[] ARGS = |
|
80 new String[] { |
|
81 "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, |
|
82 "-taglet", "testtaglets.UnderlineTaglet", |
|
83 "-taglet", "testtaglets.BoldTaglet", |
|
84 "-taglet", "testtaglets.GreenTaglet", |
|
85 SRC_DIR + "/TestNestedInlineTag.java" |
|
86 }; |
|
87 |
|
88 /** |
55 /** |
89 * The entry point of the test. |
56 * The entry point of the test. |
90 * @param args the array of command line arguments. |
57 * @param args the array of command line arguments. |
|
58 * @throws Exception if the test fails |
91 */ |
59 */ |
92 public static void main(String[] args) { |
60 public static void main(String... args) throws Exception { |
93 TestNestedInlineTag tester = new TestNestedInlineTag(); |
61 TestNestedInlineTag tester = new TestNestedInlineTag(); |
94 tester.run(ARGS, TEST, NO_TEST); |
62 tester.runTests(); |
95 tester.printSummary(); |
63 } |
|
64 |
|
65 @Test |
|
66 void test() { |
|
67 javadoc("-d", "out", |
|
68 "-sourcepath", testSrc, |
|
69 "-taglet", "testtaglets.UnderlineTaglet", |
|
70 "-taglet", "testtaglets.BoldTaglet", |
|
71 "-taglet", "testtaglets.GreenTaglet", |
|
72 testSrc("TestNestedInlineTag.java")); |
|
73 checkExit(Exit.OK); |
|
74 |
|
75 checkOutput("TestNestedInlineTag.html", true, |
|
76 //Test nested inline tag in class description. |
|
77 "This should be green, underlined and bold (Class): <u><b><font color=\"green\">My test</font></b></u>", |
|
78 //Test nested inline tag in field description. |
|
79 "This should be green, underlined and bold (Field): <u><b><font color=\"green\">My test</font></b></u>", |
|
80 //Test nested inline tag in constructor description. |
|
81 "This should be green, underlined and bold (Constructor): <u><b><font color=\"green\">My test</font></b></u>", |
|
82 //Test nested inline tag in method description. |
|
83 "This should be green, underlined and bold (Method): <u><b><font color=\"green\">My test</font></b></u>" |
|
84 ); |
96 } |
85 } |
97 } |
86 } |