langtools/test/jdk/javadoc/doclet/testModules/TestModules.java
changeset 40229 09f4478d07e5
parent 39670 9d1eafbf29c6
child 40308 274367a99f98
equal deleted inserted replaced
39922:e613affb88d1 40229:09f4478d07e5
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 8154119 8154262 8156077 8157987 8154261
    26  * @bug 8154119 8154262 8156077 8157987 8154261 8154817
    27  * @summary Test modules support in javadoc.
    27  * @summary Test modules support in javadoc.
    28  * @author bpatel
    28  * @author bpatel
    29  * @library ../lib
    29  * @library ../lib
    30  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    30  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    31  * @build JavadocTester
    31  * @build JavadocTester
    48         checkExit(Exit.OK);
    48         checkExit(Exit.OK);
    49         testDescription(true);
    49         testDescription(true);
    50         testNoDescription(false);
    50         testNoDescription(false);
    51         testOverviewSummaryModules();
    51         testOverviewSummaryModules();
    52         testModuleLink();
    52         testModuleLink();
       
    53         testModuleClickThroughLinks();
       
    54         testModuleClickThrough(true);
    53     }
    55     }
    54 
    56 
    55     @Test
    57     @Test
    56     void test2() {
    58     void test2() {
    57         javadoc("-d", "out-html5", "-html5", "-use",
    59         javadoc("-d", "out-html5", "-html5", "-use",
    61         checkExit(Exit.OK);
    63         checkExit(Exit.OK);
    62         testHtml5Description(true);
    64         testHtml5Description(true);
    63         testHtml5NoDescription(false);
    65         testHtml5NoDescription(false);
    64         testHtml5OverviewSummaryModules();
    66         testHtml5OverviewSummaryModules();
    65         testModuleLink();
    67         testModuleLink();
       
    68         testModuleClickThroughLinks();
       
    69         testModuleClickThrough(true);
    66     }
    70     }
    67 
    71 
    68     @Test
    72     @Test
    69     void test3() {
    73     void test3() {
    70         javadoc("-d", "out-nocomment", "-nocomment", "-use",
    74         javadoc("-d", "out-nocomment", "-nocomment", "-use",
    94         javadoc("-d", "out-nomodule", "-use",
    98         javadoc("-d", "out-nomodule", "-use",
    95                 "-sourcepath", testSrc,
    99                 "-sourcepath", testSrc,
    96                 "testpkgnomodule", "testpkgnomodule1");
   100                 "testpkgnomodule", "testpkgnomodule1");
    97         checkExit(Exit.OK);
   101         checkExit(Exit.OK);
    98         testOverviewSummaryPackages();
   102         testOverviewSummaryPackages();
       
   103         testModuleClickThrough(false);
    99     }
   104     }
   100 
   105 
   101    @Test
   106    @Test
   102     void test6() {
   107     void test6() {
   103         javadoc("-d", "out-mdltags", "-author", "-version",
   108         javadoc("-d", "out-mdltags", "-author", "-version",
   440                 "<!-- ============ SERVICES SUMMARY =========== -->\n"
   445                 "<!-- ============ SERVICES SUMMARY =========== -->\n"
   441                 + "<a name=\"services.summary\">\n"
   446                 + "<a name=\"services.summary\">\n"
   442                 + "<!--   -->\n"
   447                 + "<!--   -->\n"
   443                 + "</a>");
   448                 + "</a>");
   444     }
   449     }
       
   450 
       
   451      void testModuleClickThroughLinks() {
       
   452         checkOutput("module-overview-frame.html", true,
       
   453                 "<li><a href=\"module1-frame.html\" target=\"packageListFrame\" "
       
   454                 + "onclick=\"updateModuleFrame('module1-type-frame.html','module1-summary.html');"
       
   455                 + "\">module1</a></li>");
       
   456         checkOutput("module-overview-frame.html", true,
       
   457                 "<li><a href=\"module2-frame.html\" target=\"packageListFrame\" "
       
   458                 + "onclick=\"updateModuleFrame('module2-type-frame.html','module2-summary.html');"
       
   459                 + "\">module2</a></li>");
       
   460         checkOutput("script.js", true,
       
   461                  "function updateModuleFrame(pFrame, cFrame)\n"
       
   462                  + "{\n"
       
   463                  + "    top.packageFrame.location = pFrame;\n"
       
   464                  + "    top.classFrame.location = cFrame;\n"
       
   465                  + "}");
   445 }
   466 }
       
   467 
       
   468      void testModuleClickThrough(boolean found) {
       
   469         checkFiles(found,
       
   470                 "module1-type-frame.html",
       
   471                 "module2-type-frame.html");
       
   472      }
       
   473 }