test/langtools/jdk/javadoc/doclet/testModules/TestModules.java
changeset 54821 85ccac8a8c13
parent 54596 86c1da00dd6a
child 59294 48b88b9c11eb
equal deleted inserted replaced
54820:fcf83b204c27 54821:85ccac8a8c13
    25  * @test
    25  * @test
    26  * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
    26  * @bug 8154119 8154262 8156077 8157987 8154261 8154817 8135291 8155995 8162363
    27  *      8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
    27  *      8168766 8168688 8162674 8160196 8175799 8174974 8176778 8177562 8175218
    28  *      8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
    28  *      8175823 8166306 8178043 8181622 8183511 8169819 8074407 8183037 8191464
    29         8164407 8192007 8182765 8196200 8196201 8196202 8196202 8205593 8202462
    29         8164407 8192007 8182765 8196200 8196201 8196202 8196202 8205593 8202462
    30         8184205
    30         8184205 8219060
    31  * @summary Test modules support in javadoc.
    31  * @summary Test modules support in javadoc.
    32  * @author bpatel
    32  * @author bpatel
    33  * @library ../../lib
    33  * @library ../../lib
    34  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    34  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    35  * @build javadoc.tester.*
    35  * @build javadoc.tester.*
   419                 "--module", "moduleA,moduleB",
   419                 "--module", "moduleA,moduleB",
   420                 "-linkoffline", url, testSrc + "/jdk",
   420                 "-linkoffline", url, testSrc + "/jdk",
   421                 "testpkgmdlA", "testpkgmdlB", "testpkg3mdlB");
   421                 "testpkgmdlA", "testpkgmdlB", "testpkg3mdlB");
   422         checkExit(Exit.OK);
   422         checkExit(Exit.OK);
   423         checkLinkOffline();
   423         checkLinkOffline();
       
   424     }
       
   425 
       
   426     /**
       
   427      * Test -linksource option.
       
   428      */
       
   429     @Test
       
   430     public void testLinkSource() {
       
   431         javadoc("-d", "out-linksource",
       
   432                 "-use",
       
   433                 "-linksource",
       
   434                 "-Xdoclint:none",
       
   435                 "--module-source-path", testSrc,
       
   436                 "--module", "moduleA,moduleB");
       
   437         checkExit(Exit.OK);
       
   438         checkLinks();
       
   439         checkLinkSource(false);
       
   440     }
       
   441 
       
   442     /**
       
   443      * Test -linksource option combined with -private.
       
   444      */
       
   445     @Test
       
   446     public void testLinkSourcePrivate() {
       
   447         javadoc("-d", "out-linksource-private",
       
   448                 "-use",
       
   449                 "-private",
       
   450                 "-linksource",
       
   451                 "-Xdoclint:none",
       
   452                 "--module-source-path", testSrc,
       
   453                 "--module", "moduleA,moduleB");
       
   454         checkExit(Exit.OK);
       
   455         checkLinks();
       
   456         checkLinkSource(true);
   424     }
   457     }
   425 
   458 
   426     void checkDescription(boolean found) {
   459     void checkDescription(boolean found) {
   427         checkOutput("moduleA/module-summary.html", found,
   460         checkOutput("moduleA/module-summary.html", found,
   428                 "<!-- ============ MODULE DESCRIPTION =========== -->\n"
   461                 "<!-- ============ MODULE DESCRIPTION =========== -->\n"
  1237                 "<a href=\"https://docs.oracle.com/javase/9/docs/api/java.base/java/lang/package-summary.html?is-external=true\" "
  1270                 "<a href=\"https://docs.oracle.com/javase/9/docs/api/java.base/java/lang/package-summary.html?is-external=true\" "
  1238                 + "class=\"externalLink\"><code>Link to java.lang package</code></a>");
  1271                 + "class=\"externalLink\"><code>Link to java.lang package</code></a>");
  1239         checkOutput("moduleB/testpkg3mdlB/package-summary.html", true,
  1272         checkOutput("moduleB/testpkg3mdlB/package-summary.html", true,
  1240                 "<a href=\"https://docs.oracle.com/javase/9/docs/api/java.base/module-summary.html?is-external=true\" "
  1273                 "<a href=\"https://docs.oracle.com/javase/9/docs/api/java.base/module-summary.html?is-external=true\" "
  1241                 + "class=\"externalLink\"><code>Link to java.base module</code></a>");
  1274                 + "class=\"externalLink\"><code>Link to java.base module</code></a>");
  1242 }
  1275     }
       
  1276 
       
  1277     void checkLinkSource(boolean includePrivate) {
       
  1278         checkOutput("moduleA/module-summary.html", !includePrivate,
       
  1279                 "<table>\n<caption><span>Exports</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
       
  1280                 + "<thead>\n<tr>\n<th class=\"colFirst\" scope=\"col\">Package</th>\n"
       
  1281                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n</tr>\n</thead>\n"
       
  1282                 + "<tbody>\n<tr class=\"altColor\" id=\"i0\">\n"
       
  1283                 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n"
       
  1284                 + "<td class=\"colLast\">&nbsp;</td>\n</tr>\n</tbody>\n</table>");
       
  1285         checkOutput("moduleA/testpkgmdlA/TestClassInModuleA.html", true,
       
  1286                 "<section class=\"description\">\n<hr>\n"
       
  1287                 + "<pre>public class <a href=\"../../src-html/moduleA/testpkgmdlA/TestClassInModuleA.html#line.25\">"
       
  1288                 + "TestClassInModuleA</a>\nextends java.lang.Object</pre>\n</section>");
       
  1289         checkOutput("src-html/moduleA/testpkgmdlA/TestClassInModuleA.html", true,
       
  1290                 "<span class=\"sourceLineNo\">019</span><a id=\"line.19\"> * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA</a>\n"
       
  1291                 + "<span class=\"sourceLineNo\">020</span><a id=\"line.20\"> * or visit www.oracle.com if you need additional information or have any</a>\n"
       
  1292                 + "<span class=\"sourceLineNo\">021</span><a id=\"line.21\"> * questions.</a>\n"
       
  1293                 + "<span class=\"sourceLineNo\">022</span><a id=\"line.22\"> */</a>\n"
       
  1294                 + "<span class=\"sourceLineNo\">023</span><a id=\"line.23\">package testpkgmdlA;</a>\n"
       
  1295                 + "<span class=\"sourceLineNo\">024</span><a id=\"line.24\"></a>\n"
       
  1296                 + "<span class=\"sourceLineNo\">025</span><a id=\"line.25\">public class TestClassInModuleA {</a>\n"
       
  1297                 + "<span class=\"sourceLineNo\">026</span><a id=\"line.26\">}</a>");
       
  1298         if (includePrivate) {
       
  1299             checkOutput("src-html/moduleA/concealedpkgmdlA/ConcealedClassInModuleA.html", true,
       
  1300                     "<span class=\"sourceLineNo\">024</span><a id=\"line.24\">package concealedpkgmdlA;</a>\n"
       
  1301                     + "<span class=\"sourceLineNo\">025</span><a id=\"line.25\"></a>\n"
       
  1302                     + "<span class=\"sourceLineNo\">026</span><a id=\"line.26\">public class ConcealedClassInModuleA {</a>\n"
       
  1303                     + "<span class=\"sourceLineNo\">027</span><a id=\"line.27\">    public void testMethodConcealedClass() { }</a>\n"
       
  1304                     + "<span class=\"sourceLineNo\">028</span><a id=\"line.28\">}</a>");
       
  1305         }
       
  1306     }
  1243 
  1307 
  1244     void checkAllPkgsAllClasses(boolean found) {
  1308     void checkAllPkgsAllClasses(boolean found) {
  1245         checkOutput("allclasses-index.html", true,
  1309         checkOutput("allclasses-index.html", true,
  1246                 "<div role=\"tablist\" aria-orientation=\"horizontal\"><button role=\"tab\""
  1310                 "<div role=\"tablist\" aria-orientation=\"horizontal\"><button role=\"tab\""
  1247                 + " aria-selected=\"true\" aria-controls=\"typeSummary_tabpanel\" tabindex=\"0\""
  1311                 + " aria-selected=\"true\" aria-controls=\"typeSummary_tabpanel\" tabindex=\"0\""