1 /*
2  * Copyright (c) 2016, 2021, 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 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
27  *      8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
28  *      8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
29  *      8164407 8192007 8182765 8196200 8196201 8196202 8196202 8205593 8202462
30  *      8184205 8219060 8223378 8234746 8239804 8239816 8253117 8245058 8261976
31  * @summary Test modules support in javadoc.
32  * @library ../../lib
33  * @modules jdk.javadoc/jdk.javadoc.internal.tool
34  * @build javadoc.tester.*
35  * @run main TestModules
36  */
37 import javadoc.tester.JavadocTester;
38 
39 public class TestModules extends JavadocTester {
40 
main(String... args)41     public static void main(String... args) throws Exception {
42         TestModules tester = new TestModules();
43         tester.runTests();
44     }
45 
46     /**
47      * Test generated module pages for HTML 5.
48      */
49     @Test
testHtml5()50     public void testHtml5() {
51         javadoc("-d", "out-html5",
52                 "-use",
53                 "-Xdoclint:none",
54                 "-overview", testSrc("overview.html"),
55                 "--module-source-path", testSrc,
56                 "--module", "moduleA,moduleB",
57                 "testpkgmdlA", "testpkgmdlB");
58         checkExit(Exit.OK);
59         checkHtml5Description(true);
60         checkHtml5NoDescription(false);
61         checkHtml5OverviewSummaryModules();
62         checkModuleLink();
63         checkModuleFilesAndLinks(true);
64         checkModulesInSearch(true);
65         checkAllPkgsAllClasses(true);
66     }
67 
68     /**
69      * Test generated module pages for HTML 5 with -nocomment option.
70      */
71     @Test
testHtml5NoComment()72     public void testHtml5NoComment() {
73         javadoc("-d", "out-html5-nocomment",
74                 "-nocomment",
75                 "-use",
76                 "-Xdoclint:none",
77                 "--no-platform-links",
78                 "-overview", testSrc("overview.html"),
79                 "--module-source-path", testSrc,
80                 "--module", "moduleA,moduleB",
81                 "testpkgmdlA", "testpkgmdlB");
82         checkExit(Exit.OK);
83         checkHtml5Description(false);
84         checkHtml5NoDescription(true);
85         checkModuleLink();
86         checkModuleFilesAndLinks(true);
87     }
88 
89     /**
90      * Test generated pages, in an unnamed module, for HTML 5.
91      */
92     @Test
testHtml5UnnamedModule()93     public void testHtml5UnnamedModule() {
94         javadoc("-d", "out-html5-nomodule",
95                 "-use",
96                 "-overview", testSrc("overview.html"),
97                 "-sourcepath", testSrc,
98                 "testpkgnomodule", "testpkgnomodule1");
99         checkExit(Exit.OK);
100         checkHtml5OverviewSummaryPackages();
101         checkModuleFilesAndLinks(false);
102         checkModulesInSearch(false);
103     }
104 
105     /**
106      * Test generated module pages with javadoc tags.
107      */
108     @Test
testJDTagsInModules()109     public void testJDTagsInModules() {
110         javadoc("-d", "out-mdltags",
111                 "-author",
112                 "-version",
113                 "-Xdoclint:none",
114                 "-tag", "regular:a:Regular Tag:",
115                 "-tag", "moduletag:s:Module Tag:",
116                 "--module-source-path", testSrc,
117                 "--module", "moduletags,moduleB",
118                 "testpkgmdltags", "testpkgmdlB");
119         checkExit(Exit.OK);
120         checkModuleTags();
121     }
122 
123     /**
124      * Test generated module summary page.
125      */
126     @Test
testModuleSummary()127     public void testModuleSummary() {
128         javadoc("-d", "out-moduleSummary",
129                 "-use",
130                 "-Xdoclint:none",
131                 "--module-source-path", testSrc,
132                 "--module", "moduleA,moduleB",
133                 "testpkgmdlA", "testpkgmdlB", "moduleB/testpkg2mdlB");
134         checkExit(Exit.OK);
135         checkModuleSummary();
136         checkNegatedModuleSummary();
137     }
138 
139     /**
140      * Test generated module summary page of an aggregating module.
141      */
142     @Test
testAggregatorModuleSummary()143     public void testAggregatorModuleSummary() {
144         javadoc("-d", "out-aggregatorModuleSummary",
145                 "-use",
146                 "--module-source-path", testSrc,
147                 "--expand-requires", "transitive",
148                 "--module", "moduleT");
149         checkExit(Exit.OK);
150         checkAggregatorModuleSummary();
151     }
152 
153     /**
154      * Test generated module pages and pages with link to modules.
155      */
156     @Test
testModuleFilesAndLinks()157     public void testModuleFilesAndLinks() {
158         javadoc("-d", "out-modulelinks",
159                 "-Xdoclint:none",
160                 "--module-source-path", testSrc,
161                 "--module", "moduleA,moduleB",
162                 "testpkgmdlA", "testpkgmdlB");
163         checkExit(Exit.OK);
164         checkModuleFilesAndLinks(true);
165     }
166 
167     /**
168      * Test generated module pages for a deprecated module.
169      */
170     @Test
testModuleDeprecation()171     public void testModuleDeprecation() {
172         javadoc("-d", "out-moduledepr",
173                 "-Xdoclint:none",
174                 "--no-platform-links",
175                 "-tag", "regular:a:Regular Tag:",
176                 "-tag", "moduletag:s:Module Tag:",
177                 "--module-source-path", testSrc,
178                 "--module", "moduleA,moduleB,moduletags",
179                 "testpkgmdlA", "testpkgmdlB", "testpkgmdltags");
180         checkExit(Exit.OK);
181         checkModuleDeprecation(true);
182     }
183 
184     /**
185      * Test annotations on modules.
186      */
187     @Test
testModuleAnnotation()188     public void testModuleAnnotation() {
189         javadoc("-d", "out-moduleanno",
190                 "-Xdoclint:none",
191                 "--module-source-path", testSrc,
192                 "--module", "moduleA,moduleB",
193                 "testpkgmdlA", "testpkgmdlB");
194         checkExit(Exit.OK);
195         checkModuleAnnotation();
196     }
197 
198     /**
199      * Test module summary pages in "api" mode.
200      */
201     @Test
testApiMode()202     public void testApiMode() {
203         javadoc("-d", "out-api",
204                 "-use",
205                 "--show-module-contents=api",
206                 "-author",
207                 "-version",
208                 "-Xdoclint:none",
209                 "-tag", "regular:a:Regular Tag:",
210                 "-tag", "moduletag:s:Module Tag:",
211                 "--module-source-path", testSrc,
212                 "--module", "moduleA,moduleB,moduleC,moduletags",
213                 "testpkgmdlA", "moduleA/concealedpkgmdlA", "testpkgmdlB", "testpkg2mdlB", "testpkgmdlC", "testpkgmdltags");
214         checkExit(Exit.OK);
215         checkModuleModeCommon();
216         checkModuleModeApi(true);
217         checkModuleModeAll(false);
218     }
219 
220     /**
221      * Test module summary pages in "all" mode.
222      */
223     @Test
testAllMode()224     public void testAllMode() {
225         javadoc("-d", "out-all",
226                 "-use",
227                 "--show-module-contents=all",
228                 "-author",
229                 "-version",
230                 "-Xdoclint:none",
231                 "-tag", "regular:a:Regular Tag:",
232                 "-tag", "moduletag:s:Module Tag:",
233                 "--module-source-path", testSrc,
234                 "--module", "moduleA,moduleB,moduleC,moduletags",
235                 "testpkgmdlA", "moduleA/concealedpkgmdlA", "testpkgmdlB", "testpkg2mdlB", "testpkgmdlC", "testpkgmdltags");
236         checkExit(Exit.OK);
237         checkModuleModeCommon();
238         checkModuleModeApi(false);
239         checkModuleModeAll(true);
240     }
241 
242     /**
243      * Test generated module summary page of a module with no exported package.
244      */
245     @Test
testModuleSummaryNoExportedPkgAll()246     public void testModuleSummaryNoExportedPkgAll() {
247         javadoc("-d", "out-ModuleSummaryNoExportedPkgAll",
248                 "-use",
249                 "--show-module-contents=all",
250                 "-sourcepath", testSrc + "/moduleNoExport",
251                 "--module", "moduleNoExport",
252                 "testpkgmdlNoExport");
253         checkExit(Exit.OK);
254         checkModuleSummaryNoExported(true);
255     }
256 
257     /**
258      * Test generated module summary page of a module with no exported package.
259      */
260     @Test
testModuleSummaryNoExportedPkgApi()261     public void testModuleSummaryNoExportedPkgApi() {
262         javadoc("-d", "out-ModuleSummaryNoExportedPkgApi",
263                 "-use",
264                 "-sourcepath", testSrc + "/moduleNoExport",
265                 "--module", "moduleNoExport",
266                 "testpkgmdlNoExport");
267         checkExit(Exit.OK);
268         checkModuleSummaryNoExported(false);
269     }
270 
271     /**
272      * Test generated module pages for javadoc run for a single module having a single package.
273      */
274     @Test
testSingleModuleSinglePkg()275     public void testSingleModuleSinglePkg() {
276         javadoc("-d", "out-singlemod",
277                 "--module-source-path", testSrc,
278                 "--module", "moduleC",
279                 "testpkgmdlC");
280         checkExit(Exit.OK);
281     }
282 
283     /**
284      * Test generated module pages for javadoc run for a single module having multiple packages.
285      */
286     @Test
testSingleModuleMultiplePkg()287     public void testSingleModuleMultiplePkg() {
288         javadoc("-d", "out-singlemodmultiplepkg",
289                 "--show-module-contents=all",
290                 "-Xdoclint:none",
291                 "--module-source-path", testSrc,
292                 "--add-modules", "moduleC",
293                 "--module", "moduleB",
294                 "testpkg2mdlB", "testpkgmdlB");
295         checkExit(Exit.OK);
296     }
297 
298     /**
299      * Test -group option for modules. The overview-summary.html page should group the modules accordingly.
300      */
301     @Test
testGroupOption()302     public void testGroupOption() {
303         javadoc("-d", "out-group",
304                 "--show-module-contents=all",
305                 "-Xdoclint:none",
306                 "-tag", "regular:a:Regular Tag:",
307                 "-tag", "moduletag:s:Module Tag:",
308                 "--module-source-path", testSrc,
309                 "-group", "Module Group A", "moduleA*",
310                 "-group", "Module Group B & C", "moduleB*:moduleC*",
311                 "-group", "Java SE Modules", "java*",
312                 "--module", "moduleA,moduleB,moduleC,moduletags",
313                 "moduleA/concealedpkgmdlA", "testpkgmdlA", "testpkg2mdlB", "testpkgmdlB", "testpkgmdlC",
314                 "testpkgmdltags");
315         checkExit(Exit.OK);
316         checkGroupOption();
317     }
318 
319     /**
320      * Test -group option for modules and the ordering of module groups.
321      * The overview-summary.html page should group the modules accordingly and display the group tabs in
322      * the order it was provided on the command-line.
323      */
324     @Test
testGroupOptionOrdering()325     public void testGroupOptionOrdering() {
326         javadoc("-d", "out-groupOrder",
327                 "--show-module-contents=all",
328                 "-Xdoclint:none",
329                 "-tag", "regular:a:Regular Tag:",
330                 "-tag", "moduletag:s:Module Tag:",
331                 "--module-source-path", testSrc,
332                 "-group", "B Group", "moduleB*",
333                 "-group", "C Group", "moduleC*",
334                 "-group", "A Group", "moduleA*",
335                 "-group", "Java SE Modules", "java*",
336                 "--module", "moduleA,moduleB,moduleC,moduletags",
337                 "moduleA/concealedpkgmdlA", "testpkgmdlA", "testpkg2mdlB", "testpkgmdlB", "testpkgmdlC",
338                 "testpkgmdltags");
339         checkExit(Exit.OK);
340         checkGroupOptionOrdering();
341     }
342 
343     /**
344      * Test -group option for unnamed modules. The overview-summary.html page should group the packages accordingly.
345      */
346     @Test
testUnnamedModuleGroupOption()347     public void testUnnamedModuleGroupOption() {
348         javadoc("-d", "out-groupnomodule",
349                 "-use",
350                 "-Xdoclint:none",
351                 "-overview", testSrc("overview.html"),
352                 "-sourcepath", testSrc,
353                 "-group", "Package Group 0", "testpkgnomodule",
354                 "-group", "Package Group 1", "testpkgnomodule1",
355                 "testpkgnomodule", "testpkgnomodule1");
356         checkExit(Exit.OK);
357         checkUnnamedModuleGroupOption();
358     }
359 
360     /**
361      * Test -group option for unnamed modules and the ordering of package groups.
362      * The overview-summary.html page should group the packages accordingly and display the group tabs in
363      * the order it was provided on the command-line.
364      */
365     @Test
testGroupOptionPackageOrdering()366     public void testGroupOptionPackageOrdering() {
367         javadoc("-d", "out-groupPkgOrder",
368                 "-use",
369                 "-Xdoclint:none",
370                 "-overview", testSrc("overview.html"),
371                 "-sourcepath", testSrc,
372                 "-group", "Z Group", "testpkgnomodule",
373                 "-group", "A Group", "testpkgnomodule1",
374                 "testpkgnomodule", "testpkgnomodule1");
375         checkExit(Exit.OK);
376         checkGroupOptionPackageOrdering();
377     }
378 
379     /**
380      * Test -group option for a single module.
381      */
382     @Test
testGroupOptionSingleModule()383     public void testGroupOptionSingleModule() {
384         javadoc("-d", "out-groupsinglemodule",
385                 "-use",
386                 "-Xdoclint:none",
387                 "--module-source-path", testSrc,
388                 "-group", "Module Group B", "moduleB*",
389                 "--module", "moduleB",
390                 "testpkg2mdlB", "testpkgmdlB");
391         checkExit(Exit.OK);
392         checkGroupOptionSingleModule();
393     }
394 
395     /**
396      * Test -group option for a single module.
397      */
398     @Test
testModuleName()399     public void testModuleName() {
400         javadoc("-d", "out-modulename",
401                 "-use",
402                 "-Xdoclint:none",
403                 "--module-source-path", testSrc,
404                 "--module", "moduleB,test.moduleFullName",
405                 "testpkg2mdlB", "testpkgmdlB", "testpkgmdlfullname");
406         checkExit(Exit.OK);
407         checkModuleName(true);
408     }
409 
410     /**
411      * Test -linkoffline option.
412      */
413     @Test
testLinkOffline()414     public void testLinkOffline() {
415         String url = "https://docs.oracle.com/javase/9/docs/api/";
416         javadoc("-d", "out-linkoffline",
417                 "-use",
418                 "--show-module-contents=all",
419                 "-Xdoclint:none",
420                 "--module-source-path", testSrc,
421                 "--module", "moduleA,moduleB",
422                 "-linkoffline", url, testSrc + "/jdk",
423                 "testpkgmdlA", "testpkgmdlB", "testpkg3mdlB");
424         checkExit(Exit.OK);
425         checkLinkOffline();
426     }
427 
428     /**
429      * Test -linksource option.
430      */
431     @Test
testLinkSource()432     public void testLinkSource() {
433         javadoc("-d", "out-linksource",
434                 "-use",
435                 "-linksource",
436                 "--no-platform-links",
437                 "-Xdoclint:none",
438                 "--module-source-path", testSrc,
439                 "--module", "moduleA,moduleB");
440         checkExit(Exit.OK);
441         checkLinks();
442         checkLinkSource(false);
443     }
444 
445     /**
446      * Test -linksource option combined with -private.
447      */
448     @Test
testLinkSourcePrivate()449     public void testLinkSourcePrivate() {
450         javadoc("-d", "out-linksource-private",
451                 "-use",
452                 "-private",
453                 "-linksource",
454                 "--no-platform-links",
455                 "-Xdoclint:none",
456                 "--module-source-path", testSrc,
457                 "--module", "moduleA,moduleB");
458         checkExit(Exit.OK);
459         checkLinks();
460         checkLinkSource(true);
461     }
462 
checkDescription(boolean found)463     void checkDescription(boolean found) {
464         checkOutput("moduleA/module-summary.html", found,
465                 """
466                     <!-- ============ MODULE DESCRIPTION =========== -->
467                     <a name="module-description">
468                     <!--   -->
469                     </a>
470                     <div class="block">This is a test description for the moduleA module with a Sear\
471                     ch phrase <span id="searchphrase" class="search-tag-result">search phrase</span>\
472                     .</div>""");
473         checkOutput("moduleB/module-summary.html", found,
474                 """
475                     <!-- ============ MODULE DESCRIPTION =========== -->
476                     <a name="module-description">
477                     <!--   -->
478                     </a>
479                     <div class="block">This is a test description for the moduleB module. Search wor\
480                     d <span id="search_word" class="search-tag-result">search_word</span> with no de\
481                     scription.</div>""");
482         checkOutput("index.html", found,
483                 """
484                     </script>
485                     <div class="block">The overview summary page header.</div>
486                     </div>
487                     <div class="overview-summary">
488                     <table summary="Module Summary table, listing modules, and an explanation">
489                     <caption><span>Modules</span><span class="tab-end">&nbsp;</span></caption>""");
490         checkOutput("index.html", false,
491                 """
492                     </table>
493                     </div>
494                     <div class="block">The overview summary page header.</div>
495                     </div>
496                     <div class="overview-summary">
497                     <table summary="Module Summary table, listing modules, and an explanation">
498                     <caption><span>Modules</span><span class="tab-end">&nbsp;</span></caption>""");
499     }
500 
checkHtml5Description(boolean found)501     void checkHtml5Description(boolean found) {
502         checkOutput("moduleA/module-summary.html", found,
503                 """
504                     <section class="module-description" id="module-description">
505                     <div class="deprecation-block"><span class="deprecated-label">Deprecated, for re\
506                     moval: This API element is subject to removal in a future version.</span>
507                     <div class="deprecation-comment">This module is deprecated.</div>
508                     </div>
509                     <!-- ============ MODULE DESCRIPTION =========== -->
510                     <div class="block">This is a test description for the moduleA module with a Sear\
511                     ch phrase <span id="searchphrase" class="search-tag-result">search phrase</span>\
512                     .</div>""");
513         checkOutput("moduleB/module-summary.html", found,
514                 """
515                     <section class="module-description" id="module-description">
516                     <!-- ============ MODULE DESCRIPTION =========== -->
517                     <div class="block">This is a test description for the moduleB module. Search wor\
518                     d <span id="search_word" class="search-tag-result">search_word</span> with no de\
519                     scription.</div>""");
520         checkOutput("index.html", found,
521                 """
522                     </nav>
523                     </header>
524                     <div class="flex-content">
525                     <main role="main">
526                     <div class="block">The overview summary page header.</div>
527                     <div id="all-modules-table">
528                     <div class="caption"><span>Modules</span></div>
529                     <div class="summary-table two-column-summary">""");
530         checkOutput("index.html", false,
531                 """
532                     </div>
533                     </main>
534                     <main role="main">
535                     <div class="block">The overview summary page header.</div>
536                     </div>
537                     <div id="all-modules-table">
538                     <div class="caption"><span>Modules</span></div>
539                     <div class="summary-table two-column-summary">""");
540     }
541 
checkHtml5NoDescription(boolean found)542     void checkHtml5NoDescription(boolean found) {
543         checkOutput("moduleA/module-summary.html", found,
544                 """
545                     <div class="header">
546                     <h1 title="Module moduleA" class="title">Module moduleA</h1>
547                     </div>
548                     <hr>
549                     <div class="module-signature"><span class="annotations">@Deprecated(forRemoval=true)
550                     </span>module <span class="element-name">moduleA</span></div>
551                     <section class="summary">
552                     <ul class="summary-list">
553                     <li>
554                     <section class="packages-summary" id="packages-summary">
555                     <!-- ============ PACKAGES SUMMARY =========== -->""");
556         checkOutput("moduleB/module-summary.html", found,
557                 """
558                     <div class="header">
559                     <h1 title="Module moduleB" class="title">Module moduleB</h1>
560                     </div>
561                     <hr>
562                     <div class="module-signature"><span class="annotations"><a href="testpkgmdlB/Ann\
563                     otationType.html" title="annotation interface in testpkgmdlB">@AnnotationType</a\
564                     >(<a href="testpkgmdlB/AnnotationType.html#optional()">optional</a>="Module Anno\
565                     tation",
566                                     <a href="testpkgmdlB/AnnotationType.html#required()">required</a>=2016)
567                     </span>module <span class="element-name">moduleB</span></div>
568                     <section class="summary">
569                     <ul class="summary-list">
570                     <li>
571                     <section class="packages-summary" id="packages-summary">
572                     <!-- ============ PACKAGES SUMMARY =========== -->""");
573     }
574 
checkModuleLink()575     void checkModuleLink() {
576         checkOutput("index.html", true,
577                 "<li>Module</li>");
578         checkOutput("moduleA/module-summary.html", true,
579                 """
580                     <li class="nav-bar-cell1-rev">Module</li>""");
581         checkOutput("moduleB/module-summary.html", true,
582                 """
583                     <li class="nav-bar-cell1-rev">Module</li>""");
584         checkOutput("moduleA/testpkgmdlA/class-use/TestClassInModuleA.html", true,
585                 """
586                     <li><a href="../../module-summary.html">Module</a></li>""");
587         checkOutput("moduleB/testpkgmdlB/package-summary.html", true,
588                 """
589                     <li><a href="../module-summary.html">Module</a></li>""");
590         checkOutput("moduleB/testpkgmdlB/TestClassInModuleB.html", true,
591                 """
592                     <li><a href="../module-summary.html">Module</a></li>""");
593         checkOutput("moduleB/testpkgmdlB/class-use/TestClassInModuleB.html", true,
594                 """
595                     <li><a href="../../module-summary.html">Module</a></li>""");
596     }
597 
checkNoModuleLink()598     void checkNoModuleLink() {
599         checkOutput("testpkgnomodule/package-summary.html", true,
600                 """
601                     <ul class="nav-list" title="Navigation">
602                     <li><a href="../testpkgnomodule/package-summary.html">Package</a></li>""");
603         checkOutput("testpkgnomodule/TestClassNoModule.html", true,
604                 """
605                     <ul class="nav-list" title="Navigation">
606                     <li><a href="../testpkgnomodule/package-summary.html">Package</a></li>""");
607         checkOutput("testpkgnomodule/class-use/TestClassNoModule.html", true,
608                 """
609                     <ul class="nav-list" title="Navigation">
610                     <li><a href="../../testpkgnomodule/package-summary.html">Package</a></li>""");
611     }
612 
checkModuleTags()613     void checkModuleTags() {
614         checkOutput("moduletags/module-summary.html", true,
615                 """
616                     Type Link: <a href="testpkgmdltags/TestClassInModuleTags.html" title="class in t\
617                     estpkgmdltags"><code>TestClassInModuleTags</code></a>.""",
618                 """
619                     Member Link: <a href="testpkgmdltags/TestClassInModuleTags.html#testMethod(java.\
620                     lang.String)"><code>testMethod(String)</code></a>.""",
621                 """
622                     Package Link: <a href="testpkgmdltags/package-summary.html"><code>testpkgmdltags</code></a>.""",
623                 """
624                     </div>
625                     <dl class="notes">""",
626                 """
627                     <dt>Since:</dt>
628                     <dd>JDK 9</dd>""",
629                 """
630                     <dt>See Also:</dt>
631                     <dd>
632                     <ul class="see-list">
633                     <li>"Test see tag"</li>
634                     <li><a href="testpkgmdltags/TestClassInModuleTags.html" title="class in testpkgmdlta\
635                     gs"><code>TestClassInModuleTags</code></a></li>
636                     </ul>
637                     </dd>""",
638                 """
639                     <dt>Regular Tag:</dt>
640                     <dd>Just a regular simple tag.</dd>""",
641                 """
642                     <dt>Module Tag:</dt>
643                     <dd>Just a simple module tag.</dd>""",
644                 """
645                     <dt>Version:</dt>
646                     <dd>1.0</dd>""",
647                 """
648                     <dt>Author:</dt>
649                     <dd>Alice</dd>""");
650         checkOutput("moduletags/testpkgmdltags/TestClassInModuleTags.html", false,
651                 """
652                     <dt>Module Tag:</dt>
653                     <dd>Just a simple module tag.</dd>""");
654     }
655 
checkHtml5OverviewSummaryModules()656     void checkHtml5OverviewSummaryModules() {
657         checkOutput("index.html", true,
658                 """
659                     <div id="all-modules-table">
660                     <div class="caption"><span>Modules</span></div>
661                     <div class="summary-table two-column-summary">
662                     <div class="table-header col-first">Module</div>
663                     <div class="table-header col-last">Description</div>
664                     """);
665         checkOutput("overview-summary.html", false,
666                 """
667                     <div id="all-modules-table">
668                     <div class="caption"><span>Packages</span></div>
669                     <div class="summary-table two-column-summary">
670                     <div class="table-header col-first">Package</div>
671                     <div class="table-header col-last">Description</div>
672                     """);
673     }
674 
checkHtml5OverviewSummaryPackages()675     void checkHtml5OverviewSummaryPackages() {
676         checkOutput("index.html", false,
677                 """
678                     <div class="overview-summary" id="all-modules-table">
679                     <table class="summary-table">
680                     <caption><span>Modules</span></caption>
681                     <table-header>
682                     <tr>
683                     <th class="col-first" scope="col">Module</th>
684                     <th class="col-last" scope="col">Description</th>
685                     </tr>
686                     </table-header>""",
687                 """
688                     </table>
689                     </div>
690                     </main>
691                     <main role="main">
692                     <div class="block">The overview summary page header.</div>
693                     </div>
694                     <a id="Packages">
695                     <!--   -->
696                     </a>
697                     <div class="overview-summary">
698                     <table>
699                     <caption><span>Packages</span></caption>""");
700         checkOutput("index.html", true,
701                 """
702                     <div id="all-packages-table">
703                     <div class="caption"><span>Packages</span></div>
704                     <div class="summary-table two-column-summary">
705                     <div class="table-header col-first">Package</div>
706                     <div class="table-header col-last">Description</div>""",
707                 """
708                     </nav>
709                     </header>
710                     <div class="flex-content">
711                     <main role="main">
712                     <div class="block">The overview summary page header.</div>
713                     <div id="all-packages-table">
714                     <div class="caption"><span>Packages</span></div>
715                     <div class="summary-table two-column-summary">""");
716     }
717 
checkModuleSummary()718     void checkModuleSummary() {
719         checkOutput("moduleA/module-summary.html", true,
720                 """
721                     <ul class="sub-nav-list">
722                     <li>Module:&nbsp;</li>
723                     <li><a href="#module-description">Description</a>&nbsp;|&nbsp;</li>
724                     <li><a href="#modules-summary">Modules</a>&nbsp;|&nbsp;</li>
725                     <li><a href="#packages-summary">Packages</a>&nbsp;|&nbsp;</li>
726                     <li>Services</li>
727                     </ul>""",
728                 """
729                     <section class="modules-summary" id="modules-summary">
730                     <!-- ============ MODULES SUMMARY =========== -->
731                     <h2>Modules</h2>""",
732                 """
733                     <div class="col-first even-row-color package-summary-table package-summary-table\
734                     -tab1"><a href="testpkgmdlA/package-summary.html">testpkgmdlA</a></div>
735                     <div class="col-last even-row-color package-summary-table package-summary-table-tab1">&nbsp;</div>""",
736                 """
737                     <section class="packages-summary" id="packages-summary">
738                     <!-- ============ PACKAGES SUMMARY =========== -->
739                     <h2>Packages</h2>""",
740                 """
741                     <div class="col-first even-row-color">transitive</div>
742                     <div class="col-second even-row-color"><a href="../moduleB/module-summary.html">moduleB</a></div>
743                     <div class="col-last even-row-color">
744                     <div class="block">This is a test description for the moduleB module.</div>
745                     </div>
746                     """);
747         checkOutput("moduleB/module-summary.html", true,
748                 """
749                     <li><a href="#module-description">Description</a>&nbsp;|&nbsp;</li>
750                     <li>Modules&nbsp;|&nbsp;</li>
751                     <li><a href="#packages-summary">Packages</a>&nbsp;|&nbsp;</li>
752                     <li><a href="#services-summary">Services</a></li>""",
753                 """
754                     <!-- ============ PACKAGES SUMMARY =========== -->
755                     <h2>Packages</h2>""",
756                 """
757                     <div class="col-first even-row-color package-summary-table package-summary-table\
758                     -tab2"><a href="testpkgmdlB/package-summary.html">testpkgmdlB</a></div>
759                     <div class="col-last even-row-color package-summary-table package-summary-table-tab2">&nbsp;</div>
760                     </div>""",
761                 """
762                     <!-- ============ PACKAGES SUMMARY =========== -->
763                     <h2>Packages</h2>""",
764                 """
765                     <!-- ============ SERVICES SUMMARY =========== -->
766                     <h2>Services</h2>""",
767                 """
768                     <div class="col-first even-row-color"><a href="testpkgmdlB/TestClassInModuleB.ht\
769                     ml" title="class in testpkgmdlB">TestClassInModuleB</a></div>
770                     <div class="col-last even-row-color">
771                     <div class="block">With a test description for uses.</div>
772                     </div>""",
773                 """
774                     <div class="caption"><span>Opens</span></div>
775                     <div class="summary-table two-column-summary">
776                     <div class="table-header col-first">Package</div>
777                     <div class="table-header col-last">Description</div>""",
778                 """
779                     <div class="caption"><span>Uses</span></div>
780                     <div class="details-table two-column-summary">
781                     <div class="table-header col-first">Type</div>
782                     <div class="table-header col-last">Description</div>""",
783                 """
784                     <div class="caption"><span>Provides</span></div>
785                     <div class="details-table two-column-summary">
786                     <div class="table-header col-first">Type</div>
787                     <div class="table-header col-last">Description</div>""");
788     }
789 
checkAggregatorModuleSummary()790     void checkAggregatorModuleSummary() {
791         checkOutput("moduleT/module-summary.html", true,
792                 """
793                     <div class="header">
794                     <h1 title="Module moduleT" class="title">Module moduleT</h1>
795                     </div>""",
796                 """
797                     <div class="block">This is a test description for the moduleT module. Search phr\
798                     ase <span id="searchphrase" class="search-tag-result">search phrase</span>. Make\
799                      sure there are no exported packages.</div>""",
800                 """
801                     <div class="col-first even-row-color">transitive</div>
802                     <div class="col-second even-row-color"><a href="../moduleA/module-summary.html">moduleA</a></div>
803                     <div class="col-last even-row-color">
804                     <div class="block">This is a test description for the moduleA module with a Search phrase search phrase.</div>
805                     </div>
806                     <div class="col-first odd-row-color">transitive</div>
807                     <div class="col-second odd-row-color"><a href="../moduleB/module-summary.html">moduleB</a></div>
808                     <div class="col-last odd-row-color">
809                     <div class="block">This is a test description for the moduleB module.</div>
810                     </div>""");
811     }
812 
checkNegatedModuleSummary()813     void checkNegatedModuleSummary() {
814         checkOutput("moduleA/module-summary.html", false,
815                 """
816                     <!-- ============ SERVICES SUMMARY =========== -->
817                     <h2>Services</h2>""");
818     }
819 
checkModuleFilesAndLinks(boolean found)820     void checkModuleFilesAndLinks(boolean found) {
821         checkFileAndOutput("moduleA/testpkgmdlA/package-summary.html", found,
822                 """
823                     <li><a href="../module-summary.html">Module</a></li>""",
824                 """
825                     <div class="sub-title"><span class="module-label-in-package">Module</span>&nbsp;\
826                     <a href="../module-summary.html">moduleA</a></div>""");
827         checkFileAndOutput("moduleA/testpkgmdlA/TestClassInModuleA.html", found,
828                 """
829                     <li><a href="../module-summary.html">Module</a></li>""",
830                 """
831                     <div class="sub-title"><span class="module-label-in-type">Module</span>&nbsp;<a \
832                     href="../module-summary.html">moduleA</a></div>""");
833         checkFileAndOutput("moduleB/testpkgmdlB/AnnotationType.html", found,
834                 """
835                     <div class="sub-title"><span class="module-label-in-type">Module</span>&nbsp;<a \
836                     href="../module-summary.html">moduleB</a></div>""",
837                 """
838                     <div class="sub-title"><span class="package-label-in-type">Package</span>&nbsp;<\
839                     a href="package-summary.html">testpkgmdlB</a></div>""");
840         checkFiles(found,
841                 "moduleA/module-summary.html");
842     }
843 
checkModulesInSearch(boolean found)844     void checkModulesInSearch(boolean found) {
845         checkOutput("index-all.html", found,
846                 """
847                     <dl class="index">
848                     <dt><a href="moduleA/module-summary.html">moduleA</a> - module moduleA</dt>
849                     <dd>
850                     <div class="block">This is a test description for the moduleA module with a Search phrase search phrase.</div>
851                     </dd>
852                     <dt><a href="moduleB/module-summary.html">moduleB</a> - module moduleB</dt>
853                     <dd>
854                     <div class="block">This is a test description for the moduleB module.</div>
855                     </dd>
856                     </dl>""",
857                 """
858                     <dl class="index">
859                     <dt><a href="moduleB/module-summary.html#search_word" class="search-tag-link">se\
860                     arch_word</a> - Search tag in module moduleB</dt>
861                     <dd>&nbsp;</dd>
862                     <dt><a href="moduleA/module-summary.html#searchphrase" class="search-tag-link">s\
863                     earch phrase</a> - Search tag in module moduleA</dt>
864                     <dd>with description</dd>
865                     </dl>""");
866         checkOutput("index-all.html", false,
867                 """
868                     <dt><a href="moduleA/module-summary.html#searchphrase" class="search-tag-link">s\
869                     earch phrase</a> - Search tag in module moduleA</dt>
870                     <dd>with description</dd>
871                     <dt><a href="moduleA/module-summary.html#searchphrase" class="search-tag-link">s\
872                     earch phrase</a></span> - Search tag in module moduleA</dt>
873                     <dd>with description</dd>""");
874     }
875 
checkModuleModeCommon()876     void checkModuleModeCommon() {
877         checkOutput("index.html", true,
878                 """
879                     <div class="col-first even-row-color all-modules-table all-modules-table-tab1"><\
880                     a href="moduleA/module-summary.html">moduleA</a></div>
881                     <div class="col-last even-row-color all-modules-table all-modules-table-tab1">
882                     <div class="block">This is a test description for the moduleA module with a Search phrase search phrase.</div>""",
883                 """
884                     <div class="col-first odd-row-color all-modules-table all-modules-table-tab1"><a\
885                      href="moduleB/module-summary.html">moduleB</a></div>
886                     <div class="col-last odd-row-color all-modules-table all-modules-table-tab1">
887                     <div class="block">This is a test description for the moduleB module.</div>""",
888                 """
889                     <div class="col-first odd-row-color all-modules-table all-modules-table-tab1"><a\
890                      href="moduletags/module-summary.html">moduletags</a></div>
891                     <div class="col-last odd-row-color all-modules-table all-modules-table-tab1">
892                     <div class="block">This is a test description for the moduletags module.<br>
893                      Type Link: <a href="moduletags/testpkgmdltags/TestClassInModuleTags.html" title\
894                     ="class in testpkgmdltags"><code>TestClassInModuleTags</code></a>.<br>
895                      Member Link: <a href="moduletags/testpkgmdltags/TestClassInModuleTags.html#test\
896                     Method(java.lang.String)"><code>testMethod(String)</code></a>.<br>
897                      Package Link: <a href="moduletags/testpkgmdltags/package-summary.html"><code>testpkgmdltags</code></a>.<br></div>
898                     </div>""");
899         checkOutput("moduleA/module-summary.html", true,
900                 """
901                     <li><a href="#module-description">Description</a>&nbsp;|&nbsp;</li>
902                     <li><a href="#modules-summary">Modules</a>&nbsp;|&nbsp;</li>
903                     <li><a href="#packages-summary">Packages</a>&nbsp;|&nbsp;</li>
904                     <li>Services</li>""",
905                 """
906                     <div class="col-first even-row-color"><a href="../moduleB/module-summary.html">moduleB</a></div>
907                     <div class="col-last even-row-color"><a href="../moduleB/testpkgmdlB/package-summary.html">testpkgmdlB</a></div>
908                     """);
909         checkOutput("moduletags/module-summary.html", true,
910                 """
911                     <div class="col-first even-row-color package-summary-table package-summary-table\
912                     -tab1"><a href="testpkgmdltags/package-summary.html">testpkgmdltags</a></div>
913                     <div class="col-last even-row-color package-summary-table package-summary-table-tab1">&nbsp;</div>""",
914                 """
915                     <li><a href="#module-description">Description</a>&nbsp;|&nbsp;</li>
916                     <li><a href="#modules-summary">Modules</a>&nbsp;|&nbsp;</li>
917                     <li><a href="#packages-summary">Packages</a>&nbsp;|&nbsp;</li>
918                     <li>Services</li>""",
919                 """
920                     <div class="caption"><span>Indirect Requires</span></div>
921                     <div class="details-table three-column-summary">""",
922                 """
923                     <div class="col-first even-row-color">transitive</div>
924                     <div class="col-second even-row-color"><a href="../moduleB/module-summary.html">moduleB</a></div>
925                     <div class="col-last even-row-color">
926                     <div class="block">This is a test description for the moduleB module.</div>
927                     </div>""",
928                 """
929                     <div class="caption"><span>Indirect Exports</span></div>
930                     <div class="details-table two-column-summary">""",
931                 """
932                     <div class="caption"><span>Requires</span></div>
933                     <div class="details-table three-column-summary">
934                     <div class="table-header col-first">Modifier</div>
935                     <div class="table-header col-second">Module</div>
936                     <div class="table-header col-last">Description</div>""",
937                 """
938                     <div class="caption"><span>Indirect Requires</span></div>
939                     <div class="details-table three-column-summary">
940                     <div class="table-header col-first">Modifier</div>
941                     <div class="table-header col-second">Module</div>
942                     <div class="table-header col-last">Description</div>""",
943                 """
944                     <div class="caption"><span>Indirect Opens</span></div>
945                     <div class="details-table two-column-summary">
946                     <div class="table-header col-first">From</div>
947                     <div class="table-header col-last">Packages</div>""",
948                 """
949                     <div class="col-first even-row-color"><a href="../moduleB/module-summary.html">moduleB</a></div>
950                     <div class="col-last even-row-color"><a href="../moduleB/testpkgmdlB/package-summary.html">testpkgmdlB</a></div>
951                     """);
952     }
953 
checkModuleModeApi(boolean found)954     void checkModuleModeApi(boolean found) {
955         checkOutput("moduleA/module-summary.html", found,
956                 """
957                     <div class="col-first even-row-color package-summary-table package-summary-table\
958                     -tab1"><a href="testpkgmdlA/package-summary.html">testpkgmdlA</a></div>
959                     <div class="col-last even-row-color package-summary-table package-summary-table-tab1">&nbsp;</div>""");
960         checkOutput("moduleB/module-summary.html", found,
961                 """
962                     <li><a href="#module-description">Description</a>&nbsp;|&nbsp;</li>
963                     <li>Modules&nbsp;|&nbsp;</li>
964                     <li><a href="#packages-summary">Packages</a>&nbsp;|&nbsp;</li>
965                     <li><a href="#services-summary">Services</a></li>""",
966                 """
967                     <div class="col-first even-row-color package-summary-table package-summary-table\
968                     -tab2"><a href="testpkgmdlB/package-summary.html">testpkgmdlB</a></div>
969                     <div class="col-last even-row-color package-summary-table package-summary-table-tab2">&nbsp;</div>""",
970                 """
971                     <div id="package-summary-table">
972                     <div class="caption"><span>Opens</span></div>
973                     <div class="summary-table two-column-summary">
974                     <div class="table-header col-first">Package</div>
975                     <div class="table-header col-last">Description</div>
976                     <div class="col-first even-row-color package-summary-table package-summary-table\
977                     -tab2"><a href="testpkgmdlB/package-summary.html">testpkgmdlB</a></div>
978                     <div class="col-last even-row-color package-summary-table package-summary-table-tab2">&nbsp;</div>
979                     </div>
980                     </div>""",
981                 """
982                     <div class="col-first even-row-color"><a href="testpkgmdlB/TestClassInModuleB.ht\
983                     ml" title="class in testpkgmdlB">TestClassInModuleB</a></div>
984                     <div class="col-last even-row-color">
985                     <div class="block">With a test description for uses.</div>
986                     """);
987         checkOutput("moduletags/module-summary.html", found,
988                 """
989                     <div class="col-first even-row-color">transitive static</div>
990                     <div class="col-second even-row-color"><a href="../moduleA/module-summary.html">moduleA</a></div>
991                     <div class="col-last even-row-color">
992                     <div class="block">This is a test description for the moduleA module with a Search phrase search phrase.</div>""");
993     }
994 
checkModuleModeAll(boolean found)995     void checkModuleModeAll(boolean found) {
996         checkOutput("moduleA/module-summary.html", found,
997                 """
998                     <div class="col-first even-row-color"> </div>
999                     <div class="col-second even-row-color">java.base</div>
1000                     <div class="col-last even-row-color">&nbsp;</div>""",
1001                 """
1002                     <div class="col-first even-row-color"> </div>
1003                     <div class="col-second even-row-color"><a href="../moduleC/module-summary.html">moduleC</a></div>
1004                     <div class="col-last even-row-color">
1005                     <div class="block">This is a test description for the moduleC module.</div>
1006                     </div>""",
1007                 """
1008                     <div class="col-first even-row-color"><a href="../moduleC/module-summary.html">moduleC</a></div>
1009                     <div class="col-last even-row-color"><a href="../moduleC/testpkgmdlC/package-summary.html">testpkgmdlC</a></div>""",
1010                 """
1011                     <div class="col-first odd-row-color package-summary-table package-summary-table-\
1012                     tab1"><a href="testpkgmdlA/package-summary.html">testpkgmdlA</a></div>
1013                     <div class="col-second odd-row-color package-summary-table package-summary-table-tab1">All Modules</div>
1014                     <div class="col-last odd-row-color package-summary-table package-summary-table-tab1">&nbsp;</div>""",
1015                 """
1016                     <div class="table-tabs" role="tablist" aria-orientation="horizontal">\
1017                     <button id="package-summary-table-tab0" role="tab" aria-selected="true" aria-con\
1018                     trols="package-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)"\
1019                      onclick="show('package-summary-table', 'package-summary-table', 3)" class="acti\
1020                     ve-table-tab">All Packages</button>\
1021                     <button id="package-summary-table-tab1" role="tab" aria-selected="false" aria-co\
1022                     ntrols="package-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event\
1023                     )" onclick="show('package-summary-table', 'package-summary-table-tab1', 3)" clas\
1024                     s="table-tab">Exports</button>\
1025                     <button id="package-summary-table-tab3" role="tab" aria-selected="false" aria-co\
1026                     ntrols="package-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event\
1027                     )" onclick="show('package-summary-table', 'package-summary-table-tab3', 3)" clas\
1028                     s="table-tab">Concealed</button>\
1029                     </div>""",
1030                 """
1031                     <div class="col-first even-row-color package-summary-table package-summary-table\
1032                     -tab3"><a href="concealedpkgmdlA/package-summary.html">concealedpkgmdlA</a></div\
1033                     >
1034                     <div class="col-second even-row-color package-summary-table package-summary-table-tab3">None</div>
1035                     <div class="col-last even-row-color package-summary-table package-summary-table-tab3">&nbsp;</div>""");
1036         checkOutput("moduleB/module-summary.html", found,
1037                 """
1038                     <li><a href="#module-description">Description</a>&nbsp;|&nbsp;</li>
1039                     <li><a href="#modules-summary">Modules</a>&nbsp;|&nbsp;</li>
1040                     <li><a href="#packages-summary">Packages</a>&nbsp;|&nbsp;</li>
1041                     <li><a href="#services-summary">Services</a></li>""",
1042                 """
1043                     <div class="col-first even-row-color package-summary-table package-summary-table\
1044                     -tab2"><a href="testpkgmdlB/package-summary.html">testpkgmdlB</a></div>
1045                     <div class="col-second even-row-color package-summary-table package-summary-table-tab2">None</div>
1046                     <div class="col-second even-row-color package-summary-table package-summary-table-tab2">All Modules</div>
1047                     <div class="col-last even-row-color package-summary-table package-summary-table-tab2">&nbsp;</div>""",
1048                 """
1049                     <div class="col-first even-row-color"> </div>
1050                     <div class="col-second even-row-color">java.base</div>
1051                     <div class="col-last even-row-color">&nbsp;</div>""",
1052                 """
1053                     <div class="col-first even-row-color"><a href="testpkgmdlB/TestClass2InModuleB.html"\
1054                      title="class in testpkgmdlB">TestClass2InModuleB</a></div>
1055                     <div class="col-last even-row-color">&nbsp;</div>""",
1056                 """
1057                     <div class="col-first even-row-color"><a href="testpkg2mdlB/TestInterface2InModuleB.h\
1058                     tml" title="interface in testpkg2mdlB">TestInterface2InModuleB</a></div>
1059                     <div class="col-last even-row-color">&nbsp;<br>(<span class="implementation-label">Im\
1060                     plementation(s):</span>&nbsp;<a href="testpkgmdlB/TestClass2InModuleB.html" titl\
1061                     e="class in testpkgmdlB">TestClass2InModuleB</a>)</div>""",
1062                 """
1063                     <div class="col-first odd-row-color"><a href="testpkg2mdlB/TestInterfaceInModuleB.ht\
1064                     ml" title="interface in testpkg2mdlB">TestInterfaceInModuleB</a></div>
1065                     <div class="col-last odd-row-color">&nbsp;<br>(<span class="implementation-label">Im\
1066                     plementation(s):</span>&nbsp;<a href="testpkgmdlB/TestClassInModuleB.html" title\
1067                     ="class in testpkgmdlB">TestClassInModuleB</a>)</div>""",
1068                 """
1069                     <div class="table-tabs" role="tablist" aria-orientation="horizontal">\
1070                     <button id="package-summary-table-tab0" role="tab" aria-selected="true" aria-con\
1071                     trols="package-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)"\
1072                      onclick="show('package-summary-table', 'package-summary-table', 4)" class="acti\
1073                     ve-table-tab">All Packages</button>\
1074                     <button id="package-summary-table-tab1" role="tab" aria-selected="false" aria-co\
1075                     ntrols="package-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event\
1076                     )" onclick="show('package-summary-table', 'package-summary-table-tab1', 4)" clas\
1077                     s="table-tab">Exports</button>\
1078                     <button id="package-summary-table-tab2" role="tab" aria-selected="false" aria-co\
1079                     ntrols="package-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event\
1080                     )" onclick="show('package-summary-table', 'package-summary-table-tab2', 4)" clas\
1081                     s="table-tab">Opens</button>\
1082                     </div>""",
1083                 """
1084                     <div class="col-first odd-row-color"><a href="testpkgmdlB/TestClassInModuleB.htm\
1085                     l" title="class in testpkgmdlB">TestClassInModuleB</a></div>
1086                     <div class="col-last odd-row-color">
1087                     <div class="block">With a test description for uses.</div>
1088                     """);
1089         checkOutput("moduleC/module-summary.html", found,
1090                 """
1091                     <div class="caption"><span>Exports</span></div>
1092                     <div class="summary-table three-column-summary">
1093                     <div class="table-header col-first">Package</div>
1094                     <div class="table-header col-second">Exported To Modules</div>
1095                     <div class="table-header col-last">Description</div>""");
1096         checkOutput("moduletags/module-summary.html", found,
1097                 """
1098                     <div class="col-first odd-row-color">transitive static</div>
1099                     <div class="col-second odd-row-color"><a href="../moduleA/module-summary.html">moduleA</a></div>
1100                     <div class="col-last odd-row-color">
1101                     <div class="block">This is a test description for the moduleA module with a Search phrase search phrase.</div>""");
1102     }
1103 
checkModuleDeprecation(boolean found)1104     void checkModuleDeprecation(boolean found) {
1105         checkOutput("moduleA/module-summary.html", found,
1106                 """
1107                     <div class="deprecation-block"><span class="deprecated-label">Deprecated, for re\
1108                     moval: This API element is subject to removal in a future version.</span>
1109                     <div class="deprecation-comment">This module is deprecated.</div>
1110                     </div>""");
1111         checkOutput("deprecated-list.html", found,
1112                 """
1113                     <ul>
1114                     <li><a href="#for-removal">Terminally Deprecated</a></li>
1115                     <li><a href="#module">Modules</a></li>
1116                     </ul>""",
1117                 """
1118                     <div class="col-summary-item-name even-row-color"><a href="moduleA/module-summary.html">moduleA</a></div>
1119                     <div class="col-last even-row-color">
1120                     <div class="deprecation-comment">This module is deprecated.</div>""");
1121         checkOutput("moduleB/module-summary.html", !found,
1122                 """
1123                     <div class="deprecation-block"><span class="deprecated-label">Deprecated.</span>
1124                     <div class="deprecation-comment">This module is deprecated using just the javadoc tag.</div>
1125                     """);
1126         checkOutput("moduletags/module-summary.html", found,
1127                 """
1128                     <div class="header">
1129                     <h1 title="Module moduletags" class="title">Module moduletags</h1>
1130                     </div>
1131                     <hr>
1132                     <div class="module-signature"><span class="annotations">@Deprecated
1133                     </span>module <span class="element-name">moduletags</span></div>""",
1134                 """
1135                     <div class="deprecation-block"><span class="deprecated-label">Deprecated.</span></div>""");
1136     }
1137 
checkModuleAnnotation()1138     void checkModuleAnnotation() {
1139         checkOutput("moduleB/module-summary.html", true,
1140                 """
1141                     <div class="header">
1142                     <h1 title="Module moduleB" class="title">Module moduleB</h1>
1143                     </div>
1144                     <hr>
1145                     <div class="module-signature"><span class="annotations"><a href="testpkgmdlB/Ann\
1146                     otationType.html" title="annotation interface in testpkgmdlB">@AnnotationType</a\
1147                     >(<a href="testpkgmdlB/AnnotationType.html#optional()">optional</a>="Module Anno\
1148                     tation",
1149                                     <a href="testpkgmdlB/AnnotationType.html#required()">required</a>=2016)
1150                     </span>module <span class="element-name">moduleB</span></div>""");
1151         checkOutput("moduleB/module-summary.html", false,
1152                 "@AnnotationTypeUndocumented");
1153     }
1154 
checkModuleSummaryNoExported(boolean found)1155     void checkModuleSummaryNoExported(boolean found) {
1156         checkOutput("moduleNoExport/module-summary.html", found,
1157                 """
1158                     <!-- ============ PACKAGES SUMMARY =========== -->
1159                     <h2>Packages</h2>""",
1160                 """
1161                     <div class="caption"><span>Concealed</span></div>""");
1162     }
1163 
checkGroupOption()1164     void checkGroupOption() {
1165         checkOutput("index.html", true,
1166                 """
1167                     <div id="all-modules-table">
1168                     <div class="table-tabs" role="tablist" aria-orientation="horizontal">\
1169                     <button id="all-modules-table-tab0" role="tab" aria-selected="true" aria-control\
1170                     s="all-modules-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick\
1171                     ="show('all-modules-table', 'all-modules-table', 2)" class="active-table-tab">Al\
1172                     l Modules</button>\
1173                     <button id="all-modules-table-tab1" role="tab" aria-selected="false" aria-contro\
1174                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1175                     ck="show('all-modules-table', 'all-modules-table-tab1', 2)" class="table-tab">Mo\
1176                     dule Group A</button>\
1177                     <button id="all-modules-table-tab2" role="tab" aria-selected="false" aria-contro\
1178                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1179                     ck="show('all-modules-table', 'all-modules-table-tab2', 2)" class="table-tab">Mo\
1180                     dule Group B &amp; C</button>\
1181                     <button id="all-modules-table-tab3" role="tab" aria-selected="false" aria-contro\
1182                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1183                     ck="show('all-modules-table', 'all-modules-table-tab3', 2)" class="table-tab">Ot\
1184                     her Modules</button>\
1185                     </div>
1186                     <div id="all-modules-table.tabpanel" role="tabpanel">
1187                     <div class="summary-table two-column-summary" aria-labelledby="all-modules-table-tab0">""",
1188                 """
1189                     var evenRowColor = "even-row-color";
1190                     var oddRowColor = "odd-row-color";
1191                     var tableTab = "table-tab";
1192                     var activeTableTab = "active-table-tab";""");
1193         checkOutput("index.html", false,
1194                 """
1195                     <div class="overview-summary">
1196                     <table>
1197                     <caption><span>Modules</span></caption>""",
1198                 "Java SE Modules");
1199     }
1200 
checkGroupOptionOrdering()1201     void checkGroupOptionOrdering() {
1202         checkOutput("index.html", true,
1203                 """
1204                     <div class="table-tabs" role="tablist" aria-orientation="horizontal">\
1205                     <button id="all-modules-table-tab0" role="tab" aria-selected="true" aria-control\
1206                     s="all-modules-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick\
1207                     ="show('all-modules-table', 'all-modules-table', 2)" class="active-table-tab">Al\
1208                     l Modules</button>\
1209                     <button id="all-modules-table-tab1" role="tab" aria-selected="false" aria-contro\
1210                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1211                     ck="show('all-modules-table', 'all-modules-table-tab1', 2)" class="table-tab">B\
1212                      Group</button>\
1213                     <button id="all-modules-table-tab2" role="tab" aria-selected="false" aria-contro\
1214                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1215                     ck="show('all-modules-table', 'all-modules-table-tab2', 2)" class="table-tab">C\
1216                      Group</button>\
1217                     <button id="all-modules-table-tab3" role="tab" aria-selected="false" aria-contro\
1218                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1219                     ck="show('all-modules-table', 'all-modules-table-tab3', 2)" class="table-tab">A\
1220                      Group</button>\
1221                     <button id="all-modules-table-tab4" role="tab" aria-selected="false" aria-contro\
1222                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1223                     ck="show('all-modules-table', 'all-modules-table-tab4', 2)" class="table-tab">Ot\
1224                     her Modules</button>\
1225                     </div>""");
1226         checkOutput("index.html", false,
1227                 """
1228                     <div class="table-tabs" role="tablist" aria-orientation="horizontal">\
1229                     <button id="all-modules-table-tab0" role="tab" aria-selected="true" aria-control\
1230                     s="all-modules-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick\
1231                     ="show('all-modules-table', 'all-modules-table', 2)" class="active-table-tab">Al\
1232                     l Modules</button>\
1233                     <button id="all-modules-table-tab1" role="tab" aria-selected="false" aria-contro\
1234                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1235                     ck="show('all-modules-table', 'all-modules-table-tab1', 2)" class="table-tab">A\
1236                      Group</button>\
1237                     <button id="all-modules-table-tab2" role="tab" aria-selected="false" aria-contro\
1238                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1239                     ck="show('all-modules-table', 'all-modules-table-tab2', 2)" class="table-tab">B\
1240                      Group</button>\
1241                     <button id="all-modules-table-tab3" role="tab" aria-selected="false" aria-contro\
1242                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1243                     ck="show('all-modules-table', 'all-modules-table-tab3', 2)" class="table-tab">C\
1244                      Group</button>\
1245                     <button id="all-modules-table-tab4" role="tab" aria-selected="false" aria-contro\
1246                     ls="all-modules-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1247                     ck="show('all-modules-table', 'all-modules-table-tab4', 2)" class="table-tab">Ot\
1248                     her Modules</button>\
1249                     </div>""",
1250                 "Java SE Modules");
1251     }
1252 
checkUnnamedModuleGroupOption()1253     void checkUnnamedModuleGroupOption() {
1254         checkOutput("index.html", true,
1255                 """
1256                     <div class="block">The overview summary page header.</div>
1257                     <div id="all-packages-table">
1258                     <div class="table-tabs" role="tablist" aria-orientation="horizontal">\
1259                     <button id="all-packages-table-tab0" role="tab" aria-selected="true" aria-contro\
1260                     ls="all-packages-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" oncli\
1261                     ck="show('all-packages-table', 'all-packages-table', 2)" class="active-table-tab\
1262                     ">All Packages</button>\
1263                     <button id="all-packages-table-tab1" role="tab" aria-selected="false" aria-contro\
1264                     ls="all-packages-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1265                     ck="show('all-packages-table', 'all-packages-table-tab1', 2)" class="table-tab">P\
1266                     ackage Group 0</button>\
1267                     <button id="all-packages-table-tab2" role="tab" aria-selected="false" aria-contro\
1268                     ls="all-packages-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1269                     ck="show('all-packages-table', 'all-packages-table-tab2', 2)" class="table-tab">P\
1270                     ackage Group 1</button>\
1271                     </div>
1272                     <div id="all-packages-table.tabpanel" role="tabpanel">
1273                     <div class="summary-table two-column-summary" aria-labelledby="all-packages-table-tab0">""",
1274                 """
1275                     var evenRowColor = "even-row-color";
1276                     var oddRowColor = "odd-row-color";
1277                     var tableTab = "table-tab";
1278                     var activeTableTab = "active-table-tab";""");
1279     }
1280 
checkGroupOptionPackageOrdering()1281     void checkGroupOptionPackageOrdering() {
1282         checkOutput("index.html", true,
1283                 """
1284                     <div class="table-tabs" role="tablist" aria-orientation="horizontal">\
1285                     <button id="all-packages-table-tab0" role="tab" aria-selected="true" aria-contro\
1286                     ls="all-packages-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" oncli\
1287                     ck="show('all-packages-table', 'all-packages-table', 2)" class="active-table-tab\
1288                     ">All Packages</button>\
1289                     <button id="all-packages-table-tab1" role="tab" aria-selected="false" aria-contr\
1290                     ols="all-packages-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onc\
1291                     lick="show('all-packages-table', 'all-packages-table-tab1', 2)" class="table-tab\
1292                     ">Z Group</button>\
1293                     <button id="all-packages-table-tab2" role="tab" aria-selected="false" aria-contr\
1294                     ols="all-packages-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onc\
1295                     lick="show('all-packages-table', 'all-packages-table-tab2', 2)" class="table-tab\
1296                     ">A Group</button>\
1297                     </div>""");
1298     }
1299 
checkGroupOptionSingleModule()1300     void checkGroupOptionSingleModule() {
1301         checkOutput("index.html", true,
1302                 "window.location.replace('moduleB/module-summary.html')");
1303     }
1304 
checkModuleName(boolean found)1305     void checkModuleName(boolean found) {
1306         checkOutput("test.moduleFullName/module-summary.html", found,
1307                 """
1308                     <div class="header">
1309                     <h1 title="Module test.moduleFullName" class="title">Module test.moduleFullName</h1>
1310                     </div>""");
1311         checkOutput("index-all.html", found,
1312                 """
1313                     <h2 class="title" id="I:T">T</h2>
1314                     <dl class="index">
1315                     <dt><a href="test.moduleFullName/module-summary.html">test.moduleFullName</a> - module test.moduleFullName</dt>
1316                     <dd>
1317                     <div class="block">This is a test description for the test.moduleFullName.</div>
1318                     </dd>""");
1319         checkOutput("test.moduleFullName/module-summary.html", !found,
1320                 """
1321                     <div class="header">
1322                     <h1 title="Module moduleFullName" class="title">Module moduleFullName</h1>
1323                     </div>""");
1324         checkOutput("index-all.html", !found,
1325                 """
1326                     <dl class="index">
1327                     <dt><a href="test.moduleFullName/module-summary.html">moduleFullName</a> - module moduleFullName</dt>
1328                     <dd>
1329                     <div class="block">This is a test description for the test.moduleFullName.</div>
1330                     </dd>
1331                     </dl>""");
1332     }
1333 
checkLinkOffline()1334     void checkLinkOffline() {
1335         checkOutput("moduleB/testpkg3mdlB/package-summary.html", true,
1336                 """
1337                     <a href="https://docs.oracle.com/javase/9/docs/api/java.base/java/lang/String.ht\
1338                     ml" title="class or interface in java.lang" class="external-link"><code>Link to \
1339                     String Class</code></a>""");
1340         checkOutput("moduleB/testpkg3mdlB/package-summary.html", true,
1341                 """
1342                     <a href="https://docs.oracle.com/javase/9/docs/api/java.base/java/lang/package-s\
1343                     ummary.html" class="external-link"><code>Link to java.lang package</code></a>""");
1344         checkOutput("moduleB/testpkg3mdlB/package-summary.html", true,
1345                 """
1346                     <a href="https://docs.oracle.com/javase/9/docs/api/java.base/module-summary.html\
1347                     " class="external-link"><code>Link to java.base module</code></a>""");
1348     }
1349 
1350     void checkLinkSource(boolean includePrivate) {
1351         checkOutput("moduleA/module-summary.html", !includePrivate,
1352                 """
1353                     div id="package-summary-table">
1354                     <div class="caption"><span>Exports</span></div>
1355                     <div class="summary-table two-column-summary">
1356                     <div class="table-header col-first">Package</div>
1357                     <div class="table-header col-last">Description</div>
1358                     <div class="col-first even-row-color package-summary-table package-summary-table-tab1">\
1359                     <a href="testpkgmdlA/package-summary.html">testpkgmdlA</a></div>
1360                     <div class="col-last even-row-color package-summary-table package-summary-table-tab1">&nbsp;</div>
1361                     </div>
1362                     </div>
1363                     """);
1364         checkOutput("moduleA/testpkgmdlA/TestClassInModuleA.html", true,
1365                 """
1366                     <section class="class-description" id="class-description">
1367                     <hr>
1368                     <div class="type-signature"><span class="modifiers">public class </span><span cl\
1369                     ass="element-name"><a href="../../src-html/moduleA/testpkgmdlA/TestClassInModule\
1370                     A.html#line-25">TestClassInModuleA</a></span>
1371                     <span class="extends-implements">extends java.lang.Object</span></div>
1372                     </section>""");
1373         checkOutput("src-html/moduleA/testpkgmdlA/TestClassInModuleA.html", true,
1374                 """
1375                     <span class="source-line-no">019</span><span id="line-19"> * Please contact Orac\
1376                     le, 500 Oracle Parkway, Redwood Shores, CA 94065 USA</span>
1377                     <span class="source-line-no">020</span><span id="line-20"> * or visit www.oracle\
1378                     .com if you need additional information or have any</span>
1379                     <span class="source-line-no">021</span><span id="line-21"> * questions.</span>
1380                     <span class="source-line-no">022</span><span id="line-22"> */</span>
1381                     <span class="source-line-no">023</span><span id="line-23">package testpkgmdlA;</span>
1382                     <span class="source-line-no">024</span><span id="line-24"></span>
1383                     <span class="source-line-no">025</span><span id="line-25">public class TestClassInModuleA {</span>
1384                     <span class="source-line-no">026</span><span id="line-26">}</span>""");
1385         if (includePrivate) {
1386             checkOutput("src-html/moduleA/concealedpkgmdlA/ConcealedClassInModuleA.html", true,
1387                     """
1388                         <span class="source-line-no">024</span><span id="line-24">package concealedpkgmdlA;</span>
1389                         <span class="source-line-no">025</span><span id="line-25"></span>
1390                         <span class="source-line-no">026</span><span id="line-26">public class ConcealedClassInModuleA {</span>
1391                         <span class="source-line-no">027</span><span id="line-27">    public void testMethodConcealedClass() { }</span>
1392                         <span class="source-line-no">028</span><span id="line-28">}</span>""");
1393         }
1394     }
1395 
1396     void checkAllPkgsAllClasses(boolean found) {
1397         checkOutput("allclasses-index.html", true,
1398                 """
1399                     <div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id=\
1400                     "all-classes-table-tab0" role="tab" aria-selected="true" aria-controls="all-clas\
1401                     ses-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('all\
1402                     -classes-table', 'all-classes-table', 2)" class="active-table-tab">All Classes a\
1403                     nd Interfaces</button>\
1404                     <button id="all-classes-table-tab2" role="tab" aria-selected="false" aria-contro\
1405                     ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1406                     ck="show('all-classes-table', 'all-classes-table-tab2', 2)" class="table-tab">Cl\
1407                     asses</button>\
1408                     <button id="all-classes-table-tab7" role="tab" aria-selected="false" aria-contro\
1409                     ls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" oncli\
1410                     ck="show('all-classes-table', 'all-classes-table-tab7', 2)" class="table-tab">An\
1411                     notation Interfaces</button></div>
1412                     """,
1413                 """
1414                     <div class="table-header col-first">Class</div>
1415                     <div class="table-header col-last">Description</div>
1416                     """);
1417         checkOutput("allpackages-index.html", true,
1418                 """
1419                     <div class="caption"><span>Package Summary</span></div>
1420                     <div class="summary-table two-column-summary">
1421                     <div class="table-header col-first">Package</div>
1422                     <div class="table-header col-last">Description</div>
1423                     """);
1424         checkOutput("allclasses-index.html", found,
1425                 """
1426                     <div class="summary-table two-column-summary" aria-labelledby="all-classes-table-tab0">
1427                     """);
1428         checkOutput("allpackages-index.html", found,
1429                 """
1430                     <div class="caption"><span>Package Summary</span></div>
1431                     <div class="summary-table two-column-summary">
1432                     """);
1433         checkOutput("allclasses-index.html", !found,
1434                 """
1435                     <table summary="Class Summary table, listing classes, and an explanation" aria-labelledby="t0">""");
1436         checkOutput("allpackages-index.html", !found,
1437                 """
1438                     <div class="packages-summary">
1439                     <table summary="Package Summary table, listing packages, and an explanation">""");
1440         checkOutput("type-search-index.js", true,
1441                 """
1442                     {"l":"All Classes and Interfaces","u":"allclasses-index.html"}""");
1443         checkOutput("package-search-index.js", true,
1444                 """
1445                     {"l":"All Packages","u":"allpackages-index.html"}""");
1446         checkOutput("index-all.html", true,
1447                 """
1448                     <br><a href="allclasses-index.html">All&nbsp;Classes&nbsp;and&nbsp;Interfaces</a\
1449                     ><span class="vertical-separator">|</span><a href="allpackages-index.html">All&n\
1450                     bsp;Packages</a>""");
1451     }
1452 }
1453