TestModules.java revision 4048:b6b9c65b47b4
1/*
2 * Copyright (c) 2016, 2017, 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
28 * @summary Test modules support in javadoc.
29 * @author bpatel
30 * @library ../lib
31 * @modules jdk.javadoc/jdk.javadoc.internal.tool
32 * @build JavadocTester
33 * @run main TestModules
34 */
35public class TestModules extends JavadocTester {
36
37    public static void main(String... args) throws Exception {
38        TestModules tester = new TestModules();
39        tester.runTests();
40    }
41
42    /**
43     * Test generated module pages for HTML 4.
44     */
45    @Test
46    void testHtml4() {
47        javadoc("-d", "out", "-use",
48                "-overview", testSrc("overview.html"),
49                "--module-source-path", testSrc,
50                "--module", "moduleA,moduleB",
51                "testpkgmdlA", "testpkgmdlB");
52        checkExit(Exit.OK);
53        checkDescription(true);
54        checkNoDescription(false);
55        checkOverviewSummaryModules();
56        checkModuleLink();
57        checkModuleClickThroughLinks();
58        checkModuleClickThrough(true);
59        checkModuleFilesAndLinks(true);
60        checkModulesInSearch(true);
61        checkOverviewFrame(true);
62    }
63
64    /**
65     * Test generated module pages for HTML 5.
66     */
67    @Test
68    void testHtml5() {
69        javadoc("-d", "out-html5", "-html5", "-use",
70                "-overview", testSrc("overview.html"),
71                "--module-source-path", testSrc,
72                "--module", "moduleA,moduleB",
73                "testpkgmdlA", "testpkgmdlB");
74        checkExit(Exit.OK);
75        checkHtml5Description(true);
76        checkHtml5NoDescription(false);
77        checkHtml5OverviewSummaryModules();
78        checkModuleLink();
79        checkModuleClickThroughLinks();
80        checkModuleClickThrough(true);
81        checkModuleFilesAndLinks(true);
82        checkModulesInSearch(true);
83        checkOverviewFrame(true);
84    }
85
86    /**
87     * Test generated module pages for HTML 4 with -nocomment option.
88     */
89    @Test
90    void testHtml4NoComment() {
91        javadoc("-d", "out-nocomment", "-nocomment", "-use",
92                "-overview", testSrc("overview.html"),
93                "--module-source-path", testSrc,
94                "--module", "moduleA,moduleB",
95                "testpkgmdlA", "testpkgmdlB");
96        checkExit(Exit.OK);
97        checkDescription(false);
98        checkNoDescription(true);
99        checkModuleLink();
100        checkModuleFilesAndLinks(true);
101        checkOverviewFrame(true);
102    }
103
104    /**
105     * Test generated module pages for HTML 5 with -nocomment option.
106     */
107    @Test
108    void testHtml5NoComment() {
109        javadoc("-d", "out-html5-nocomment", "-nocomment", "-html5", "-use",
110                "-overview", testSrc("overview.html"),
111                "--module-source-path", testSrc,
112                "--module", "moduleA,moduleB",
113                "testpkgmdlA", "testpkgmdlB");
114        checkExit(Exit.OK);
115        checkHtml5Description(false);
116        checkHtml5NoDescription(true);
117        checkModuleLink();
118        checkModuleFilesAndLinks(true);
119        checkOverviewFrame(true);
120    }
121
122    /**
123     * Test generated pages, in an unnamed module, for HTML 4.
124     */
125    @Test
126    void testHtml4UnnamedModule() {
127        javadoc("-d", "out-nomodule", "-use",
128                "-overview", testSrc("overview.html"),
129                "-sourcepath", testSrc,
130                "testpkgnomodule", "testpkgnomodule1");
131        checkExit(Exit.OK);
132        checkOverviewSummaryPackages();
133        checkModuleClickThrough(false);
134        checkModuleFilesAndLinks(false);
135        checkModulesInSearch(false);
136        checkOverviewFrame(false);
137    }
138
139    /**
140     * Test generated pages, in an unnamed module, for HTML 5.
141     */
142    @Test
143    void testHtml5UnnamedModule() {
144        javadoc("-d", "out-html5-nomodule", "-html5", "-use",
145                "-overview", testSrc("overview.html"),
146                "-sourcepath", testSrc,
147                "testpkgnomodule", "testpkgnomodule1");
148        checkExit(Exit.OK);
149        checkHtml5OverviewSummaryPackages();
150        checkModuleFilesAndLinks(false);
151        checkModulesInSearch(false);
152        checkOverviewFrame(false);
153    }
154
155    /**
156     * Test generated module pages with javadoc tags.
157     */
158    @Test
159    void testJDTagsInModules() {
160        javadoc("-d", "out-mdltags", "-author", "-version",
161                "-tag", "regular:a:Regular Tag:",
162                "-tag", "moduletag:s:Module Tag:",
163                "--module-source-path", testSrc,
164                "--module", "moduletags,moduleB",
165                "testpkgmdltags", "testpkgmdlB");
166        checkExit(Exit.OK);
167        checkModuleTags();
168    }
169
170    /**
171     * Test generated module summary page.
172     */
173    @Test
174    void testModuleSummary() {
175        javadoc("-d", "out-moduleSummary", "-use",
176                "--module-source-path", testSrc,
177                "--module", "moduleA,moduleB",
178                "testpkgmdlA", "testpkgmdlB", "moduleB/testpkg2mdlB");
179        checkExit(Exit.OK);
180        checkModuleSummary();
181        checkNegatedModuleSummary();
182    }
183
184    /**
185     * Test generated module pages and pages with link to modules.
186     */
187    @Test
188    void testModuleFilesAndLinks() {
189        javadoc("-d", "out-modulelinks",
190                "--module-source-path", testSrc,
191                "--module", "moduleA,moduleB",
192                "testpkgmdlA", "testpkgmdlB");
193        checkExit(Exit.OK);
194        checkModuleFilesAndLinks(true);
195        checkOverviewFrame(true);
196    }
197
198    /**
199     * Test generated module pages for a deprecated module.
200     */
201    @Test
202    void testModuleDeprecation() {
203        javadoc("-d", "out-moduledepr",
204                "-tag", "regular:a:Regular Tag:",
205                "-tag", "moduletag:s:Module Tag:",
206                "--module-source-path", testSrc,
207                "--module", "moduleA,moduleB,moduletags",
208                "testpkgmdlA", "testpkgmdlB", "testpkgmdltags");
209        checkExit(Exit.OK);
210        checkModuleDeprecation(true);
211    }
212
213    /**
214     * Test annotations on modules.
215     */
216    @Test
217    void testModuleAnnotation() {
218        javadoc("-d", "out-moduleanno",
219                "--module-source-path", testSrc,
220                "--module", "moduleA,moduleB",
221                "testpkgmdlA", "testpkgmdlB");
222        checkExit(Exit.OK);
223        checkModuleAnnotation();
224    }
225
226    /**
227     * Test module summary pages in "api" mode.
228     */
229    @Test
230    void testApiMode() {
231        javadoc("-d", "out-api", "-use", "--show-module-contents=api", "-author", "-version",
232                "-tag", "regular:a:Regular Tag:",
233                "-tag", "moduletag:s:Module Tag:",
234                "--module-source-path", testSrc,
235                "--module", "moduleA,moduleB,moduleC,moduletags",
236                "testpkgmdlA", "moduleA/concealedpkgmdlA", "testpkgmdlB", "testpkg2mdlB", "testpkgmdlC", "testpkgmdltags");
237        checkExit(Exit.OK);
238        checkModuleModeCommon();
239        checkModuleModeApi(true);
240        checkModuleModeAll(false);
241    }
242
243    /**
244     * Test module summary pages in "all" mode.
245     */
246    @Test
247    void testAllMode() {
248        javadoc("-d", "out-all", "-use", "--show-module-contents=all", "-author", "-version",
249                "-tag", "regular:a:Regular Tag:",
250                "-tag", "moduletag:s:Module Tag:",
251                "--module-source-path", testSrc,
252                "--module", "moduleA,moduleB,moduleC,moduletags",
253                "testpkgmdlA", "moduleA/concealedpkgmdlA", "testpkgmdlB", "testpkg2mdlB", "testpkgmdlC", "testpkgmdltags");
254        checkExit(Exit.OK);
255        checkModuleModeCommon();
256        checkModuleModeApi(false);
257        checkModuleModeAll(true);
258    }
259
260    void checkDescription(boolean found) {
261        checkOutput("moduleA-summary.html", found,
262                "<!-- ============ MODULE DESCRIPTION =========== -->\n"
263                + "<a name=\"module.description\">\n"
264                + "<!--   -->\n"
265                + "</a>\n"
266                + "<div class=\"block\">This is a test description for the moduleA module. Search "
267                + "phrase <a id=\"searchphrase\">search phrase</a>.</div>");
268        checkOutput("moduleB-summary.html", found,
269                "<!-- ============ MODULE DESCRIPTION =========== -->\n"
270                + "<a name=\"module.description\">\n"
271                + "<!--   -->\n"
272                + "</a>\n"
273                + "<div class=\"block\">This is a test description for the moduleB module. Search "
274                + "word <a id=\"search_word\">search_word</a> with no description.</div>");
275        checkOutput("overview-summary.html", found,
276                "</script>\n"
277                + "<div class=\"contentContainer\">\n"
278                + "<div class=\"block\">The overview summary page header.</div>\n"
279                + "</div>\n"
280                + "<div class=\"contentContainer\">\n"
281                + "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
282                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
283        checkOutput("overview-summary.html", false,
284                "</table>\n"
285                + "</div>\n"
286                + "<div class=\"contentContainer\">\n"
287                + "<div class=\"block\">The overview summary page header.</div>\n"
288                + "</div>\n"
289                + "<div class=\"contentContainer\">\n"
290                + "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
291                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
292    }
293
294    void checkNoDescription(boolean found) {
295        checkOutput("moduleA-summary.html", found,
296                "<div class=\"contentContainer\">\n"
297                + "<ul class=\"blockList\">\n"
298                + "<li class=\"blockList\">\n"
299                + "<ul class=\"blockList\">\n"
300                + "<li class=\"blockList\">\n"
301                + "<!-- ============ MODULES SUMMARY =========== -->");
302        checkOutput("moduleB-summary.html", found,
303                "<div class=\"contentContainer\">\n"
304                + "<ul class=\"blockList\">\n"
305                + "<li class=\"blockList\">\n"
306                + "<ul class=\"blockList\">\n"
307                + "<li class=\"blockList\">\n"
308                + "<!-- ============ PACKAGES SUMMARY =========== -->");
309    }
310
311    void checkHtml5Description(boolean found) {
312        checkOutput("moduleA-summary.html", found,
313                "<section role=\"region\">\n"
314                + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated, for removal:"
315                + " This API element is subject to removal in a future version. </span>\n"
316                + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
317                + "</div>\n"
318                + "<!-- ============ MODULE DESCRIPTION =========== -->\n"
319                + "<a id=\"module.description\">\n"
320                + "<!--   -->\n"
321                + "</a>\n"
322                + "<div class=\"block\">This is a test description for the moduleA module. Search "
323                + "phrase <a id=\"searchphrase\">search phrase</a>.</div>");
324        checkOutput("moduleB-summary.html", found,
325                "<section role=\"region\">\n"
326                + "<!-- ============ MODULE DESCRIPTION =========== -->\n"
327                + "<a id=\"module.description\">\n"
328                + "<!--   -->\n"
329                + "</a>\n"
330                + "<div class=\"block\">This is a test description for the moduleB module. Search "
331                + "word <a id=\"search_word\">search_word</a> with no description.</div>");
332        checkOutput("overview-summary.html", found,
333                "</nav>\n"
334                + "</header>\n"
335                + "<main role=\"main\">\n"
336                + "<div class=\"contentContainer\">\n"
337                + "<div class=\"block\">The overview summary page header.</div>\n"
338                + "</div>\n"
339                + "<div class=\"contentContainer\">\n"
340                + "<table class=\"overviewSummary\">\n"
341                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
342        checkOutput("overview-summary.html", false,
343                "</table>\n"
344                + "</div>\n"
345                + "</main>\n"
346                + "<main role=\"main\">\n"
347                + "<div class=\"contentContainer\">\n"
348                + "<div class=\"block\">The overview summary page header.</div>\n"
349                + "</div>\n"
350                + "<div class=\"contentContainer\">\n"
351                + "<table class=\"overviewSummary\">\n"
352                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>");
353    }
354
355    void checkHtml5NoDescription(boolean found) {
356        checkOutput("moduleA-summary.html", found,
357                "<div class=\"contentContainer\">\n"
358                + "<ul class=\"blockList\">\n"
359                + "<li class=\"blockList\">\n"
360                + "<ul class=\"blockList\">\n"
361                + "<li class=\"blockList\">\n"
362                + "<!-- ============ MODULES SUMMARY =========== -->");
363        checkOutput("moduleB-summary.html", found,
364                "<div class=\"contentContainer\">\n"
365                + "<ul class=\"blockList\">\n"
366                + "<li class=\"blockList\">\n"
367                + "<ul class=\"blockList\">\n"
368                + "<li class=\"blockList\">\n"
369                + "<!-- ============ PACKAGES SUMMARY =========== -->");
370    }
371
372    void checkModuleLink() {
373        checkOutput("overview-summary.html", true,
374                "<li>Module</li>");
375        checkOutput("moduleA-summary.html", true,
376                "<li class=\"navBarCell1Rev\">Module</li>");
377        checkOutput("moduleB-summary.html", true,
378                "<li class=\"navBarCell1Rev\">Module</li>");
379        checkOutput("testpkgmdlA/class-use/TestClassInModuleA.html", true,
380                "<li><a href=\"../../moduleA-summary.html\">Module</a></li>");
381        checkOutput("testpkgmdlB/package-summary.html", true,
382                "<li><a href=\"../moduleB-summary.html\">Module</a></li>");
383        checkOutput("testpkgmdlB/TestClassInModuleB.html", true,
384                "<li><a href=\"../moduleB-summary.html\">Module</a></li>");
385        checkOutput("testpkgmdlB/class-use/TestClassInModuleB.html", true,
386                "<li><a href=\"../../moduleB-summary.html\">Module</a></li>");
387    }
388
389    void checkNoModuleLink() {
390        checkOutput("testpkgnomodule/package-summary.html", true,
391                "<ul class=\"navList\" title=\"Navigation\">\n"
392                + "<li><a href=\"../testpkgnomodule/package-summary.html\">Package</a></li>");
393        checkOutput("testpkgnomodule/TestClassNoModule.html", true,
394                "<ul class=\"navList\" title=\"Navigation\">\n"
395                + "<li><a href=\"../testpkgnomodule/package-summary.html\">Package</a></li>");
396        checkOutput("testpkgnomodule/class-use/TestClassNoModule.html", true,
397                "<ul class=\"navList\" title=\"Navigation\">\n"
398                + "<li><a href=\"../../testpkgnomodule/package-summary.html\">Package</a></li>");
399    }
400
401    void checkModuleTags() {
402        checkOutput("moduletags-summary.html", true,
403                "Type Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in "
404                + "testpkgmdltags\"><code>TestClassInModuleTags</code></a>.",
405                "Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#"
406                + "testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.",
407                "Package Link: <a href=\"testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.",
408                "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n"
409                + "<dd>JDK 9</dd>",
410                "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
411                + "<dd>\"Test see tag\", \n"
412                + "<a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>"
413                + "TestClassInModuleTags</code></a></dd>",
414                "<dt><span class=\"simpleTagLabel\">Regular Tag:</span></dt>\n"
415                + "<dd>Just a regular simple tag.</dd>",
416                "<dt><span class=\"simpleTagLabel\">Module Tag:</span></dt>\n"
417                + "<dd>Just a simple module tag.</dd>",
418                "<dt><span class=\"simpleTagLabel\">Version:</span></dt>\n"
419                + "<dd>1.0</dd>",
420                "<dt><span class=\"simpleTagLabel\">Author:</span></dt>\n"
421                + "<dd>Bhavesh Patel</dd>");
422        checkOutput("testpkgmdltags/TestClassInModuleTags.html", false,
423                "<dt><span class=\"simpleTagLabel\">Module Tag:</span></dt>\n"
424                + "<dd>Just a simple module tag.</dd>");
425    }
426
427    void checkOverviewSummaryModules() {
428        checkOutput("overview-summary.html", true,
429                "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
430                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
431                + "<tr>\n"
432                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
433                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
434                + "</tr>");
435        checkOutput("overview-summary.html", false,
436                "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
437                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
438                + "<tr>\n"
439                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
440                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
441                + "</tr>");
442    }
443
444    void checkOverviewSummaryPackages() {
445        checkOutput("overview-summary.html", false,
446                "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n"
447                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
448                + "<tr>\n"
449                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
450                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
451                + "</tr>",
452                "</table>\n"
453                + "</div>\n"
454                + "<div class=\"contentContainer\">\n"
455                + "<div class=\"block\">The overview summary page header.</div>\n"
456                + "</div>\n"
457                + "<div class=\"contentContainer\">\n"
458                + "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
459                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
460        checkOutput("overview-summary.html", true,
461                "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
462                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
463                + "<tr>\n"
464                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
465                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
466                + "</tr>",
467                "</script>\n"
468                + "<div class=\"contentContainer\">\n"
469                + "<div class=\"block\">The overview summary page header.</div>\n"
470                + "</div>\n"
471                + "<div class=\"contentContainer\">\n"
472                + "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
473                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
474    }
475
476    void checkHtml5OverviewSummaryModules() {
477        checkOutput("overview-summary.html", true,
478                "<table class=\"overviewSummary\">\n"
479                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
480                + "<tr>\n"
481                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
482                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
483                + "</tr>");
484        checkOutput("overview-summary.html", false,
485                "<table class=\"overviewSummary\">\n"
486                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
487                + "<tr>\n"
488                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
489                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
490                + "</tr>");
491    }
492
493    void checkHtml5OverviewSummaryPackages() {
494        checkOutput("overview-summary.html", false,
495                "<table class=\"overviewSummary\">\n"
496                + "<caption><span>Modules</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
497                + "<tr>\n"
498                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
499                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
500                + "</tr>",
501                "</table>\n"
502                + "</div>\n"
503                + "</main>\n"
504                + "<main role=\"main\">\n"
505                + "<div class=\"contentContainer\">\n"
506                + "<div class=\"block\">The overview summary page header.</div>\n"
507                + "</div>\n"
508                + "<div class=\"contentContainer\">\n"
509                + "<table class=\"overviewSummary\">\n"
510                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
511        checkOutput("overview-summary.html", true,
512                "<table class=\"overviewSummary\">\n"
513                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
514                + "<tr>\n"
515                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
516                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
517                + "</tr>",
518                "</script>\n"
519                + "</nav>\n"
520                + "</header>\n"
521                + "<main role=\"main\">\n"
522                + "<div class=\"contentContainer\">\n"
523                + "<div class=\"block\">The overview summary page header.</div>\n"
524                + "</div>\n"
525                + "<div class=\"contentContainer\">\n"
526                + "<table class=\"overviewSummary\">\n"
527                + "<caption><span>Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>");
528    }
529
530    void checkModuleSummary() {
531        checkOutput("moduleA-summary.html", true,
532                "<ul class=\"subNavList\">\n"
533                + "<li>Module:&nbsp;</li>\n"
534                + "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a "
535                + "href=\"#modules.summary\">Modules</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">"
536                + "Packages</a>&nbsp;|&nbsp;Services</li>\n"
537                + "</ul>",
538                "<!-- ============ MODULES SUMMARY =========== -->\n"
539                + "<a name=\"modules.summary\">\n"
540                + "<!--   -->\n"
541                + "</a>",
542                "<tr class=\"altColor\" id=\"i0\">\n"
543                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
544                + "<td class=\"colLast\">&nbsp;</td>\n"
545                + "</tr>",
546                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
547                + "<a name=\"packages.summary\">\n"
548                + "<!--   -->\n"
549                + "</a>",
550                "<tr class=\"altColor\">\n"
551                + "<td class=\"colFirst\">transitive</td>\n"
552                + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
553                + "<td class=\"colLast\">\n"
554                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
555                + "</td>\n"
556                + "</tr>");
557        checkOutput("moduleB-summary.html", true,
558                "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;Modules&nbsp;|&nbsp;"
559                + "<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;<a href=\"#services.summary\">"
560                + "Services</a></li>",
561                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
562                + "<a name=\"packages.summary\">\n"
563                + "<!--   -->\n"
564                + "</a>",
565                "<tr class=\"altColor\" id=\"i0\">\n"
566                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
567                + "<td class=\"colLast\">&nbsp;</td>\n"
568                + "</tr>",
569                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
570                + "<a name=\"packages.summary\">\n"
571                + "<!--   -->\n"
572                + "</a>",
573                "<!-- ============ SERVICES SUMMARY =========== -->\n"
574                + "<a name=\"services.summary\">\n"
575                + "<!--   -->\n"
576                + "</a>",
577                "<tr class=\"altColor\">\n"
578                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClassInModuleB.html\" title=\"class in testpkgmdlB\">TestClassInModuleB</a></th>\n"
579                + "<td class=\"colLast\">With a test description for uses.&nbsp;</td>\n"
580                + "</tr>",
581                "<tr class=\"altColor\">\n"
582                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterface2InModuleB.html\" title=\"interface in testpkg2mdlB\">TestInterface2InModuleB</a></th>\n"
583                + "<td class=\"colLast\">&nbsp;</td>\n"
584                + "</tr>",
585                "<caption><span>Opened Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
586                + "<tr>\n"
587                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
588                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
589                + "</tr>",
590                "<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
591                + "<tr>\n"
592                + "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
593                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
594                + "</tr>",
595                "<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
596                + "<tr>\n"
597                + "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
598                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
599                + "</tr>");
600    }
601
602    void checkNegatedModuleSummary() {
603        checkOutput("moduleA-summary.html", false,
604                "<!-- ============ SERVICES SUMMARY =========== -->\n"
605                + "<a name=\"services.summary\">\n"
606                + "<!--   -->\n"
607                + "</a>");
608    }
609
610    void checkModuleClickThroughLinks() {
611        checkOutput("module-overview-frame.html", true,
612                "<li><a href=\"moduleA-frame.html\" target=\"packageListFrame\" "
613                + "onclick=\"updateModuleFrame('moduleA-type-frame.html','moduleA-summary.html');"
614                + "\">moduleA</a></li>",
615                "<li><a href=\"moduleB-frame.html\" target=\"packageListFrame\" "
616                + "onclick=\"updateModuleFrame('moduleB-type-frame.html','moduleB-summary.html');"
617                + "\">moduleB</a></li>");
618        checkOutput("script.js", true,
619                "function updateModuleFrame(pFrame, cFrame)\n"
620                + "{\n"
621                + "    top.packageFrame.location = pFrame;\n"
622                + "    top.classFrame.location = cFrame;\n"
623                + "}");
624    }
625
626    void checkModuleClickThrough(boolean found) {
627        checkFiles(found,
628                "moduleA-type-frame.html",
629                "moduleB-type-frame.html");
630    }
631
632    void checkModuleFilesAndLinks(boolean found) {
633        checkFileAndOutput("testpkgmdlA/package-summary.html", found,
634                "<li><a href=\"../moduleA-summary.html\">Module</a></li>",
635                "<div class=\"subTitle\"><span class=\"moduleLabelInPackage\">Module</span>&nbsp;"
636                + "<a href=\"../moduleA-summary.html\">moduleA</a></div>");
637        checkFileAndOutput("testpkgmdlA/TestClassInModuleA.html", found,
638                "<li><a href=\"../moduleA-summary.html\">Module</a></li>",
639                "<div class=\"subTitle\"><span class=\"moduleLabelInType\">Module</span>&nbsp;"
640                + "<a href=\"../moduleA-summary.html\">moduleA</a></div>");
641        checkFileAndOutput("testpkgmdlB/AnnotationType.html", found,
642                "<div class=\"subTitle\"><span class=\"moduleLabelInType\">Module</span>&nbsp;"
643                + "<a href=\"../moduleB-summary.html\">moduleB</a></div>",
644                "<div class=\"subTitle\"><span class=\"packageLabelInType\">"
645                + "Package</span>&nbsp;<a href=\"../testpkgmdlB/package-summary.html\">testpkgmdlB</a></div>");
646        checkFiles(found,
647                "moduleA-frame.html",
648                "moduleA-summary.html",
649                "module-overview-frame.html");
650    }
651
652    void checkModulesInSearch(boolean found) {
653        checkOutput("index-all.html", found,
654                "<dl>\n"
655                + "<dt><a href=\"moduleA-summary.html\">moduleA</a> - module moduleA</dt>\n"
656                + "<dd>\n"
657                + "<div class=\"block\">This is a test description for the moduleA module.</div>\n"
658                + "</dd>\n"
659                + "<dt><a href=\"moduleB-summary.html\">moduleB</a> - module moduleB</dt>\n"
660                + "<dd>\n"
661                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
662                + "</dd>\n"
663                + "</dl>",
664                "<dl>\n"
665                + "<dt><span class=\"searchTagLink\"><a href=\"moduleA-summary.html#searchphrase\">"
666                + "search phrase</a></span> - Search tag in moduleA</dt>\n"
667                + "<dd>with description</dd>\n"
668                + "<dt><span class=\"searchTagLink\"><a href=\"moduleB-summary.html#search_word\">"
669                + "search_word</a></span> - Search tag in moduleB</dt>\n"
670                + "<dd>&nbsp;</dd>\n"
671                + "</dl>");
672    }
673
674    void checkModuleModeCommon() {
675        checkOutput("overview-summary.html", true,
676                "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n"
677                + "<td class=\"colLast\">\n"
678                + "<div class=\"block\">This is a test description for the moduleA module.</div>\n"
679                + "</td>",
680                "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
681                + "<td class=\"colLast\">\n"
682                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
683                + "</td>",
684                "<th class=\"colFirst\" scope=\"row\"><a href=\"moduletags-summary.html\">moduletags</a></th>\n"
685                + "<td class=\"colLast\">\n"
686                + "<div class=\"block\">This is a test description for the moduleA module.<br>\n"
687                + " Type Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>TestClassInModuleTags</code></a>.<br>\n"
688                + " Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#testMethod-java.lang.String-\"><code>testMethod(String)</code></a>.<br>\n"
689                + " Package Link: <a href=\"testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>.<br></div>\n"
690                + "</td>");
691        checkOutput("moduleA-summary.html", true,
692                "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a href=\"#modules.summary\">"
693                + "Modules</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;Services</li>",
694                "<td class=\"colFirst\">transitive</td>\n"
695                + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
696                + "<td class=\"colLast\">\n"
697                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
698                + "</td>",
699                "<table class=\"packagesSummary\" summary=\"Additional Exported Packages table, listing modules, and packages\">\n"
700                + "<caption><span>Additional Exported Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>",
701                "<table class=\"packagesSummary\" summary=\"Additional Opened Packages table, listing modules, and packages\">\n"
702                + "<caption><span>Additional Opened Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
703                + "<tr>\n"
704                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
705                + "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
706                + "</tr>\n",
707                "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
708                + "<td class=\"colLast\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></td>\n");
709        checkOutput("moduleB-summary.html", true,
710                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClassInModuleB.html\" title=\"class in testpkgmdlB\">TestClassInModuleB</a></th>\n"
711                + "<td class=\"colLast\">With a test description for uses.&nbsp;</td>");
712        checkOutput("moduletags-summary.html", true,
713                "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a href=\"#modules.summary\">Modules"
714                + "</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;Services</li>",
715                "<table class=\"requiresSummary\" summary=\"Additional Modules Required table, listing modules, and an explanation\">\n"
716                + "<caption><span>Additional Modules Required</span><span class=\"tabEnd\">&nbsp;</span></caption>",
717                "<td class=\"colFirst\">transitive</td>\n"
718                + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
719                + "<td class=\"colLast\">\n"
720                + "<div class=\"block\">This is a test description for the moduleB module.</div>\n"
721                + "</td>",
722                "<table class=\"packagesSummary\" summary=\"Additional Exported Packages table, listing modules, and packages\">\n"
723                + "<caption><span>Additional Exported Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>",
724                "<td class=\"colFirst\">transitive static</td>\n"
725                + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n"
726                + "<td class=\"colLast\">\n"
727                + "<div class=\"block\">This is a test description for the moduleA module.</div>\n"
728                + "</td>",
729                "<table class=\"requiresSummary\" summary=\"Requires table, listing modules, and an explanation\">\n"
730                + "<caption><span>Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
731                + "<tr>\n"
732                + "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
733                + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
734                + "<th class=\"colLast\" scope=\"col\">Description</th>",
735                "<table class=\"requiresSummary\" summary=\"Additional Modules Required table, listing modules, and an explanation\">\n"
736                + "<caption><span>Additional Modules Required</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
737                + "<tr>\n"
738                + "<th class=\"colFirst\" scope=\"col\">Modifier</th>\n"
739                + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
740                + "<th class=\"colLast\" scope=\"col\">Description</th>",
741                "<table class=\"packagesSummary\" summary=\"Additional Opened Packages table, listing modules, and packages\">\n"
742                + "<caption><span>Additional Opened Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
743                + "<tr>\n"
744                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
745                + "<th class=\"colLast\" scope=\"col\">Packages</th>\n"
746                + "</tr>\n",
747                "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n"
748                + "<td class=\"colLast\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></td>\n");
749    }
750
751    void checkModuleModeApi(boolean found) {
752        checkOutput("moduleA-summary.html", found,
753                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
754                + "<td class=\"colLast\">&nbsp;</td>");
755        checkOutput("moduleB-summary.html", found,
756                "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;Modules&nbsp;|&nbsp;"
757                + "<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;<a href=\"#services.summary\">Services</a></li>",
758                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
759                + "<td class=\"colLast\">&nbsp;</td>",
760                "<table class=\"packagesSummary\" summary=\"Packages table, listing packages, and an explanation\">\n"
761                + "<caption><span>Opened Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
762                + "<tr>\n"
763                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
764                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
765                + "</tr>\n"
766                + "<tbody>\n"
767                + "<tr class=\"altColor\" id=\"i0\">\n"
768                + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
769                + "<td class=\"colLast\">&nbsp;</td>\n"
770                + "</tr>\n"
771                + "</tbody>\n"
772                + "</table>");
773        checkOutput("moduletags-summary.html", found,
774                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdltags/package-summary.html\">testpkgmdltags</a></th>\n"
775                + "<td class=\"colLast\">&nbsp;</td>");
776    }
777
778    void checkModuleModeAll(boolean found) {
779        checkOutput("moduleA-summary.html", found,
780                "<td class=\"colFirst\"> </td>\n"
781                + "<th class=\"colSecond\" scope=\"row\">java.base</th>\n"
782                + "<td class=\"colLast\">&nbsp;</td>",
783                "<td class=\"colFirst\"> </td>\n"
784                + "<th class=\"colSecond\" scope=\"row\"><a href=\"moduleC-summary.html\">moduleC</a></th>\n"
785                + "<td class=\"colLast\">\n"
786                + "<div class=\"block\">This is a test description for the moduleC module.</div>\n"
787                + "</td>",
788                "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleC-summary.html\">moduleC</a></th>\n"
789                + "<td class=\"colLast\"><a href=\"testpkgmdlC/package-summary.html\">testpkgmdlC</a></td>",
790                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
791                + "<td class=\"colSecond\">All Modules</td>\n"
792                + "<td class=\"colLast\">&nbsp;</td>",
793                "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;</span></span>"
794                + "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(1);\">Exported Packages</a></span>"
795                + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:showPkgs(4);\">"
796                + "Concealed Packages</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>",
797                "<th class=\"colFirst\" scope=\"row\"><a href=\"concealedpkgmdlA/package-summary.html\">concealedpkgmdlA</a></th>\n"
798                + "<td class=\"colSecond\">None</td>\n"
799                + "<td class=\"colLast\">&nbsp;</td>");
800        checkOutput("moduleB-summary.html", found,
801                "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a href=\"#modules.summary\">"
802                + "Modules</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">Packages</a>&nbsp;|&nbsp;<a href=\"#services.summary\">Services</a></li>",
803                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/package-summary.html\">testpkgmdlB</a></th>\n"
804                + "<td class=\"colSecond\">All Modules</td>\n"
805                + "<td class=\"colLast\">&nbsp;</td>",
806                "<td class=\"colFirst\"> </td>\n"
807                + "<th class=\"colSecond\" scope=\"row\">java.base</th>\n"
808                + "<td class=\"colLast\">&nbsp;</td>",
809                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClass2InModuleB.html\" title=\"class in testpkgmdlB\">TestClass2InModuleB</a></th>\n"
810                + "<td class=\"colLast\">&nbsp;</td>",
811                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterface2InModuleB.html\" title=\"interface in testpkg2mdlB\">TestInterface2InModuleB</a></th>\n"
812                + "<td class=\"colLast\">&nbsp;<br>(<span class=\"implementationLabel\">Implementation(s):</span>&nbsp;<a href=\"testpkgmdlB/TestClass2InModuleB.html\" "
813                + "title=\"class in testpkgmdlB\">TestClass2InModuleB</a>)</td>",
814                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterfaceInModuleB.html\" title=\"interface in testpkg2mdlB\">TestInterfaceInModuleB</a></th>\n"
815                + "<td class=\"colLast\">&nbsp;<br>(<span class=\"implementationLabel\">Implementation(s):</span>&nbsp;<a href=\"testpkgmdlB/TestClassInModuleB.html\" "
816                + "title=\"class in testpkgmdlB\">TestClassInModuleB</a>)</td>",
817                "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All Packages</span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t1\" class=\"tableTab\"><span>"
818                + "<a href=\"javascript:showPkgs(1);\">Exported Packages</a></span><span class=\"tabEnd\">&nbsp;</span></span><span id=\"t2\" class=\"tableTab\"><span>"
819                + "<a href=\"javascript:showPkgs(2);\">Opened Packages</a></span><span class=\"tabEnd\">&nbsp;</span></span></caption>");
820        checkOutput("moduleC-summary.html", found,
821                "<caption><span>Exported Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
822                + "<tr>\n"
823                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
824                + "<th class=\"colSecond\" scope=\"col\">Module</th>\n"
825                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
826                + "</tr>");
827        checkOutput("moduletags-summary.html", found,
828                "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdltags/package-summary.html\">testpkgmdltags</a></th>\n"
829                + "<td class=\"colSecond\">All Modules</td>\n"
830                + "<td class=\"colLast\">&nbsp;</td>");
831    }
832
833    void checkModuleDeprecation(boolean found) {
834        checkOutput("moduleA-summary.html", found,
835                "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated, for removal:"
836                + " This API element is subject to removal in a future version. </span>\n"
837                + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
838                + "</div>");
839        checkOutput("deprecated-list.html", found,
840                "<ul>\n"
841                + "<li><a href=\"#forRemoval\">Deprecated For Removal</a></li>\n"
842                + "<li><a href=\"#module\">Deprecated Modules</a></li>\n"
843                + "</ul>",
844                "<tr class=\"altColor\">\n"
845                + "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n"
846                + "<td class=\"colLast\">\n"
847                + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n"
848                + "</td>\n"
849                + "</tr>");
850        checkOutput("moduleB-summary.html", !found,
851                "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n"
852                + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated using just the javadoc tag.</span></div>");
853        checkOutput("moduletags-summary.html", found,
854                "<p>@Deprecated\n"
855                + "</p>",
856                "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span></div>");
857    }
858
859    void checkModuleAnnotation() {
860        checkOutput("moduleB-summary.html", true,
861                "<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n"
862                + "                <a href=\"testpkgmdlB/AnnotationType.html#required--\">required</a>=2016)\n"
863                + "</p>");
864        checkOutput("moduleB-summary.html", false,
865                "@AnnotationTypeUndocumented");
866    }
867
868    void checkOverviewFrame(boolean found) {
869        checkOutput("index.html", !found,
870                "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>");
871        checkOutput("index.html", found,
872                "<iframe src=\"module-overview-frame.html\" name=\"packageListFrame\" title=\"All Modules\"></iframe>");
873    }
874}
875