21 * questions. |
21 * questions. |
22 */ |
22 */ |
23 |
23 |
24 /* |
24 /* |
25 * @test |
25 * @test |
26 * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 8168766 8168688 8162674 8160196 8175799 |
26 * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363 |
|
27 * 8168766 8168688 8162674 8160196 8175799 8174974 |
27 * @summary Test modules support in javadoc. |
28 * @summary Test modules support in javadoc. |
28 * @author bpatel |
29 * @author bpatel |
29 * @library ../lib |
30 * @library ../lib |
30 * @modules jdk.javadoc/jdk.javadoc.internal.tool |
31 * @modules jdk.javadoc/jdk.javadoc.internal.tool |
31 * @build JavadocTester |
32 * @build JavadocTester |
185 */ |
186 */ |
186 @Test |
187 @Test |
187 void testModuleFilesAndLinks() { |
188 void testModuleFilesAndLinks() { |
188 javadoc("-d", "out-modulelinks", |
189 javadoc("-d", "out-modulelinks", |
189 "--module-source-path", testSrc, |
190 "--module-source-path", testSrc, |
190 "--module", "moduleA", |
191 "--module", "moduleA,moduleB", |
191 "testpkgmdlA"); |
192 "testpkgmdlA", "testpkgmdlB"); |
192 checkExit(Exit.OK); |
193 checkExit(Exit.OK); |
193 checkModuleFilesAndLinks(true); |
194 checkModuleFilesAndLinks(true); |
194 checkNegatedOverviewFrame(); |
195 checkOverviewFrame(true); |
195 } |
196 } |
196 |
197 |
197 /** |
198 /** |
198 * Test generated module pages for a deprecated module. |
199 * Test generated module pages for a deprecated module. |
199 */ |
200 */ |
629 } |
630 } |
630 |
631 |
631 void checkModuleFilesAndLinks(boolean found) { |
632 void checkModuleFilesAndLinks(boolean found) { |
632 checkFileAndOutput("testpkgmdlA/package-summary.html", found, |
633 checkFileAndOutput("testpkgmdlA/package-summary.html", found, |
633 "<li><a href=\"../moduleA-summary.html\">Module</a></li>", |
634 "<li><a href=\"../moduleA-summary.html\">Module</a></li>", |
634 "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span> " |
635 "<div class=\"subTitle\"><span class=\"moduleLabelInPackage\">Module</span> " |
635 + "<a href=\"../moduleA-summary.html\">moduleA</a></div>"); |
636 + "<a href=\"../moduleA-summary.html\">moduleA</a></div>"); |
636 checkFileAndOutput("testpkgmdlA/TestClassInModuleA.html", found, |
637 checkFileAndOutput("testpkgmdlA/TestClassInModuleA.html", found, |
637 "<li><a href=\"../moduleA-summary.html\">Module</a></li>", |
638 "<li><a href=\"../moduleA-summary.html\">Module</a></li>", |
638 "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span> " |
639 "<div class=\"subTitle\"><span class=\"moduleLabelInType\">Module</span> " |
639 + "<a href=\"../moduleA-summary.html\">moduleA</a></div>"); |
640 + "<a href=\"../moduleA-summary.html\">moduleA</a></div>"); |
|
641 checkFileAndOutput("testpkgmdlB/AnnotationType.html", found, |
|
642 "<div class=\"subTitle\"><span class=\"moduleLabelInType\">Module</span> " |
|
643 + "<a href=\"../moduleB-summary.html\">moduleB</a></div>", |
|
644 "<div class=\"subTitle\"><span class=\"packageLabelInType\">" |
|
645 + "Package</span> <a href=\"../testpkgmdlB/package-summary.html\">testpkgmdlB</a></div>"); |
640 checkFiles(found, |
646 checkFiles(found, |
641 "moduleA-frame.html", |
647 "moduleA-frame.html", |
642 "moduleA-summary.html", |
648 "moduleA-summary.html", |
643 "module-overview-frame.html"); |
649 "module-overview-frame.html"); |
644 } |
650 } |
661 + "<dd>with description</dd>\n" |
667 + "<dd>with description</dd>\n" |
662 + "<dt><span class=\"searchTagLink\"><a href=\"moduleB-summary.html#search_word\">" |
668 + "<dt><span class=\"searchTagLink\"><a href=\"moduleB-summary.html#search_word\">" |
663 + "search_word</a></span> - Search tag in moduleB</dt>\n" |
669 + "search_word</a></span> - Search tag in moduleB</dt>\n" |
664 + "<dd> </dd>\n" |
670 + "<dd> </dd>\n" |
665 + "</dl>"); |
671 + "</dl>"); |
666 } |
672 } |
667 |
673 |
668 void checkModuleModeCommon() { |
674 void checkModuleModeCommon() { |
669 checkOutput("overview-summary.html", true, |
675 checkOutput("overview-summary.html", true, |
670 "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n" |
676 "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n" |
671 + "<td class=\"colLast\">\n" |
677 + "<td class=\"colLast\">\n" |
855 "<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n" |
861 "<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n" |
856 + " <a href=\"testpkgmdlB/AnnotationType.html#required--\">required</a>=2016)\n" |
862 + " <a href=\"testpkgmdlB/AnnotationType.html#required--\">required</a>=2016)\n" |
857 + "</p>"); |
863 + "</p>"); |
858 checkOutput("moduleB-summary.html", false, |
864 checkOutput("moduleB-summary.html", false, |
859 "@AnnotationTypeUndocumented"); |
865 "@AnnotationTypeUndocumented"); |
860 } |
866 } |
861 |
867 |
862 void checkOverviewFrame(boolean found) { |
868 void checkOverviewFrame(boolean found) { |
863 checkOutput("index.html", !found, |
869 checkOutput("index.html", !found, |
864 "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>"); |
870 "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>"); |
865 checkOutput("index.html", found, |
871 checkOutput("index.html", found, |
866 "<iframe src=\"module-overview-frame.html\" name=\"packageListFrame\" title=\"All Modules\"></iframe>"); |
872 "<iframe src=\"module-overview-frame.html\" name=\"packageListFrame\" title=\"All Modules\"></iframe>"); |
|
873 } |
867 } |
874 } |
868 |
|
869 void checkNegatedOverviewFrame() { |
|
870 checkOutput("index.html", false, |
|
871 "<iframe src=\"overview-frame.html\" name=\"packageListFrame\" title=\"All Packages\"></iframe>"); |
|
872 checkOutput("index.html", false, |
|
873 "<iframe src=\"module-overview-frame.html\" name=\"packageListFrame\" title=\"All Modules\"></iframe>"); |
|
874 } |
|
875 } |
|