Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java
40971 views
1
/*
2
* Copyright (c) 2004, 2020, Oracle and/or its affiliates. All rights reserved.
3
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4
*
5
* This code is free software; you can redistribute it and/or modify it
6
* under the terms of the GNU General Public License version 2 only, as
7
* published by the Free Software Foundation.
8
*
9
* This code is distributed in the hope that it will be useful, but WITHOUT
10
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12
* version 2 for more details (a copy is included in the LICENSE file that
13
* accompanied this code).
14
*
15
* You should have received a copy of the GNU General Public License version
16
* 2 along with this work; if not, write to the Free Software Foundation,
17
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18
*
19
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20
* or visit www.oracle.com if you need additional information or have any
21
* questions.
22
*/
23
24
/*
25
* @test
26
* @bug 4632553 4973607 8026567
27
* @summary No need to include type name (class, interface, etc.) before
28
* every single type in class tree.
29
* Make sure class tree includes heirarchy for enums and annotation
30
* types.
31
* @library ../../lib
32
* @modules jdk.javadoc/jdk.javadoc.internal.tool
33
* @build javadoc.tester.*
34
* @run main TestClassTree
35
*/
36
37
import javadoc.tester.JavadocTester;
38
39
public class TestClassTree extends JavadocTester {
40
41
public static void main(String... args) throws Exception {
42
TestClassTree tester = new TestClassTree();
43
tester.runTests();
44
}
45
46
@Test
47
public void test() {
48
javadoc("-d", "out",
49
"--no-platform-links",
50
"-sourcepath", testSrc,
51
"pkg");
52
checkExit(Exit.OK);
53
54
checkOutput("pkg/package-tree.html", true,
55
"""
56
<ul>
57
<li class="circle">pkg.<a href="ParentClass.html" class="type-name-link" title="\
58
class in pkg">ParentClass</a>""",
59
"""
60
<h2 title="Annotation Interface Hierarchy">Annotation Interface Hierarchy</h2>
61
<ul>
62
<li class="circle">pkg.<a href="AnnotationType.html" class="type-name-link" titl\
63
e="annotation interface in pkg">AnnotationType</a> (implements java.lang.annotat\
64
ion.Annotation)</li>
65
</ul>""",
66
"""
67
<h2 title="Enum Class Hierarchy">Enum Class Hierarchy</h2>
68
<ul>
69
<li class="circle">java.lang.Object
70
<ul>
71
<li class="circle">java.lang.Enum&lt;E&gt; (implements java.lang.Comparable&lt;T\
72
&gt;, java.lang.constant.Constable, java.io.Serializable)
73
<ul>
74
<li class="circle">pkg.<a href="Coin.html" class="type-name-link" title="enum cl\
75
ass in pkg">Coin</a></li>
76
</ul>
77
</li>
78
</ul>
79
</li>
80
</ul>""");
81
82
checkOutput("pkg/package-tree.html", false,
83
"""
84
<li class="circle">class pkg.<a href=".ParentClass.html" class="type-name-link" \
85
title="class in pkg">ParentClass</a></li>""");
86
}
87
}
88
89