author | jjg |
Thu, 21 Feb 2019 17:50:27 -0800 | |
changeset 53883 | f41793b5b83f |
parent 53879 | e7cb0348fa1c |
child 53991 | 786825220790 |
permissions | -rw-r--r-- |
53270
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
1 |
/* |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
2 |
* Copyright (c) 2018, 2019, Oracle and/or its affiliates. All rights reserved. |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
3 |
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
4 |
* |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
5 |
* This code is free software; you can redistribute it and/or modify it |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
6 |
* under the terms of the GNU General Public License version 2 only, as |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
7 |
* published by the Free Software Foundation. |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
8 |
* |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
9 |
* This code is distributed in the hope that it will be useful, but WITHOUT |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
10 |
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
11 |
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
12 |
* version 2 for more details (a copy is included in the LICENSE file that |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
13 |
* accompanied this code). |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
14 |
* |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
15 |
* You should have received a copy of the GNU General Public License version |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
16 |
* 2 along with this work; if not, write to the Free Software Foundation, |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
17 |
* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
18 |
* |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
19 |
* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
20 |
* or visit www.oracle.com if you need additional information or have any |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
21 |
* questions. |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
22 |
*/ |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
23 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
24 |
/* |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
25 |
* @test |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
26 |
* @bug 8210047 8199892 |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
27 |
* @summary some pages contains content outside of landmark region |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
28 |
* @library /tools/lib ../../lib |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
29 |
* @modules |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
30 |
* jdk.javadoc/jdk.javadoc.internal.tool |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
31 |
* jdk.compiler/com.sun.tools.javac.api |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
32 |
* jdk.compiler/com.sun.tools.javac.main |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
33 |
* @build javadoc.tester.* |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
34 |
* @run main TestHtmlLandmarkRegions |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
35 |
*/ |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
36 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
37 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
38 |
import java.nio.file.Files; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
39 |
import java.nio.file.Path; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
40 |
import java.nio.file.Paths; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
41 |
import java.util.List; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
42 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
43 |
import builder.ClassBuilder; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
44 |
import toolbox.ModuleBuilder; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
45 |
import toolbox.ToolBox; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
46 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
47 |
import javadoc.tester.JavadocTester; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
48 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
49 |
public class TestHtmlLandmarkRegions extends JavadocTester { |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
50 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
51 |
final ToolBox tb; |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
52 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
53 |
public static void main(String... args) throws Exception { |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
54 |
TestHtmlLandmarkRegions tester = new TestHtmlLandmarkRegions(); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
55 |
tester.runTests(m -> new Object[]{Paths.get(m.getName())}); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
56 |
} |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
57 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
58 |
TestHtmlLandmarkRegions() { |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
59 |
tb = new ToolBox(); |
53391
a99bd2570660
8217034: JavadocTester should check for missing files by default
jjg
parents:
53270
diff
changeset
|
60 |
setAutomaticCheckLinks(false); // @ignore 8217013 |
53270
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
61 |
} |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
62 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
63 |
@Test |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
64 |
public void testModules(Path base) throws Exception { |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
65 |
Path srcDir = base.resolve("src"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
66 |
createModules(srcDir); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
67 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
68 |
Path outDir = base.resolve("out"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
69 |
javadoc("-d", outDir.toString(), |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
70 |
"-doctitle", "Document Title", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
71 |
"-header", "Test Header", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
72 |
"--frames", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
73 |
"--module-source-path", srcDir.toString(), |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
74 |
"--module", "m1,m2"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
75 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
76 |
checkExit(Exit.OK); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
77 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
78 |
checkOrder("module-overview-frame.html", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
79 |
"<header role=\"banner\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
80 |
+ "<h1 title=\"Test Header\" class=\"bar\">Test Header</h1>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
81 |
+ "<nav role=\"navigation\" class=\"indexNav\">", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
82 |
"<main role=\"main\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
83 |
+ "<div class=\"indexContainer\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
84 |
+ "<h2 title=\"Modules\">Modules</h2>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
85 |
+ "<ul title=\"Modules\">", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
86 |
"<footer role=\"contentinfo\">"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
87 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
88 |
checkOrder("m1/module-frame.html", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
89 |
"<header role=\"banner\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
90 |
+ "<h1 title=\"Test Header\" class=\"bar\">Test Header</h1>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
91 |
+ "<nav role=\"navigation\" class=\"indexNav\">", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
92 |
"<main role=\"main\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
93 |
+ "<div class=\"indexContainer\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
94 |
+ "<h2 title=\"m1\"><a href=\"module-summary.html\" target=\"classFrame\">m1</a> Packages</h2>", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
95 |
"<footer role=\"contentinfo\">"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
96 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
97 |
checkOrder("overview-summary.html", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
98 |
"<header role=\"banner\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
99 |
+ "<nav role=\"navigation\">", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
100 |
"<main role=\"main\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
101 |
+ "<div class=\"header\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
102 |
+ "<h1 class=\"title\">Document Title</h1>", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
103 |
"<footer role=\"contentinfo\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
104 |
+ "<nav role=\"navigation\">"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
105 |
} |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
106 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
107 |
@Test |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
108 |
public void testPackages(Path base) throws Exception { |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
109 |
Path srcDir = base.resolve("src"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
110 |
createPackages(srcDir); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
111 |
|
53883
f41793b5b83f
8219558: jdk/javadoc tests fail with missing headings: h1
jjg
parents:
53879
diff
changeset
|
112 |
Path outDir = base.resolve("out3"); |
53270
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
113 |
javadoc("-d", outDir.toString(), |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
114 |
"-doctitle", "Document Title", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
115 |
"-header", "Test Header", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
116 |
"--frames", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
117 |
"-sourcepath", srcDir.toString(), |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
118 |
"pkg1", "pkg2"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
119 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
120 |
checkExit(Exit.OK); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
121 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
122 |
checkOrder("overview-summary.html", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
123 |
"<header role=\"banner\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
124 |
+ "<nav role=\"navigation\">", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
125 |
"<main role=\"main\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
126 |
+ "<div class=\"header\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
127 |
+ "<h1 class=\"title\">Document Title</h1>", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
128 |
"<footer role=\"contentinfo\">\n" + |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
129 |
"<nav role=\"navigation\">"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
130 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
131 |
checkOrder("overview-frame.html", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
132 |
"<header role=\"banner\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
133 |
+ "<h1 title=\"Test Header\" class=\"bar\">Test Header</h1>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
134 |
+ "<nav role=\"navigation\" class=\"indexNav\">", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
135 |
"<main role=\"main\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
136 |
+ "<div class=\"indexContainer\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
137 |
+ "<h2 title=\"Packages\">Packages</h2>", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
138 |
"<footer role=\"contentinfo\">"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
139 |
} |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
140 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
141 |
@Test |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
142 |
public void testDocFiles(Path base) throws Exception { |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
143 |
Path srcDir = base.resolve("src"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
144 |
createPackages(srcDir); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
145 |
Path docFiles = Files.createDirectory(srcDir.resolve("pkg1").resolve("doc-files")); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
146 |
Files.write(docFiles.resolve("s.html"), List.of( |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
147 |
"<html>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
148 |
+ " <head>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
149 |
+ " <title>\"Hello World\"</title>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
150 |
+ " </head>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
151 |
+ " <body>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
152 |
+ " A sample doc file.\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
153 |
+ " </body>\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
154 |
+ "</html>")); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
155 |
|
53883
f41793b5b83f
8219558: jdk/javadoc tests fail with missing headings: h1
jjg
parents:
53879
diff
changeset
|
156 |
Path outDir = base.resolve("out5"); |
53270
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
157 |
javadoc("-d", outDir.toString(), |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
158 |
"-sourcepath", srcDir.toString(), |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
159 |
"pkg1", "pkg2"); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
160 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
161 |
checkExit(Exit.OK); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
162 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
163 |
checkOrder("pkg1/doc-files/s.html", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
164 |
"<header role=\"banner\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
165 |
+ "<nav role=\"navigation\">\n", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
166 |
"<main role=\"main\">A sample doc file", |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
167 |
"<footer role=\"contentinfo\">\n" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
168 |
+ "<nav role=\"navigation\">" |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
169 |
); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
170 |
} |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
171 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
172 |
void createModules(Path srcDir) throws Exception { |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
173 |
new ModuleBuilder(tb, "m1") |
53883
f41793b5b83f
8219558: jdk/javadoc tests fail with missing headings: h1
jjg
parents:
53879
diff
changeset
|
174 |
.classes("package p1; public class a{}") |
f41793b5b83f
8219558: jdk/javadoc tests fail with missing headings: h1
jjg
parents:
53879
diff
changeset
|
175 |
.classes("package p2; public class b{}") |
53270
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
176 |
.write(srcDir); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
177 |
new ModuleBuilder(tb, "m2") |
53883
f41793b5b83f
8219558: jdk/javadoc tests fail with missing headings: h1
jjg
parents:
53879
diff
changeset
|
178 |
.classes("package p3; public class c{}") |
f41793b5b83f
8219558: jdk/javadoc tests fail with missing headings: h1
jjg
parents:
53879
diff
changeset
|
179 |
.classes("package p4; public class d{}") |
53270
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
180 |
.write(srcDir); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
181 |
} |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
182 |
|
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
183 |
void createPackages(Path srcDir) throws Exception { |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
184 |
new ClassBuilder(tb, "pkg1.A") |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
185 |
.setModifiers("public", "class") |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
186 |
.write(srcDir); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
187 |
new ClassBuilder(tb, "pkg2.B") |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
188 |
.setModifiers("public", "class") |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
189 |
.write(srcDir); |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
190 |
} |
f3a42c440fcb
8199892: Missing landmarks when generating docs using html sources
pmuthuswamy
parents:
diff
changeset
|
191 |
} |