Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
PojavLauncherTeam
GitHub Repository: PojavLauncherTeam/mobile
Path: blob/master/test/langtools/jdk/javadoc/doclet/testClassLinks/TestClassLinks.java
40971 views
1
/*
2
* Copyright (c) 2016, 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 8163800 8175200 8186332 8182765
27
* @summary The fix for JDK-8072052 shows up other minor incorrect use of styles
28
* @library ../../lib
29
* @modules jdk.javadoc/jdk.javadoc.internal.tool
30
* @build javadoc.tester.*
31
* @build TestClassLinks
32
* @run main TestClassLinks
33
*/
34
35
import javadoc.tester.JavadocTester;
36
37
public class TestClassLinks extends JavadocTester {
38
39
public static void main(String... args) throws Exception {
40
TestClassLinks tester = new TestClassLinks();
41
tester.runTests();
42
}
43
44
@Test
45
public void test() {
46
47
javadoc("-d", "out",
48
"-Xdoclint:none",
49
"--no-platform-links",
50
"-sourcepath", testSrc,
51
"-package",
52
"p");
53
checkExit(Exit.OK);
54
55
checkOutput("p/C1.html", true,
56
"""
57
<code><a href="C2.html" title="class in p">C2</a></code>""",
58
"""
59
<code><a href="#%3Cinit%3E()" class="member-name-link">C1</a>()</code>""");
60
61
checkOutput("p/C2.html", true,
62
"""
63
<code><a href="C3.html" title="class in p">C3</a></code>""",
64
"""
65
<code><a href="#%3Cinit%3E()" class="member-name-link">C2</a>()</code>""");
66
67
checkOutput("p/C3.html", true,
68
"""
69
<code><a href="I1.html" title="interface in p">I1</a></code>, <code><a href="I12\
70
.html" title="interface in p">I12</a></code>, <code><a href="I2.html" title="int\
71
erface in p">I2</a></code>, <code><a href="IT1.html" title="interface in p">IT1<\
72
/a>&lt;T&gt;</code>, <code><a href="IT2.html" title="interface in p">IT2</a>&lt;\
73
java.lang.String&gt;</code>""",
74
"""
75
<code><a href="#%3Cinit%3E()" class="member-name-link">C3</a>()</code>""");
76
77
checkOutput("p/I1.html", true,
78
"""
79
<code><a href="C3.html" title="class in p">C3</a></code>""",
80
"""
81
<code><a href="I12.html" title="interface in p">I12</a></code>""");
82
83
checkOutput("p/I2.html", true,
84
"""
85
<code><a href="C3.html" title="class in p">C3</a></code>""",
86
"""
87
<code><a href="I12.html" title="interface in p">I12</a></code>""");
88
89
checkOutput("p/I12.html", true,
90
"""
91
<code><a href="C3.html" title="class in p">C3</a></code>""",
92
"""
93
<code><a href="I1.html" title="interface in p">I1</a></code>, <code><a href="I2.\
94
html" title="interface in p">I2</a></code>""");
95
96
checkOutput("p/IT1.html", true,
97
"""
98
<code><a href="C3.html" title="class in p">C3</a></code>""");
99
100
checkOutput("p/IT2.html", true,
101
"""
102
code><a href="C3.html" title="class in p">C3</a></code>""");
103
}
104
}
105
106