langtools/test/jdk/javadoc/doclet/testModules/TestModules.java
changeset 39670 9d1eafbf29c6
parent 39586 e35b6ab55e00
child 40229 09f4478d07e5
--- a/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java	Mon Jul 11 15:27:52 2016 -0700
+++ b/langtools/test/jdk/javadoc/doclet/testModules/TestModules.java	Tue Jul 12 12:55:18 2016 -0700
@@ -23,7 +23,7 @@
 
 /*
  * @test
- * @bug 8154119 8154262 8156077 8157987
+ * @bug 8154119 8154262 8156077 8157987 8154261
  * @summary Test modules support in javadoc.
  * @author bpatel
  * @library ../lib
@@ -110,6 +110,17 @@
         testModuleTags();
     }
 
+    @Test
+    void test7() {
+        javadoc("-d", "out-moduleSummary", "-use",
+                "-modulesourcepath", testSrc,
+                "-addmods", "module1,module2",
+                "testpkgmdl1", "testpkgmdl2", "testpkg2mdl2");
+        checkExit(Exit.OK);
+        testModuleSummary();
+        testNegatedModuleSummary();
+    }
+
    @Test
     void test8() {
         javadoc("-d", "out-html5-nomodule", "-html5", "-use",
@@ -139,12 +150,16 @@
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
-                + "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">");
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\">\n"
+                + "<!-- ============ MODULES SUMMARY =========== -->");
         checkOutput("module2-summary.html", found,
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
-                + "<table class=\"overviewSummary\" summary=\"Package Summary table, listing packages, and an explanation\">");
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\">\n"
+                + "<!-- ============ MODULES SUMMARY =========== -->");
     }
 
     void testHtml5Description(boolean found) {
@@ -171,12 +186,16 @@
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
-                + "<table class=\"overviewSummary\">");
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\">\n"
+                + "<!-- ============ MODULES SUMMARY =========== -->");
         checkOutput("module2-summary.html", found,
                 "<div class=\"contentContainer\">\n"
                 + "<ul class=\"blockList\">\n"
                 + "<li class=\"blockList\">\n"
-                + "<table class=\"overviewSummary\">");
+                + "<ul class=\"blockList\">\n"
+                + "<li class=\"blockList\">\n"
+                + "<!-- ============ MODULES SUMMARY =========== -->");
     }
 
     void testModuleLink() {
@@ -313,4 +332,114 @@
                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
                 + "</tr>");
     }
+
+    void testModuleSummary() {
+        checkOutput("module1-summary.html", true,
+                "<ul class=\"subNavList\">\n"
+                + "<li>Module:&nbsp;</li>\n"
+                + "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a "
+                + "href=\"#modules.summary\">Modules</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">"
+                + "Packages</a>&nbsp;|&nbsp;Services</li>\n"
+                + "</ul>");
+        checkOutput("module1-summary.html", true,
+                "<!-- ============ MODULES SUMMARY =========== -->\n"
+                + "<a name=\"modules.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>");
+        checkOutput("module1-summary.html", true,
+                "<tr class=\"altColor\">\n"
+                + "<td class=\"colFirst\"><a href=\"testpkgmdl1/package-summary.html\">testpkgmdl1</a></td>\n"
+                + "<td class=\"colSecond\">All Modules</td>\n"
+                + "<td class=\"colLast\">&nbsp;</td>\n"
+                + "</tr>");
+        checkOutput("module1-summary.html", true,
+                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
+                + "<a name=\"packages.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>");
+        checkOutput("module1-summary.html", true,
+                "<tr class=\"rowColor\">\n"
+                + "<td class=\"colFirst\"><a href=\"module2-summary.html\">module2</a></td>\n"
+                + "<td class=\"colLast\">\n"
+                + "<div class=\"block\">This is a test description for the module2 module.</div>\n"
+                + "</td>\n"
+                + "</tr>");
+        checkOutput("module2-summary.html", true,
+                "<li><a href=\"#module.description\">Description</a>&nbsp;|&nbsp;<a "
+                + "href=\"#modules.summary\">Modules</a>&nbsp;|&nbsp;<a href=\"#packages.summary\">"
+                + "Packages</a>&nbsp;|&nbsp;<a href=\"#services.summary\">Services</a></li>");
+        checkOutput("module2-summary.html", true,
+                "<!-- ============ MODULES SUMMARY =========== -->\n"
+                + "<a name=\"modules.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>");
+        checkOutput("module2-summary.html", true,
+                "<tr class=\"rowColor\">\n"
+                + "<td class=\"colFirst\">testpkg2mdl2</td>\n"
+                + "<td class=\"colSecond\">module1</td>\n"
+                + "<td class=\"colLast\">&nbsp;</td>\n"
+                + "</tr>");
+        checkOutput("module2-summary.html", true,
+                "<!-- ============ PACKAGES SUMMARY =========== -->\n"
+                + "<a name=\"packages.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>");
+        checkOutput("module2-summary.html", true,
+                "<tr class=\"altColor\">\n"
+                + "<td class=\"colFirst\"><a href=\"java.base-summary.html\">java.base</a></td>\n"
+                + "<td class=\"colLast\">&nbsp;</td>\n"
+                + "</tr>");
+        checkOutput("module2-summary.html", true,
+                "<!-- ============ SERVICES SUMMARY =========== -->\n"
+                + "<a name=\"services.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>");
+        checkOutput("module2-summary.html", true,
+                "<tr class=\"altColor\">\n"
+                + "<td class=\"colFirst\"><a href=\"testpkgmdl2/TestClassInModule2.html\" "
+                + "title=\"class in testpkgmdl2\">TestClassInModule2</a></td>\n"
+                + "<td class=\"colLast\">&nbsp;</td>\n"
+                + "</tr>");
+        checkOutput("module2-summary.html", true,
+                "<tr class=\"altColor\">\n"
+                + "<td class=\"colFirst\">testpkg2mdl2.TestInterfaceInModule2<br>(<span "
+                + "class=\"implementationLabel\">Implementation:</span>&nbsp;<a "
+                + "href=\"testpkgmdl2/TestClassInModule2.html\" title=\"class in testpkgmdl2\">"
+                + "TestClassInModule2</a>)</td>\n"
+                + "<td class=\"colLast\">&nbsp;</td>\n"
+                + "</tr");
+        checkOutput("module2-summary.html", true,
+                "<caption><span>Exported Packages</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
+                + "<th scope=\"col\">Module</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>");
+        checkOutput("module2-summary.html", true,
+                "<caption><span>Requires</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Module</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>");
+        checkOutput("module2-summary.html", true,
+                "<caption><span>Uses</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>");
+        checkOutput("module2-summary.html", true,
+                "<caption><span>Provides</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
+                + "<tr>\n"
+                + "<th class=\"colFirst\" scope=\"col\">Type</th>\n"
+                + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
+                + "</tr>");
+    }
+
+    void testNegatedModuleSummary() {
+        checkOutput("module1-summary.html", false,
+                "<!-- ============ SERVICES SUMMARY =========== -->\n"
+                + "<a name=\"services.summary\">\n"
+                + "<!--   -->\n"
+                + "</a>");
+    }
 }