< prev index next >

test/langtools/jdk/javadoc/doclet/testIndexInDocFiles/TestIndexInDocFiles.java

Print this page




  79                 + "</html>\n");
  80 
  81         // write the (named) package level doc file
  82         Path pkgDocFiles = src.resolve("p").resolve("q").resolve("doc-files");
  83         tb.writeFile(pkgDocFiles.resolve("package-file.html"),
  84                 "<html>\n"
  85                 + "<head><title>Package HTML file</title></head>\n"
  86                 + "<body><h1>Package HTML file</h1>\n"
  87                 + "{@index package-index additional info}\n"
  88                 + "{@systemProperty package.property}\n"
  89                 + "File content</body>\n"
  90                 + "</html>\n");
  91 
  92         javadoc("-d", base.resolve("out").toString(),
  93                 "--source-path", src.toString(),
  94                 src.resolve("A.java").toString(), "p.q");
  95         checkExit(Exit.OK);
  96 
  97         checkOutput("doc-files/top-level-file.html", true,
  98                 "<h1>Package HTML file</h1>\n"
  99                 + "<a id=\"top-level-index\" class=\"searchTagResult\">top-level-index</a>\n"
 100                 + "<code><a id=\"top.level.property\" class=\"searchTagResult\">top.level.property</a></code>\n");
 101         checkOutput("p/q/doc-files/package-file.html", true,
 102                 "<h1>Package HTML file</h1>\n"
 103                 + "<a id=\"package-index\" class=\"searchTagResult\">package-index</a>\n"
 104                 + "<code><a id=\"package.property\" class=\"searchTagResult\">package.property</a></code>\n");
 105         checkOutput("tag-search-index.js", true,
 106                 "{\"l\":\"package-index\",\"h\":\"package p.q\",\"d\":\"additional info\","
 107                 + "\"u\":\"p/q/doc-files/package-file.html#package-index\"}",
 108                 "{\"l\":\"package.property\",\"h\":\"package p.q\",\"d\":\"System Property\","
 109                 + "\"u\":\"p/q/doc-files/package-file.html#package.property\"}",
 110                 "{\"l\":\"top-level-index\",\"h\":\"unnamed package\",\"d\":\"additional info\","
 111                 + "\"u\":\"doc-files/top-level-file.html#top-level-index\"}",
 112                 "{\"l\":\"top.level.property\",\"h\":\"unnamed package\",\"d\":\"System Property\","
 113                 + "\"u\":\"doc-files/top-level-file.html#top.level.property\"}");
 114     }
 115 
 116     /**
 117      * Test support for index tags and system properties in module and package level doc-files.
 118      * @param base the base directory for scratch files
 119      * @throws IOException if an exception occurs
 120      */
 121     @Test
 122     public void testModuleDocFiles(Path base) throws IOException {
 123         Path src = base.resolve("src");
 124 


 140                 + "</html>\n");
 141 
 142         // write the doc files for a package in the module
 143         Path pkgDocFiles = src.resolve("p").resolve("q").resolve("doc-files");
 144         tb.writeFile(pkgDocFiles.resolve("package-file.html"),
 145                 "<html>\n"
 146                 + "<head><title>Package HTML file</title></head>\n"
 147                 + "<body><h1>Package HTML file</h1>\n"
 148                 + "{@index package-index additional info}\n"
 149                 + "{@systemProperty package.property}\n"
 150                 + "File content</body>\n"
 151                 + "</html>\n");
 152 
 153         javadoc("-d", base.resolve("out").toString(),
 154                 "--source-path", src.toString(),
 155                 "--module", "m.n");
 156         checkExit(Exit.OK);
 157 
 158         checkOutput("m.n/doc-files/module-file.html", true,
 159                 "<h1>Module HTML file</h1>\n"
 160                 + "<a id=\"module-index\" class=\"searchTagResult\">module-index</a>\n"
 161                 + "<code><a id=\"module.property\" class=\"searchTagResult\">module.property</a></code>\n");
 162         checkOutput("m.n/p/q/doc-files/package-file.html", true,
 163                 "<h1>Package HTML file</h1>\n"
 164                 + "<a id=\"package-index\" class=\"searchTagResult\">package-index</a>\n"
 165                 + "<code><a id=\"package.property\" class=\"searchTagResult\">package.property</a></code>\n");
 166         checkOutput("tag-search-index.js", true,
 167                 "{\"l\":\"module-index\",\"h\":\"module m.n\",\"d\":\"additional info\","
 168                 + "\"u\":\"m.n/doc-files/module-file.html#module-index\"}",
 169                 "{\"l\":\"package-index\",\"h\":\"package p.q\",\"d\":\"additional info\","
 170                 + "\"u\":\"m.n/p/q/doc-files/package-file.html#package-index\"}",
 171                 "{\"l\":\"module.property\",\"h\":\"module m.n\",\"d\":\"System Property\","
 172                 + "\"u\":\"m.n/doc-files/module-file.html#module.property\"}",
 173                 "{\"l\":\"package.property\",\"h\":\"package p.q\",\"d\":\"System Property\","
 174                 + "\"u\":\"m.n/p/q/doc-files/package-file.html#package.property\"}");
 175     }
 176 }


  79                 + "</html>\n");
  80 
  81         // write the (named) package level doc file
  82         Path pkgDocFiles = src.resolve("p").resolve("q").resolve("doc-files");
  83         tb.writeFile(pkgDocFiles.resolve("package-file.html"),
  84                 "<html>\n"
  85                 + "<head><title>Package HTML file</title></head>\n"
  86                 + "<body><h1>Package HTML file</h1>\n"
  87                 + "{@index package-index additional info}\n"
  88                 + "{@systemProperty package.property}\n"
  89                 + "File content</body>\n"
  90                 + "</html>\n");
  91 
  92         javadoc("-d", base.resolve("out").toString(),
  93                 "--source-path", src.toString(),
  94                 src.resolve("A.java").toString(), "p.q");
  95         checkExit(Exit.OK);
  96 
  97         checkOutput("doc-files/top-level-file.html", true,
  98                 "<h1>Package HTML file</h1>\n"
  99                 + "<span id=\"top-level-index\" class=\"searchTagResult\">top-level-index</span>\n"
 100                 + "<code><span id=\"top.level.property\" class=\"searchTagResult\">top.level.property</span></code>\n");
 101         checkOutput("p/q/doc-files/package-file.html", true,
 102                 "<h1>Package HTML file</h1>\n"
 103                 + "<span id=\"package-index\" class=\"searchTagResult\">package-index</span>\n"
 104                 + "<code><span id=\"package.property\" class=\"searchTagResult\">package.property</span></code>\n");
 105         checkOutput("tag-search-index.js", true,
 106                 "{\"l\":\"package-index\",\"h\":\"package p.q\",\"d\":\"additional info\","
 107                 + "\"u\":\"p/q/doc-files/package-file.html#package-index\"}",
 108                 "{\"l\":\"package.property\",\"h\":\"package p.q\",\"d\":\"System Property\","
 109                 + "\"u\":\"p/q/doc-files/package-file.html#package.property\"}",
 110                 "{\"l\":\"top-level-index\",\"h\":\"unnamed package\",\"d\":\"additional info\","
 111                 + "\"u\":\"doc-files/top-level-file.html#top-level-index\"}",
 112                 "{\"l\":\"top.level.property\",\"h\":\"unnamed package\",\"d\":\"System Property\","
 113                 + "\"u\":\"doc-files/top-level-file.html#top.level.property\"}");
 114     }
 115 
 116     /**
 117      * Test support for index tags and system properties in module and package level doc-files.
 118      * @param base the base directory for scratch files
 119      * @throws IOException if an exception occurs
 120      */
 121     @Test
 122     public void testModuleDocFiles(Path base) throws IOException {
 123         Path src = base.resolve("src");
 124 


 140                 + "</html>\n");
 141 
 142         // write the doc files for a package in the module
 143         Path pkgDocFiles = src.resolve("p").resolve("q").resolve("doc-files");
 144         tb.writeFile(pkgDocFiles.resolve("package-file.html"),
 145                 "<html>\n"
 146                 + "<head><title>Package HTML file</title></head>\n"
 147                 + "<body><h1>Package HTML file</h1>\n"
 148                 + "{@index package-index additional info}\n"
 149                 + "{@systemProperty package.property}\n"
 150                 + "File content</body>\n"
 151                 + "</html>\n");
 152 
 153         javadoc("-d", base.resolve("out").toString(),
 154                 "--source-path", src.toString(),
 155                 "--module", "m.n");
 156         checkExit(Exit.OK);
 157 
 158         checkOutput("m.n/doc-files/module-file.html", true,
 159                 "<h1>Module HTML file</h1>\n"
 160                 + "<span id=\"module-index\" class=\"searchTagResult\">module-index</span>\n"
 161                 + "<code><span id=\"module.property\" class=\"searchTagResult\">module.property</span></code>\n");
 162         checkOutput("m.n/p/q/doc-files/package-file.html", true,
 163                 "<h1>Package HTML file</h1>\n"
 164                 + "<span id=\"package-index\" class=\"searchTagResult\">package-index</span>\n"
 165                 + "<code><span id=\"package.property\" class=\"searchTagResult\">package.property</span></code>\n");
 166         checkOutput("tag-search-index.js", true,
 167                 "{\"l\":\"module-index\",\"h\":\"module m.n\",\"d\":\"additional info\","
 168                 + "\"u\":\"m.n/doc-files/module-file.html#module-index\"}",
 169                 "{\"l\":\"package-index\",\"h\":\"package p.q\",\"d\":\"additional info\","
 170                 + "\"u\":\"m.n/p/q/doc-files/package-file.html#package-index\"}",
 171                 "{\"l\":\"module.property\",\"h\":\"module m.n\",\"d\":\"System Property\","
 172                 + "\"u\":\"m.n/doc-files/module-file.html#module.property\"}",
 173                 "{\"l\":\"package.property\",\"h\":\"package p.q\",\"d\":\"System Property\","
 174                 + "\"u\":\"m.n/p/q/doc-files/package-file.html#package.property\"}");
 175     }
 176 }
< prev index next >