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