author | alanb |
Thu, 17 Mar 2016 19:04:28 +0000 | |
changeset 36526 | 3b41f1c69604 |
parent 35426 | 374342e56a56 |
child 36709 | f9f252088afa |
permissions | -rw-r--r-- |
10 | 1 |
/* |
36526 | 2 |
* Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved. |
10 | 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 |
* |
|
5520 | 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. |
|
10 | 22 |
*/ |
23 |
||
24 |
/* |
|
25 |
* @test |
|
36526 | 26 |
* @bug 4131628 4664607 7025314 8023700 7198273 8025633 8026567 8081854 8150188 |
10 | 27 |
* @summary Make sure the Next/Prev Class links iterate through all types. |
28 |
* Make sure the navagation is 2 columns, not 3. |
|
29 |
* @author jamieh |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
30 |
* @library ../lib |
36526 | 31 |
* @modules jdk.javadoc/jdk.javadoc.internal.tool |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
32 |
* @build JavadocTester |
19659 | 33 |
* @run main TestNavigation |
10 | 34 |
*/ |
35 |
||
19659 | 36 |
public class TestNavigation extends JavadocTester { |
10 | 37 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
38 |
public static void main(String... args) throws Exception { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
39 |
TestNavigation tester = new TestNavigation(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
40 |
tester.runTests(); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
41 |
} |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
42 |
|
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
43 |
@Test |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
44 |
void test() { |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
45 |
javadoc("-d", "out", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
46 |
"-sourcepath", testSrc, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
47 |
"pkg"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
48 |
checkExit(Exit.OK); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
49 |
|
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
50 |
checkOutput("pkg/A.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
51 |
"<li>Prev Class</li>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
52 |
"<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"); |
10 | 53 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
54 |
checkOutput("pkg/C.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
55 |
"<a href=\"../pkg/A.html\" title=\"annotation in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
56 |
"<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"); |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
57 |
|
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
58 |
checkOutput("pkg/E.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
59 |
"<a href=\"../pkg/C.html\" title=\"class in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
60 |
"<a href=\"../pkg/I.html\" title=\"interface in pkg\"><span class=\"typeNameLink\">Next Class</span></a>"); |
10 | 61 |
|
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
62 |
checkOutput("pkg/I.html", true, |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
63 |
"<a href=\"../pkg/E.html\" title=\"enum in pkg\"><span class=\"typeNameLink\">Prev Class</span></a>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
64 |
"<li>Next Class</li>", |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
65 |
// Test for 4664607 |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
66 |
"<div class=\"skipNav\"><a href=\"#skip.navbar.top\" title=\"Skip navigation links\">Skip navigation links</a></div>\n" |
31297
86fe1414f12c
8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents:
30730
diff
changeset
|
67 |
+ "<a name=\"navbar.top.firstrow\">\n" |
24399
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
68 |
+ "<!-- -->\n" |
af1a0220d0fa
8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents:
24072
diff
changeset
|
69 |
+ "</a>"); |
36526 | 70 |
|
71 |
// Remaining tests check for additional padding to offset the fixed navigation bar. |
|
72 |
checkOutput("pkg/A.html", true, |
|
73 |
"<!-- ========= END OF TOP NAVBAR ========= -->\n" |
|
74 |
+ "</div>\n" |
|
75 |
+ "<div class=\"navPadding\"> </div>\n" |
|
76 |
+ "<!-- ======== START OF CLASS DATA ======== -->"); |
|
77 |
||
78 |
checkOutput("pkg/package-summary.html", true, |
|
79 |
"<!-- ========= END OF TOP NAVBAR ========= -->\n" |
|
80 |
+ "</div>\n" |
|
81 |
+ "<div class=\"navPadding\"> </div>\n" |
|
82 |
+ "<div class=\"header\">"); |
|
83 |
} |
|
84 |
||
85 |
// Test for checking additional padding to offset the fixed navigation bar in HTML5. |
|
86 |
@Test |
|
87 |
void test1() { |
|
88 |
javadoc("-d", "out-1", "-html5", |
|
89 |
"-sourcepath", testSrc, |
|
90 |
"pkg"); |
|
91 |
checkExit(Exit.OK); |
|
92 |
||
93 |
checkOutput("pkg/A.html", true, |
|
94 |
"<!-- ========= END OF TOP NAVBAR ========= -->\n" |
|
95 |
+ "</div>\n" |
|
96 |
+ "<div class=\"navPadding\"> </div>\n" |
|
97 |
+ "</nav>\n" |
|
98 |
+ "</header>\n" |
|
99 |
+ "<!-- ======== START OF CLASS DATA ======== -->"); |
|
100 |
||
101 |
checkOutput("pkg/package-summary.html", true, |
|
102 |
"<!-- ========= END OF TOP NAVBAR ========= -->\n" |
|
103 |
+ "</div>\n" |
|
104 |
+ "<div class=\"navPadding\"> </div>\n" |
|
105 |
+ "</nav>"); |
|
106 |
} |
|
107 |
||
108 |
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML4. |
|
109 |
@Test |
|
110 |
void test2() { |
|
111 |
javadoc("-d", "out-2", "-nonavbar", |
|
112 |
"-sourcepath", testSrc, |
|
113 |
"pkg"); |
|
114 |
checkExit(Exit.OK); |
|
115 |
||
116 |
checkOutput("pkg/A.html", false, |
|
117 |
"<!-- ========= END OF TOP NAVBAR ========= -->\n" |
|
118 |
+ "</div>\n" |
|
119 |
+ "<div class=\"navPadding\"> </div>\n" |
|
120 |
+ "<!-- ======== START OF CLASS DATA ======== -->"); |
|
121 |
||
122 |
checkOutput("pkg/package-summary.html", false, |
|
123 |
"<!-- ========= END OF TOP NAVBAR ========= -->\n" |
|
124 |
+ "</div>\n" |
|
125 |
+ "<div class=\"navPadding\"> </div>\n" |
|
126 |
+ "<div class=\"header\">"); |
|
127 |
} |
|
128 |
||
129 |
// Test to make sure that no extra padding for nav bar gets generated if -nonavbar is specified for HTML5. |
|
130 |
@Test |
|
131 |
void test3() { |
|
132 |
javadoc("-d", "out-3", "-html5", "-nonavbar", |
|
133 |
"-sourcepath", testSrc, |
|
134 |
"pkg"); |
|
135 |
checkExit(Exit.OK); |
|
136 |
||
137 |
checkOutput("pkg/A.html", false, |
|
138 |
"<!-- ========= END OF TOP NAVBAR ========= -->\n" |
|
139 |
+ "</div>\n" |
|
140 |
+ "<div class=\"navPadding\"> </div>\n" |
|
141 |
+ "</nav>\n" |
|
142 |
+ "</header>\n" |
|
143 |
+ "<!-- ======== START OF CLASS DATA ======== -->"); |
|
144 |
||
145 |
checkOutput("pkg/package-summary.html", false, |
|
146 |
"<!-- ========= END OF TOP NAVBAR ========= -->\n" |
|
147 |
+ "</div>\n" |
|
148 |
+ "<div class=\"navPadding\"> </div>\n" |
|
149 |
+ "</nav>"); |
|
10 | 150 |
} |
151 |
} |