28 * @author bpatel 29 * @library ../lib 30 * @modules jdk.javadoc/jdk.javadoc.internal.tool 31 * @build JavadocTester 32 * @run main TestModules 33 */ 34 public class TestModules extends JavadocTester { 35 36 public static void main(String... args) throws Exception { 37 TestModules tester = new TestModules(); 38 tester.runTests(); 39 } 40 41 /** 42 * Test generated module pages for HTML 4. 43 */ 44 @Test 45 void testHtml4() { 46 javadoc("-d", "out", "-use", 47 "--module-source-path", testSrc, 48 "--add-modules", "module1,module2", 49 "testpkgmdl1", "testpkgmdl2"); 50 checkExit(Exit.OK); 51 checkDescription(true); 52 checkNoDescription(false); 53 checkOverviewSummaryModules(); 54 checkModuleLink(); 55 checkModuleClickThroughLinks(); 56 checkModuleClickThrough(true); 57 checkModuleFilesAndLinks(true); 58 checkModulesInSearch(true); 59 } 60 61 /** 62 * Test generated module pages for HTML 5. 63 */ 64 @Test 65 void testHtml5() { 66 javadoc("-d", "out-html5", "-html5", "-use", 67 "--module-source-path", testSrc, 68 "--add-modules", "module1,module2", 69 "testpkgmdl1", "testpkgmdl2"); 70 checkExit(Exit.OK); 71 checkHtml5Description(true); 72 checkHtml5NoDescription(false); 73 checkHtml5OverviewSummaryModules(); 74 checkModuleLink(); 75 checkModuleClickThroughLinks(); 76 checkModuleClickThrough(true); 77 checkModuleFilesAndLinks(true); 78 checkModulesInSearch(true); 79 } 80 81 /** 82 * Test generated module pages for HTML 4 with -nocomment option. 83 */ 84 @Test 85 void testHtml4NoComment() { 86 javadoc("-d", "out-nocomment", "-nocomment", "-use", 87 "--module-source-path", testSrc, 88 "--add-modules", "module1,module2", 89 "testpkgmdl1", "testpkgmdl2"); 90 checkExit(Exit.OK); 91 checkDescription(false); 92 checkNoDescription(true); 93 checkModuleLink(); 94 checkModuleFilesAndLinks(true); 95 } 96 97 /** 98 * Test generated module pages for HTML 5 with -nocomment option. 99 */ 100 @Test 101 void testHtml5NoComment() { 102 javadoc("-d", "out-html5-nocomment", "-nocomment", "-html5", "-use", 103 "--module-source-path", testSrc, 104 "--add-modules", "module1,module2", 105 "testpkgmdl1", "testpkgmdl2"); 106 checkExit(Exit.OK); 107 checkHtml5Description(false); 108 checkHtml5NoDescription(true); 109 checkModuleLink(); 110 checkModuleFilesAndLinks(true); 111 } 112 113 /** 114 * Test generated pages, in an unnamed module, for HTML 4. 115 */ 116 @Test 117 void testHtml4UnnamedModule() { 118 javadoc("-d", "out-nomodule", "-use", 119 "-sourcepath", testSrc, 120 "testpkgnomodule", "testpkgnomodule1"); 121 checkExit(Exit.OK); 122 checkOverviewSummaryPackages(); 123 checkModuleClickThrough(false); 124 checkModuleFilesAndLinks(false); 125 checkModulesInSearch(false); 131 @Test 132 void testHtml5UnnamedModule() { 133 javadoc("-d", "out-html5-nomodule", "-html5", "-use", 134 "-sourcepath", testSrc, 135 "testpkgnomodule", "testpkgnomodule1"); 136 checkExit(Exit.OK); 137 checkHtml5OverviewSummaryPackages(); 138 checkModuleFilesAndLinks(false); 139 checkModulesInSearch(false); 140 } 141 142 /** 143 * Test generated module pages with javadoc tags. 144 */ 145 @Test 146 void testJDTagsInModules() { 147 javadoc("-d", "out-mdltags", "-author", "-version", 148 "-tag", "regular:a:Regular Tag:", 149 "-tag", "moduletag:s:Module Tag:", 150 "--module-source-path", testSrc, 151 "--add-modules", "moduletags,module2", 152 "testpkgmdltags", "testpkgmdl2"); 153 checkExit(Exit.OK); 154 checkModuleTags(); 155 } 156 157 /** 158 * Test generated module summary page. 159 */ 160 @Test 161 void testModuleSummary() { 162 javadoc("-d", "out-moduleSummary", "-use", 163 "--module-source-path", testSrc, 164 "--add-modules", "module1,module2", 165 "testpkgmdl1", "testpkgmdl2", "module2/testpkg2mdl2"); 166 checkExit(Exit.OK); 167 checkModuleSummary(); 168 checkNegatedModuleSummary(); 169 } 170 171 /** 172 * Test generated module pages and pages with link to modules. 173 */ 174 @Test 175 void testModuleFilesAndLinks() { 176 javadoc("-d", "out-modulelinks", 177 "--module-source-path", testSrc, 178 "--add-modules", "module1", 179 "testpkgmdl1"); 180 checkExit(Exit.OK); 181 checkModuleFilesAndLinks(true); 182 } 183 184 /** 185 * Test generated module pages for a deprecated module. 186 */ 187 @Test 188 void testModuleDeprecation() { 189 javadoc("-d", "out-moduledepr", 190 "-tag", "regular:a:Regular Tag:", 191 "-tag", "moduletag:s:Module Tag:", 192 "--module-source-path", testSrc, 193 "--module", "module1,module2,moduletags", 194 "testpkgmdl1", "testpkgmdl2", "testpkgmdltags"); 195 checkExit(Exit.OK); 196 checkModuleDeprecation(true); 197 } 198 199 /** 200 * Test annotations on modules. 201 */ 202 @Test 203 void testModuleAnnotation() { 204 javadoc("-d", "out-moduleanno", 205 "--module-source-path", testSrc, 206 "--module", "module1,module2", 207 "testpkgmdl1", "testpkgmdl2"); 208 checkExit(Exit.OK); 209 checkModuleAnnotation(); 210 } 211 212 void checkDescription(boolean found) { 213 checkOutput("module1-summary.html", found, 214 "<!-- ============ MODULE DESCRIPTION =========== -->\n" 215 + "<a name=\"module.description\">\n" 216 + "<!-- -->\n" 217 + "</a>\n" 218 + "<div class=\"block\">This is a test description for the module1 module. Search " 219 + "phrase <a id=\"searchphrase\">search phrase</a>.</div>"); 220 checkOutput("module2-summary.html", found, 221 "<!-- ============ MODULE DESCRIPTION =========== -->\n" 222 + "<a name=\"module.description\">\n" 223 + "<!-- -->\n" 224 + "</a>\n" 225 + "<div class=\"block\">This is a test description for the module2 module. Search " 226 + "word <a id=\"search_word\">search_word</a> with no description.</div>"); 227 } 228 229 void checkNoDescription(boolean found) { 230 checkOutput("module1-summary.html", found, 231 "<div class=\"contentContainer\">\n" 232 + "<ul class=\"blockList\">\n" 233 + "<li class=\"blockList\">\n" 234 + "<ul class=\"blockList\">\n" 235 + "<li class=\"blockList\">\n" 236 + "<!-- ============ MODULES SUMMARY =========== -->"); 237 checkOutput("module2-summary.html", found, 238 "<div class=\"contentContainer\">\n" 239 + "<ul class=\"blockList\">\n" 240 + "<li class=\"blockList\">\n" 241 + "<ul class=\"blockList\">\n" 242 + "<li class=\"blockList\">\n" 243 + "<!-- ============ MODULES SUMMARY =========== -->"); 244 } 245 246 void checkHtml5Description(boolean found) { 247 checkOutput("module1-summary.html", found, 248 "<section role=\"region\">\n" 249 + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" 250 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n" 251 + "</div>\n" 252 + "<!-- ============ MODULE DESCRIPTION =========== -->\n" 253 + "<a id=\"module.description\">\n" 254 + "<!-- -->\n" 255 + "</a>\n" 256 + "<div class=\"block\">This is a test description for the module1 module. Search " 257 + "phrase <a id=\"searchphrase\">search phrase</a>.</div>"); 258 checkOutput("module2-summary.html", found, 259 "<section role=\"region\">\n" 260 + "<!-- ============ MODULE DESCRIPTION =========== -->\n" 261 + "<a id=\"module.description\">\n" 262 + "<!-- -->\n" 263 + "</a>\n" 264 + "<div class=\"block\">This is a test description for the module2 module. Search " 265 + "word <a id=\"search_word\">search_word</a> with no description.</div>"); 266 } 267 268 void checkHtml5NoDescription(boolean found) { 269 checkOutput("module1-summary.html", found, 270 "<div class=\"contentContainer\">\n" 271 + "<ul class=\"blockList\">\n" 272 + "<li class=\"blockList\">\n" 273 + "<ul class=\"blockList\">\n" 274 + "<li class=\"blockList\">\n" 275 + "<!-- ============ MODULES SUMMARY =========== -->"); 276 checkOutput("module2-summary.html", found, 277 "<div class=\"contentContainer\">\n" 278 + "<ul class=\"blockList\">\n" 279 + "<li class=\"blockList\">\n" 280 + "<ul class=\"blockList\">\n" 281 + "<li class=\"blockList\">\n" 282 + "<!-- ============ MODULES SUMMARY =========== -->"); 283 } 284 285 void checkModuleLink() { 286 checkOutput("overview-summary.html", true, 287 "<li>Module</li>"); 288 checkOutput("module1-summary.html", true, 289 "<li class=\"navBarCell1Rev\">Module</li>"); 290 checkOutput("module2-summary.html", true, 291 "<li class=\"navBarCell1Rev\">Module</li>"); 292 checkOutput("testpkgmdl1/class-use/TestClassInModule1.html", true, 293 "<li><a href=\"../../module1-summary.html\">Module</a></li>"); 294 checkOutput("testpkgmdl2/package-summary.html", true, 295 "<li><a href=\"../module2-summary.html\">Module</a></li>"); 296 checkOutput("testpkgmdl2/TestClassInModule2.html", true, 297 "<li><a href=\"../module2-summary.html\">Module</a></li>"); 298 checkOutput("testpkgmdl2/class-use/TestClassInModule2.html", true, 299 "<li><a href=\"../../module2-summary.html\">Module</a></li>"); 300 } 301 302 void checkNoModuleLink() { 303 checkOutput("testpkgnomodule/package-summary.html", true, 304 "<ul class=\"navList\" title=\"Navigation\">\n" 305 + "<li><a href=\"../testpkgnomodule/package-summary.html\">Package</a></li>"); 306 checkOutput("testpkgnomodule/TestClassNoModule.html", true, 307 "<ul class=\"navList\" title=\"Navigation\">\n" 308 + "<li><a href=\"../testpkgnomodule/package-summary.html\">Package</a></li>"); 309 checkOutput("testpkgnomodule/class-use/TestClassNoModule.html", true, 310 "<ul class=\"navList\" title=\"Navigation\">\n" 311 + "<li><a href=\"../../testpkgnomodule/package-summary.html\">Package</a></li>"); 312 } 313 314 void checkModuleTags() { 315 checkOutput("moduletags-summary.html", true, 316 "Type Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in " 317 + "testpkgmdltags\"><code>TestClassInModuleTags</code></a>."); 318 checkOutput("moduletags-summary.html", true, 319 "Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#" 320 + "testMethod-java.lang.String-\"><code>testMethod(String)</code></a>."); 321 checkOutput("moduletags-summary.html", true, 322 "Package Link: <a href=\"testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>."); 323 checkOutput("moduletags-summary.html", true, 324 "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" 325 + "<dd>JDK 9</dd>"); 326 checkOutput("moduletags-summary.html", true, 327 "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" 328 + "<dd>\"Test see tag\", \n" 329 + "<a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>" 330 + "TestClassInModuleTags</code></a></dd>"); 331 checkOutput("moduletags-summary.html", true, 332 "<dt><span class=\"simpleTagLabel\">Regular Tag:</span></dt>\n" 333 + "<dd>Just a regular simple tag.</dd>"); 334 checkOutput("moduletags-summary.html", true, 335 "<dt><span class=\"simpleTagLabel\">Module Tag:</span></dt>\n" 336 + "<dd>Just a simple module tag.</dd>"); 337 checkOutput("moduletags-summary.html", true, 338 "<dt><span class=\"simpleTagLabel\">Version:</span></dt>\n" 339 + "<dd>1.0</dd>"); 340 checkOutput("moduletags-summary.html", true, 341 "<dt><span class=\"simpleTagLabel\">Author:</span></dt>\n" 342 + "<dd>Bhavesh Patel</dd>"); 343 checkOutput("testpkgmdltags/TestClassInModuleTags.html", false, 344 "<dt><span class=\"simpleTagLabel\">Module Tag:</span></dt>\n" 345 + "<dd>Just a simple module tag.</dd>"); 346 } 347 348 void checkOverviewSummaryModules() { 349 checkOutput("overview-summary.html", true, 350 "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n" 351 + "<caption><span>Modules</span><span class=\"tabEnd\"> </span></caption>\n" 352 + "<tr>\n" 353 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 354 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 355 + "</tr>"); 356 checkOutput("overview-summary.html", false, 357 "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n" 358 + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>\n" 359 + "<tr>\n" 360 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 361 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 362 + "</tr>"); 363 } 364 365 void checkOverviewSummaryPackages() { 366 checkOutput("overview-summary.html", false, 367 "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n" 368 + "<caption><span>Modules</span><span class=\"tabEnd\"> </span></caption>\n" 369 + "<tr>\n" 370 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 371 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 372 + "</tr>"); 373 checkOutput("overview-summary.html", true, 374 "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n" 375 + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>\n" 376 + "<tr>\n" 377 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 378 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 379 + "</tr>"); 380 } 381 382 void checkHtml5OverviewSummaryModules() { 383 checkOutput("overview-summary.html", true, 384 "<table class=\"overviewSummary\">\n" 385 + "<caption><span>Modules</span><span class=\"tabEnd\"> </span></caption>\n" 386 + "<tr>\n" 387 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 388 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 389 + "</tr>"); 390 checkOutput("overview-summary.html", false, 391 "<table class=\"overviewSummary\">\n" 392 + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>\n" 393 + "<tr>\n" 394 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 395 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 396 + "</tr>"); 397 } 398 399 void checkHtml5OverviewSummaryPackages() { 400 checkOutput("overview-summary.html", false, 401 "<table class=\"overviewSummary\">\n" 402 + "<caption><span>Modules</span><span class=\"tabEnd\"> </span></caption>\n" 403 + "<tr>\n" 404 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 405 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 406 + "</tr>"); 407 checkOutput("overview-summary.html", true, 408 "<table class=\"overviewSummary\">\n" 409 + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>\n" 410 + "<tr>\n" 411 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 412 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 413 + "</tr>"); 414 } 415 416 void checkModuleSummary() { 417 checkOutput("module1-summary.html", true, 418 "<ul class=\"subNavList\">\n" 419 + "<li>Module: </li>\n" 420 + "<li><a href=\"#module.description\">Description</a> | <a " 421 + "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">" 422 + "Packages</a> | Services</li>\n" 423 + "</ul>"); 424 checkOutput("module1-summary.html", true, 425 "<!-- ============ MODULES SUMMARY =========== -->\n" 426 + "<a name=\"modules.summary\">\n" 427 + "<!-- -->\n" 428 + "</a>"); 429 checkOutput("module1-summary.html", true, 430 "<tr class=\"altColor\">\n" 431 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdl1/package-summary.html\">testpkgmdl1</a></th>\n" 432 + "<td class=\"colSecond\">All Modules</td>\n" 433 + "<td class=\"colLast\"> </td>\n" 434 + "</tr>"); 435 checkOutput("module1-summary.html", true, 436 "<!-- ============ PACKAGES SUMMARY =========== -->\n" 437 + "<a name=\"packages.summary\">\n" 438 + "<!-- -->\n" 439 + "</a>"); 440 checkOutput("module1-summary.html", true, 441 "<tr class=\"rowColor\">\n" 442 + "<th class=\"colFirst\" scope=\"row\"><a href=\"module2-summary.html\">module2</a></th>\n" 443 + "<td class=\"colLast\">\n" 444 + "<div class=\"block\">This is a test description for the module2 module.</div>\n" 445 + "</td>\n" 446 + "</tr>"); 447 checkOutput("module2-summary.html", true, 448 "<li><a href=\"#module.description\">Description</a> | <a " 449 + "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">" 450 + "Packages</a> | <a href=\"#services.summary\">Services</a></li>"); 451 checkOutput("module2-summary.html", true, 452 "<!-- ============ MODULES SUMMARY =========== -->\n" 453 + "<a name=\"modules.summary\">\n" 454 + "<!-- -->\n" 455 + "</a>"); 456 checkOutput("module2-summary.html", true, 457 "<tr class=\"rowColor\">\n" 458 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdl2/package-summary.html\">" 459 + "testpkg2mdl2</a></th>\n" 460 + "<td class=\"colSecond\">module1</td>\n" 461 + "<td class=\"colLast\"> </td>\n" 462 + "</tr>"); 463 checkOutput("module2-summary.html", true, 464 "<!-- ============ PACKAGES SUMMARY =========== -->\n" 465 + "<a name=\"packages.summary\">\n" 466 + "<!-- -->\n" 467 + "</a>"); 468 checkOutput("module2-summary.html", true, 469 "<tr class=\"altColor\">\n" 470 + "<th class=\"colFirst\" scope=\"row\"><a href=\"java.base-summary.html\">java.base</a></th>\n" 471 + "<td class=\"colLast\"> </td>\n" 472 + "</tr>"); 473 checkOutput("module2-summary.html", true, 474 "<!-- ============ SERVICES SUMMARY =========== -->\n" 475 + "<a name=\"services.summary\">\n" 476 + "<!-- -->\n" 477 + "</a>"); 478 checkOutput("module2-summary.html", true, 479 "<tr class=\"altColor\">\n" 480 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdl2/TestClassInModule2.html\" " 481 + "title=\"class in testpkgmdl2\">TestClassInModule2</a></th>\n" 482 + "<td class=\"colLast\"> </td>\n" 483 + "</tr>"); 484 checkOutput("module2-summary.html", true, 485 "<tr class=\"altColor\">\n" 486 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdl2/TestInterfaceInModule2.html\" " 487 + "title=\"interface in testpkg2mdl2\">TestInterfaceInModule2</a><br>" 488 + "(<span class=\"implementationLabel\">Implementation:</span> " 489 + "<a href=\"testpkgmdl2/TestClassInModule2.html\" title=\"class in testpkgmdl2\">" 490 + "TestClassInModule2</a>)</th>\n" 491 + "<td class=\"colLast\"> </td>\n" 492 + "</tr"); 493 checkOutput("module2-summary.html", true, 494 "<caption><span>Exported Packages</span><span class=\"tabEnd\"> </span></caption>\n" 495 + "<tr>\n" 496 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 497 + "<th class=\"colSecond\" scope=\"col\">Module</th>\n" 498 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 499 + "</tr>"); 500 checkOutput("module2-summary.html", true, 501 "<caption><span>Requires</span><span class=\"tabEnd\"> </span></caption>\n" 502 + "<tr>\n" 503 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 504 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 505 + "</tr>"); 506 checkOutput("module2-summary.html", true, 507 "<caption><span>Uses</span><span class=\"tabEnd\"> </span></caption>\n" 508 + "<tr>\n" 509 + "<th class=\"colFirst\" scope=\"col\">Type</th>\n" 510 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 511 + "</tr>"); 512 checkOutput("module2-summary.html", true, 513 "<caption><span>Provides</span><span class=\"tabEnd\"> </span></caption>\n" 514 + "<tr>\n" 515 + "<th class=\"colFirst\" scope=\"col\">Type</th>\n" 516 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 517 + "</tr>"); 518 } 519 520 void checkNegatedModuleSummary() { 521 checkOutput("module1-summary.html", false, 522 "<!-- ============ SERVICES SUMMARY =========== -->\n" 523 + "<a name=\"services.summary\">\n" 524 + "<!-- -->\n" 525 + "</a>"); 526 } 527 528 void checkModuleClickThroughLinks() { 529 checkOutput("module-overview-frame.html", true, 530 "<li><a href=\"module1-frame.html\" target=\"packageListFrame\" " 531 + "onclick=\"updateModuleFrame('module1-type-frame.html','module1-summary.html');" 532 + "\">module1</a></li>"); 533 checkOutput("module-overview-frame.html", true, 534 "<li><a href=\"module2-frame.html\" target=\"packageListFrame\" " 535 + "onclick=\"updateModuleFrame('module2-type-frame.html','module2-summary.html');" 536 + "\">module2</a></li>"); 537 checkOutput("script.js", true, 538 "function updateModuleFrame(pFrame, cFrame)\n" 539 + "{\n" 540 + " top.packageFrame.location = pFrame;\n" 541 + " top.classFrame.location = cFrame;\n" 542 + "}"); 543 } 544 545 void checkModuleClickThrough(boolean found) { 546 checkFiles(found, 547 "module1-type-frame.html", 548 "module2-type-frame.html"); 549 } 550 551 void checkModuleFilesAndLinks(boolean found) { 552 checkOutput("testpkgmdl1/package-summary.html", found, 553 "<li><a href=\"../module1-summary.html\">Module</a></li>"); 554 checkOutput("testpkgmdl1/package-summary.html", found, 555 "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span> " 556 + "<a href=\"../module1-summary.html\">module1</a></div>"); 557 checkOutput("testpkgmdl1/TestClassInModule1.html", found, 558 "<li><a href=\"../module1-summary.html\">Module</a></li>"); 559 checkOutput("testpkgmdl1/TestClassInModule1.html", found, 560 "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span> " 561 + "<a href=\"../module1-summary.html\">module1</a></div>"); 562 checkFiles(found, 563 "module1-frame.html", 564 "module1-summary.html", 565 "module-overview-frame.html"); 566 } 567 568 void checkModulesInSearch(boolean found) { 569 checkOutput("index-all.html", found, 570 "<dl>\n" 571 + "<dt><a href=\"module1-summary.html\">module1</a> - module module1</dt>\n" 572 + "<dd>\n" 573 + "<div class=\"block\">This is a test description for the module1 module.</div>\n" 574 + "</dd>\n" 575 + "<dt><a href=\"module2-summary.html\">module2</a> - module module2</dt>\n" 576 + "<dd>\n" 577 + "<div class=\"block\">This is a test description for the module2 module.</div>\n" 578 + "</dd>\n" 579 + "</dl>"); 580 checkOutput("index-all.html", found, 581 "<dl>\n" 582 + "<dt><span class=\"searchTagLink\"><a href=\"module1-summary.html#searchphrase\">" 583 + "search phrase</a></span> - Search tag in module1</dt>\n" 584 + "<dd>with description</dd>\n" 585 + "<dt><span class=\"searchTagLink\"><a href=\"module2-summary.html#search_word\">" 586 + "search_word</a></span> - Search tag in module2</dt>\n" 587 + "<dd> </dd>\n" 588 + "</dl>"); 589 } 590 591 void checkModuleDeprecation(boolean found) { 592 checkOutput("module1-summary.html", found, 593 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" 594 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n" 595 + "</div>"); 596 checkOutput("deprecated-list.html", found, 597 "<ul>\n" 598 + "<li><a href=\"#module\">Deprecated Modules</a></li>\n" 599 + "</ul>", 600 "<tr class=\"altColor\">\n" 601 + "<th class=\"colFirst\" scope=\"row\"><a href=\"module1-summary.html\">module1</a></th>\n" 602 + "<td class=\"colLast\">\n" 603 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n" 604 + "</td>\n" 605 + "</tr>"); 606 checkOutput("module2-summary.html", !found, 607 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" 608 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated using just the javadoc tag.</span></div>"); 609 checkOutput("moduletags-summary.html", found, 610 "<p>@Deprecated\n" 611 + "</p>", 612 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span></div>"); 613 } 614 615 void checkModuleAnnotation() { 616 checkOutput("module2-summary.html", true, 617 "<p><a href=\"testpkgmdl2/AnnotationType.html\" title=\"annotation in testpkgmdl2\">@AnnotationType</a>(<a href=\"testpkgmdl2/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n" 618 + " <a href=\"testpkgmdl2/AnnotationType.html#required--\">required</a>=2016)\n" 619 + "</p>"); 620 checkOutput("module2-summary.html", false, 621 "@AnnotationTypeUndocumented"); 622 } 623 } | 28 * @author bpatel 29 * @library ../lib 30 * @modules jdk.javadoc/jdk.javadoc.internal.tool 31 * @build JavadocTester 32 * @run main TestModules 33 */ 34 public class TestModules extends JavadocTester { 35 36 public static void main(String... args) throws Exception { 37 TestModules tester = new TestModules(); 38 tester.runTests(); 39 } 40 41 /** 42 * Test generated module pages for HTML 4. 43 */ 44 @Test 45 void testHtml4() { 46 javadoc("-d", "out", "-use", 47 "--module-source-path", testSrc, 48 "--add-modules", "moduleA,moduleB", 49 "testpkgmdlA", "testpkgmdlB"); 50 checkExit(Exit.OK); 51 checkDescription(true); 52 checkNoDescription(false); 53 checkOverviewSummaryModules(); 54 checkModuleLink(); 55 checkModuleClickThroughLinks(); 56 checkModuleClickThrough(true); 57 checkModuleFilesAndLinks(true); 58 checkModulesInSearch(true); 59 } 60 61 /** 62 * Test generated module pages for HTML 5. 63 */ 64 @Test 65 void testHtml5() { 66 javadoc("-d", "out-html5", "-html5", "-use", 67 "--module-source-path", testSrc, 68 "--add-modules", "moduleA,moduleB", 69 "testpkgmdlA", "testpkgmdlB"); 70 checkExit(Exit.OK); 71 checkHtml5Description(true); 72 checkHtml5NoDescription(false); 73 checkHtml5OverviewSummaryModules(); 74 checkModuleLink(); 75 checkModuleClickThroughLinks(); 76 checkModuleClickThrough(true); 77 checkModuleFilesAndLinks(true); 78 checkModulesInSearch(true); 79 } 80 81 /** 82 * Test generated module pages for HTML 4 with -nocomment option. 83 */ 84 @Test 85 void testHtml4NoComment() { 86 javadoc("-d", "out-nocomment", "-nocomment", "-use", 87 "--module-source-path", testSrc, 88 "--add-modules", "moduleA,moduleB", 89 "testpkgmdlA", "testpkgmdlB"); 90 checkExit(Exit.OK); 91 checkDescription(false); 92 checkNoDescription(true); 93 checkModuleLink(); 94 checkModuleFilesAndLinks(true); 95 } 96 97 /** 98 * Test generated module pages for HTML 5 with -nocomment option. 99 */ 100 @Test 101 void testHtml5NoComment() { 102 javadoc("-d", "out-html5-nocomment", "-nocomment", "-html5", "-use", 103 "--module-source-path", testSrc, 104 "--add-modules", "moduleA,moduleB", 105 "testpkgmdlA", "testpkgmdlB"); 106 checkExit(Exit.OK); 107 checkHtml5Description(false); 108 checkHtml5NoDescription(true); 109 checkModuleLink(); 110 checkModuleFilesAndLinks(true); 111 } 112 113 /** 114 * Test generated pages, in an unnamed module, for HTML 4. 115 */ 116 @Test 117 void testHtml4UnnamedModule() { 118 javadoc("-d", "out-nomodule", "-use", 119 "-sourcepath", testSrc, 120 "testpkgnomodule", "testpkgnomodule1"); 121 checkExit(Exit.OK); 122 checkOverviewSummaryPackages(); 123 checkModuleClickThrough(false); 124 checkModuleFilesAndLinks(false); 125 checkModulesInSearch(false); 131 @Test 132 void testHtml5UnnamedModule() { 133 javadoc("-d", "out-html5-nomodule", "-html5", "-use", 134 "-sourcepath", testSrc, 135 "testpkgnomodule", "testpkgnomodule1"); 136 checkExit(Exit.OK); 137 checkHtml5OverviewSummaryPackages(); 138 checkModuleFilesAndLinks(false); 139 checkModulesInSearch(false); 140 } 141 142 /** 143 * Test generated module pages with javadoc tags. 144 */ 145 @Test 146 void testJDTagsInModules() { 147 javadoc("-d", "out-mdltags", "-author", "-version", 148 "-tag", "regular:a:Regular Tag:", 149 "-tag", "moduletag:s:Module Tag:", 150 "--module-source-path", testSrc, 151 "--add-modules", "moduletags,moduleB", 152 "testpkgmdltags", "testpkgmdlB"); 153 checkExit(Exit.OK); 154 checkModuleTags(); 155 } 156 157 /** 158 * Test generated module summary page. 159 */ 160 @Test 161 void testModuleSummary() { 162 javadoc("-d", "out-moduleSummary", "-use", 163 "--module-source-path", testSrc, 164 "--add-modules", "moduleA,moduleB", 165 "testpkgmdlA", "testpkgmdlB", "moduleB/testpkg2mdlB"); 166 checkExit(Exit.OK); 167 checkModuleSummary(); 168 checkNegatedModuleSummary(); 169 } 170 171 /** 172 * Test generated module pages and pages with link to modules. 173 */ 174 @Test 175 void testModuleFilesAndLinks() { 176 javadoc("-d", "out-modulelinks", 177 "--module-source-path", testSrc, 178 "--add-modules", "moduleA", 179 "testpkgmdlA"); 180 checkExit(Exit.OK); 181 checkModuleFilesAndLinks(true); 182 } 183 184 /** 185 * Test generated module pages for a deprecated module. 186 */ 187 @Test 188 void testModuleDeprecation() { 189 javadoc("-d", "out-moduledepr", 190 "-tag", "regular:a:Regular Tag:", 191 "-tag", "moduletag:s:Module Tag:", 192 "--module-source-path", testSrc, 193 "--module", "moduleA,moduleB,moduletags", 194 "testpkgmdlA", "testpkgmdlB", "testpkgmdltags"); 195 checkExit(Exit.OK); 196 checkModuleDeprecation(true); 197 } 198 199 /** 200 * Test annotations on modules. 201 */ 202 @Test 203 void testModuleAnnotation() { 204 javadoc("-d", "out-moduleanno", 205 "--module-source-path", testSrc, 206 "--module", "moduleA,moduleB", 207 "testpkgmdlA", "testpkgmdlB"); 208 checkExit(Exit.OK); 209 checkModuleAnnotation(); 210 } 211 212 void checkDescription(boolean found) { 213 checkOutput("moduleA-summary.html", found, 214 "<!-- ============ MODULE DESCRIPTION =========== -->\n" 215 + "<a name=\"module.description\">\n" 216 + "<!-- -->\n" 217 + "</a>\n" 218 + "<div class=\"block\">This is a test description for the moduleA module. Search " 219 + "phrase <a id=\"searchphrase\">search phrase</a>.</div>"); 220 checkOutput("moduleB-summary.html", found, 221 "<!-- ============ MODULE DESCRIPTION =========== -->\n" 222 + "<a name=\"module.description\">\n" 223 + "<!-- -->\n" 224 + "</a>\n" 225 + "<div class=\"block\">This is a test description for the moduleB module. Search " 226 + "word <a id=\"search_word\">search_word</a> with no description.</div>"); 227 } 228 229 void checkNoDescription(boolean found) { 230 checkOutput("moduleA-summary.html", found, 231 "<div class=\"contentContainer\">\n" 232 + "<ul class=\"blockList\">\n" 233 + "<li class=\"blockList\">\n" 234 + "<ul class=\"blockList\">\n" 235 + "<li class=\"blockList\">\n" 236 + "<!-- ============ MODULES SUMMARY =========== -->"); 237 checkOutput("moduleB-summary.html", found, 238 "<div class=\"contentContainer\">\n" 239 + "<ul class=\"blockList\">\n" 240 + "<li class=\"blockList\">\n" 241 + "<ul class=\"blockList\">\n" 242 + "<li class=\"blockList\">\n" 243 + "<!-- ============ MODULES SUMMARY =========== -->"); 244 } 245 246 void checkHtml5Description(boolean found) { 247 checkOutput("moduleA-summary.html", found, 248 "<section role=\"region\">\n" 249 + "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" 250 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n" 251 + "</div>\n" 252 + "<!-- ============ MODULE DESCRIPTION =========== -->\n" 253 + "<a id=\"module.description\">\n" 254 + "<!-- -->\n" 255 + "</a>\n" 256 + "<div class=\"block\">This is a test description for the moduleA module. Search " 257 + "phrase <a id=\"searchphrase\">search phrase</a>.</div>"); 258 checkOutput("moduleB-summary.html", found, 259 "<section role=\"region\">\n" 260 + "<!-- ============ MODULE DESCRIPTION =========== -->\n" 261 + "<a id=\"module.description\">\n" 262 + "<!-- -->\n" 263 + "</a>\n" 264 + "<div class=\"block\">This is a test description for the moduleB module. Search " 265 + "word <a id=\"search_word\">search_word</a> with no description.</div>"); 266 } 267 268 void checkHtml5NoDescription(boolean found) { 269 checkOutput("moduleA-summary.html", found, 270 "<div class=\"contentContainer\">\n" 271 + "<ul class=\"blockList\">\n" 272 + "<li class=\"blockList\">\n" 273 + "<ul class=\"blockList\">\n" 274 + "<li class=\"blockList\">\n" 275 + "<!-- ============ MODULES SUMMARY =========== -->"); 276 checkOutput("moduleB-summary.html", found, 277 "<div class=\"contentContainer\">\n" 278 + "<ul class=\"blockList\">\n" 279 + "<li class=\"blockList\">\n" 280 + "<ul class=\"blockList\">\n" 281 + "<li class=\"blockList\">\n" 282 + "<!-- ============ MODULES SUMMARY =========== -->"); 283 } 284 285 void checkModuleLink() { 286 checkOutput("overview-summary.html", true, 287 "<li>Module</li>"); 288 checkOutput("moduleA-summary.html", true, 289 "<li class=\"navBarCell1Rev\">Module</li>"); 290 checkOutput("moduleB-summary.html", true, 291 "<li class=\"navBarCell1Rev\">Module</li>"); 292 checkOutput("testpkgmdlA/class-use/TestClassInModuleA.html", true, 293 "<li><a href=\"../../moduleA-summary.html\">Module</a></li>"); 294 checkOutput("testpkgmdlB/package-summary.html", true, 295 "<li><a href=\"../moduleB-summary.html\">Module</a></li>"); 296 checkOutput("testpkgmdlB/TestClassInModuleB.html", true, 297 "<li><a href=\"../moduleB-summary.html\">Module</a></li>"); 298 checkOutput("testpkgmdlB/class-use/TestClassInModuleB.html", true, 299 "<li><a href=\"../../moduleB-summary.html\">Module</a></li>"); 300 } 301 302 void checkNoModuleLink() { 303 checkOutput("testpkgnomodule/package-summary.html", true, 304 "<ul class=\"navList\" title=\"Navigation\">\n" 305 + "<li><a href=\"../testpkgnomodule/package-summary.html\">Package</a></li>"); 306 checkOutput("testpkgnomodule/TestClassNoModule.html", true, 307 "<ul class=\"navList\" title=\"Navigation\">\n" 308 + "<li><a href=\"../testpkgnomodule/package-summary.html\">Package</a></li>"); 309 checkOutput("testpkgnomodule/class-use/TestClassNoModule.html", true, 310 "<ul class=\"navList\" title=\"Navigation\">\n" 311 + "<li><a href=\"../../testpkgnomodule/package-summary.html\">Package</a></li>"); 312 } 313 314 void checkModuleTags() { 315 checkOutput("moduletags-summary.html", true, 316 "Type Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in " 317 + "testpkgmdltags\"><code>TestClassInModuleTags</code></a>."); 318 checkOutput("moduletags-summary.html", true, 319 "Member Link: <a href=\"testpkgmdltags/TestClassInModuleTags.html#" 320 + "testMethod-java.lang.String-\"><code>testMethod(String)</code></a>."); 321 checkOutput("moduletags-summary.html", true, 322 "Package Link: <a href=\"testpkgmdltags/package-summary.html\"><code>testpkgmdltags</code></a>."); 323 checkOutput("moduletags-summary.html", true, 324 "<dt><span class=\"simpleTagLabel\">Since:</span></dt>\n" 325 + "<dd>JDK 9</dd>"); 326 checkOutput("moduletags-summary.html", true, 327 "<dt><span class=\"seeLabel\">See Also:</span></dt>\n" 328 + "<dd>\"Test see tag\", \n" 329 + "<a href=\"testpkgmdltags/TestClassInModuleTags.html\" title=\"class in testpkgmdltags\"><code>" 330 + "TestClassInModuleTags</code></a></dd>"); 331 checkOutput("moduletags-summary.html", true, 332 "<dt><span class=\"simpleTagLabel\">Regular Tag:</span></dt>\n" 333 + "<dd>Just a regular simple tag.</dd>"); 334 checkOutput("moduletags-summary.html", true, 335 "<dt><span class=\"simpleTagLabel\">Module Tag:</span></dt>\n" 336 + "<dd>Just a simple module tag.</dd>"); 337 checkOutput("moduletags-summary.html", true, 338 "<dt><span class=\"simpleTagLabel\">Version:</span></dt>\n" 339 + "<dd>1.0</dd>"); 340 checkOutput("moduletags-summary.html", true, 341 "<dt><span class=\"simpleTagLabel\">Author:</span></dt>\n" 342 + "<dd>Bhavesh Patel</dd>"); 343 checkOutput("testpkgmdltags/TestClassInModuleTags.html", false, 344 "<dt><span class=\"simpleTagLabel\">Module Tag:</span></dt>\n" 345 + "<dd>Just a simple module tag.</dd>"); 346 } 347 348 void checkOverviewSummaryModules() { 349 checkOutput("overview-summary.html", true, 350 "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n" 351 + "<caption><span>Modules</span><span class=\"tabEnd\"> </span></caption>\n" 352 + "<tr>\n" 353 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 354 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 355 + "</tr>"); 356 checkOutput("overview-summary.html", false, 357 "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n" 358 + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>\n" 359 + "<tr>\n" 360 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 361 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 362 + "</tr>"); 363 } 364 365 void checkOverviewSummaryPackages() { 366 checkOutput("overview-summary.html", false, 367 "<table class=\"overviewSummary\" summary=\"Module Summary table, listing modules, and an explanation\">\n" 368 + "<caption><span>Modules</span><span class=\"tabEnd\"> </span></caption>\n" 369 + "<tr>\n" 370 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 371 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 372 + "</tr>"); 373 checkOutput("overview-summary.html", true, 374 "<table class=\"overviewSummary\" summary=\"Packages table, listing packages, and an explanation\">\n" 375 + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>\n" 376 + "<tr>\n" 377 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 378 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 379 + "</tr>"); 380 } 381 382 void checkHtml5OverviewSummaryModules() { 383 checkOutput("overview-summary.html", true, 384 "<table class=\"overviewSummary\">\n" 385 + "<caption><span>Modules</span><span class=\"tabEnd\"> </span></caption>\n" 386 + "<tr>\n" 387 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 388 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 389 + "</tr>"); 390 checkOutput("overview-summary.html", false, 391 "<table class=\"overviewSummary\">\n" 392 + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>\n" 393 + "<tr>\n" 394 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 395 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 396 + "</tr>"); 397 } 398 399 void checkHtml5OverviewSummaryPackages() { 400 checkOutput("overview-summary.html", false, 401 "<table class=\"overviewSummary\">\n" 402 + "<caption><span>Modules</span><span class=\"tabEnd\"> </span></caption>\n" 403 + "<tr>\n" 404 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 405 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 406 + "</tr>"); 407 checkOutput("overview-summary.html", true, 408 "<table class=\"overviewSummary\">\n" 409 + "<caption><span>Packages</span><span class=\"tabEnd\"> </span></caption>\n" 410 + "<tr>\n" 411 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 412 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 413 + "</tr>"); 414 } 415 416 void checkModuleSummary() { 417 checkOutput("moduleA-summary.html", true, 418 "<ul class=\"subNavList\">\n" 419 + "<li>Module: </li>\n" 420 + "<li><a href=\"#module.description\">Description</a> | <a " 421 + "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">" 422 + "Packages</a> | Services</li>\n" 423 + "</ul>"); 424 checkOutput("moduleA-summary.html", true, 425 "<!-- ============ MODULES SUMMARY =========== -->\n" 426 + "<a name=\"modules.summary\">\n" 427 + "<!-- -->\n" 428 + "</a>"); 429 checkOutput("moduleA-summary.html", true, 430 "<tr class=\"altColor\">\n" 431 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlA/package-summary.html\">testpkgmdlA</a></th>\n" 432 + "<td class=\"colSecond\">All Modules</td>\n" 433 + "<td class=\"colLast\"> </td>\n" 434 + "</tr>"); 435 checkOutput("moduleA-summary.html", true, 436 "<!-- ============ PACKAGES SUMMARY =========== -->\n" 437 + "<a name=\"packages.summary\">\n" 438 + "<!-- -->\n" 439 + "</a>"); 440 checkOutput("moduleA-summary.html", true, 441 "<tr class=\"rowColor\">\n" 442 + "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleB-summary.html\">moduleB</a></th>\n" 443 + "<td class=\"colLast\">\n" 444 + "<div class=\"block\">This is a test description for the moduleB module.</div>\n" 445 + "</td>\n" 446 + "</tr>"); 447 checkOutput("moduleB-summary.html", true, 448 "<li><a href=\"#module.description\">Description</a> | <a " 449 + "href=\"#modules.summary\">Modules</a> | <a href=\"#packages.summary\">" 450 + "Packages</a> | <a href=\"#services.summary\">Services</a></li>"); 451 checkOutput("moduleB-summary.html", true, 452 "<!-- ============ MODULES SUMMARY =========== -->\n" 453 + "<a name=\"modules.summary\">\n" 454 + "<!-- -->\n" 455 + "</a>"); 456 checkOutput("moduleB-summary.html", true, 457 "<tr class=\"rowColor\">\n" 458 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/package-summary.html\">" 459 + "testpkg2mdlB</a></th>\n" 460 + "<td class=\"colSecond\">moduleA</td>\n" 461 + "<td class=\"colLast\"> </td>\n" 462 + "</tr>"); 463 checkOutput("moduleB-summary.html", true, 464 "<!-- ============ PACKAGES SUMMARY =========== -->\n" 465 + "<a name=\"packages.summary\">\n" 466 + "<!-- -->\n" 467 + "</a>"); 468 checkOutput("moduleB-summary.html", true, 469 "<tr class=\"altColor\">\n" 470 + "<th class=\"colFirst\" scope=\"row\"><a href=\"java.base-summary.html\">java.base</a></th>\n" 471 + "<td class=\"colLast\"> </td>\n" 472 + "</tr>"); 473 checkOutput("moduleB-summary.html", true, 474 "<!-- ============ SERVICES SUMMARY =========== -->\n" 475 + "<a name=\"services.summary\">\n" 476 + "<!-- -->\n" 477 + "</a>"); 478 checkOutput("moduleB-summary.html", true, 479 "<tr class=\"altColor\">\n" 480 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkgmdlB/TestClassInModuleB.html\" " 481 + "title=\"class in testpkgmdlB\">TestClassInModuleB</a></th>\n" 482 + "<td class=\"colLast\"> </td>\n" 483 + "</tr>"); 484 checkOutput("moduleB-summary.html", true, 485 "<tr class=\"altColor\">\n" 486 + "<th class=\"colFirst\" scope=\"row\"><a href=\"testpkg2mdlB/TestInterfaceInModuleB.html\" " 487 + "title=\"interface in testpkg2mdlB\">TestInterfaceInModuleB</a><br>" 488 + "(<span class=\"implementationLabel\">Implementation:</span> " 489 + "<a href=\"testpkgmdlB/TestClassInModuleB.html\" title=\"class in testpkgmdlB\">" 490 + "TestClassInModuleB</a>)</th>\n" 491 + "<td class=\"colLast\"> </td>\n" 492 + "</tr"); 493 checkOutput("moduleB-summary.html", true, 494 "<caption><span>Exported Packages</span><span class=\"tabEnd\"> </span></caption>\n" 495 + "<tr>\n" 496 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n" 497 + "<th class=\"colSecond\" scope=\"col\">Module</th>\n" 498 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 499 + "</tr>"); 500 checkOutput("moduleB-summary.html", true, 501 "<caption><span>Requires</span><span class=\"tabEnd\"> </span></caption>\n" 502 + "<tr>\n" 503 + "<th class=\"colFirst\" scope=\"col\">Module</th>\n" 504 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 505 + "</tr>"); 506 checkOutput("moduleB-summary.html", true, 507 "<caption><span>Uses</span><span class=\"tabEnd\"> </span></caption>\n" 508 + "<tr>\n" 509 + "<th class=\"colFirst\" scope=\"col\">Type</th>\n" 510 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 511 + "</tr>"); 512 checkOutput("moduleB-summary.html", true, 513 "<caption><span>Provides</span><span class=\"tabEnd\"> </span></caption>\n" 514 + "<tr>\n" 515 + "<th class=\"colFirst\" scope=\"col\">Type</th>\n" 516 + "<th class=\"colLast\" scope=\"col\">Description</th>\n" 517 + "</tr>"); 518 } 519 520 void checkNegatedModuleSummary() { 521 checkOutput("moduleA-summary.html", false, 522 "<!-- ============ SERVICES SUMMARY =========== -->\n" 523 + "<a name=\"services.summary\">\n" 524 + "<!-- -->\n" 525 + "</a>"); 526 } 527 528 void checkModuleClickThroughLinks() { 529 checkOutput("module-overview-frame.html", true, 530 "<li><a href=\"moduleA-frame.html\" target=\"packageListFrame\" " 531 + "onclick=\"updateModuleFrame('moduleA-type-frame.html','moduleA-summary.html');" 532 + "\">moduleA</a></li>"); 533 checkOutput("module-overview-frame.html", true, 534 "<li><a href=\"moduleB-frame.html\" target=\"packageListFrame\" " 535 + "onclick=\"updateModuleFrame('moduleB-type-frame.html','moduleB-summary.html');" 536 + "\">moduleB</a></li>"); 537 checkOutput("script.js", true, 538 "function updateModuleFrame(pFrame, cFrame)\n" 539 + "{\n" 540 + " top.packageFrame.location = pFrame;\n" 541 + " top.classFrame.location = cFrame;\n" 542 + "}"); 543 } 544 545 void checkModuleClickThrough(boolean found) { 546 checkFiles(found, 547 "moduleA-type-frame.html", 548 "moduleB-type-frame.html"); 549 } 550 551 void checkModuleFilesAndLinks(boolean found) { 552 checkOutput("testpkgmdlA/package-summary.html", found, 553 "<li><a href=\"../moduleA-summary.html\">Module</a></li>"); 554 checkOutput("testpkgmdlA/package-summary.html", found, 555 "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span> " 556 + "<a href=\"../moduleA-summary.html\">moduleA</a></div>"); 557 checkOutput("testpkgmdlA/TestClassInModuleA.html", found, 558 "<li><a href=\"../moduleA-summary.html\">Module</a></li>"); 559 checkOutput("testpkgmdlA/TestClassInModuleA.html", found, 560 "<div class=\"subTitle\"><span class=\"moduleLabelInClass\">Module</span> " 561 + "<a href=\"../moduleA-summary.html\">moduleA</a></div>"); 562 checkFiles(found, 563 "moduleA-frame.html", 564 "moduleA-summary.html", 565 "module-overview-frame.html"); 566 } 567 568 void checkModulesInSearch(boolean found) { 569 checkOutput("index-all.html", found, 570 "<dl>\n" 571 + "<dt><a href=\"moduleA-summary.html\">moduleA</a> - module moduleA</dt>\n" 572 + "<dd>\n" 573 + "<div class=\"block\">This is a test description for the moduleA module.</div>\n" 574 + "</dd>\n" 575 + "<dt><a href=\"moduleB-summary.html\">moduleB</a> - module moduleB</dt>\n" 576 + "<dd>\n" 577 + "<div class=\"block\">This is a test description for the moduleB module.</div>\n" 578 + "</dd>\n" 579 + "</dl>"); 580 checkOutput("index-all.html", found, 581 "<dl>\n" 582 + "<dt><span class=\"searchTagLink\"><a href=\"moduleA-summary.html#searchphrase\">" 583 + "search phrase</a></span> - Search tag in moduleA</dt>\n" 584 + "<dd>with description</dd>\n" 585 + "<dt><span class=\"searchTagLink\"><a href=\"moduleB-summary.html#search_word\">" 586 + "search_word</a></span> - Search tag in moduleB</dt>\n" 587 + "<dd> </dd>\n" 588 + "</dl>"); 589 } 590 591 void checkModuleDeprecation(boolean found) { 592 checkOutput("moduleA-summary.html", found, 593 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" 594 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n" 595 + "</div>"); 596 checkOutput("deprecated-list.html", found, 597 "<ul>\n" 598 + "<li><a href=\"#module\">Deprecated Modules</a></li>\n" 599 + "</ul>", 600 "<tr class=\"altColor\">\n" 601 + "<th class=\"colFirst\" scope=\"row\"><a href=\"moduleA-summary.html\">moduleA</a></th>\n" 602 + "<td class=\"colLast\">\n" 603 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated.</span></div>\n" 604 + "</td>\n" 605 + "</tr>"); 606 checkOutput("moduleB-summary.html", !found, 607 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>\n" 608 + "<div class=\"block\"><span class=\"deprecationComment\">This module is deprecated using just the javadoc tag.</span></div>"); 609 checkOutput("moduletags-summary.html", found, 610 "<p>@Deprecated\n" 611 + "</p>", 612 "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span></div>"); 613 } 614 615 void checkModuleAnnotation() { 616 checkOutput("moduleB-summary.html", true, 617 "<p><a href=\"testpkgmdlB/AnnotationType.html\" title=\"annotation in testpkgmdlB\">@AnnotationType</a>(<a href=\"testpkgmdlB/AnnotationType.html#optional--\">optional</a>=\"Module Annotation\",\n" 618 + " <a href=\"testpkgmdlB/AnnotationType.html#required--\">required</a>=2016)\n" 619 + "</p>"); 620 checkOutput("moduleB-summary.html", false, 621 "@AnnotationTypeUndocumented"); 622 } 623 } |