27 * @summary No need to include type name (class, interface, etc.) before |
27 * @summary No need to include type name (class, interface, etc.) before |
28 * every single type in class tree. |
28 * every single type in class tree. |
29 * Make sure class tree includes heirarchy for enums and annotation |
29 * Make sure class tree includes heirarchy for enums and annotation |
30 * types. |
30 * types. |
31 * @author jamieh |
31 * @author jamieh |
32 * @library ../lib/ |
32 * @library ../lib |
33 * @build JavadocTester |
33 * @build JavadocTester |
34 * @build TestClassTree |
|
35 * @run main TestClassTree |
34 * @run main TestClassTree |
36 */ |
35 */ |
37 |
36 |
38 public class TestClassTree extends JavadocTester { |
37 public class TestClassTree extends JavadocTester { |
39 |
38 |
40 //Javadoc arguments. |
39 public static void main(String... args) throws Exception { |
41 private static final String[] ARGS = new String[] { |
40 TestClassTree tester = new TestClassTree(); |
42 "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg" |
41 tester.runTests(); |
43 }; |
42 } |
44 |
43 |
45 //Input for string search tests. |
44 @Test |
46 private static final String[][] TEST = { |
45 void test() { |
47 { "pkg/package-tree.html", |
46 javadoc("-d", "out", |
48 "<ul>\n" + |
47 "-sourcepath", testSrc, |
49 "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " + |
48 "pkg"); |
50 "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>"}, |
49 checkExit(Exit.OK); |
51 |
50 |
52 { "pkg/package-tree.html", |
51 checkOutput("pkg/package-tree.html", true, |
53 "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n" + |
52 "<ul>\n" |
54 "<ul>\n" + |
53 + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " |
55 "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " + |
54 + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>", |
56 "title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> " + |
55 "<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>\n" |
57 "(implements java.lang.annotation.Annotation)</li>\n" + |
56 + "<ul>\n" |
58 "</ul>"}, |
57 + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " |
|
58 + "title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> " |
|
59 + "(implements java.lang.annotation.Annotation)</li>\n" |
|
60 + "</ul>", |
|
61 "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n" |
|
62 + "<ul>\n" |
|
63 + "<li type=\"circle\">java.lang.Object\n" |
|
64 + "<ul>\n" |
|
65 + "<li type=\"circle\">java.lang.Enum<E> (implements java.lang." |
|
66 + "Comparable<T>, java.io.Serializable)\n" |
|
67 + "<ul>\n" |
|
68 + "<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " |
|
69 + "title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>\n" |
|
70 + "</ul>\n" |
|
71 + "</li>\n" |
|
72 + "</ul>\n" |
|
73 + "</li>\n" |
|
74 + "</ul>"); |
59 |
75 |
60 { "pkg/package-tree.html", |
76 checkOutput("pkg/package-tree.html", false, |
61 "<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>\n" + |
77 "<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " |
62 "<ul>\n" + |
78 + "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>"); |
63 "<li type=\"circle\">java.lang.Object\n" + |
|
64 "<ul>\n" + |
|
65 "<li type=\"circle\">java.lang.Enum<E> (implements java.lang." + |
|
66 "Comparable<T>, java.io.Serializable)\n" + |
|
67 "<ul>\n" + |
|
68 "<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " + |
|
69 "title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>\n" + |
|
70 "</ul>\n" + |
|
71 "</li>\n" + |
|
72 "</ul>\n" + |
|
73 "</li>\n" + |
|
74 "</ul>" |
|
75 }, |
|
76 }; |
|
77 private static final String[][] NEGATED_TEST = { |
|
78 { "pkg/package-tree.html", |
|
79 "<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " + |
|
80 "title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>"} |
|
81 }; |
|
82 |
|
83 /** |
|
84 * The entry point of the test. |
|
85 * @param args the array of command line arguments. |
|
86 */ |
|
87 public static void main(String[] args) { |
|
88 TestClassTree tester = new TestClassTree(); |
|
89 tester.run(ARGS, TEST, NEGATED_TEST); |
|
90 tester.printSummary(); |
|
91 } |
79 } |
92 } |
80 } |