test/langtools/jdk/javadoc/doclet/testUnnamedPackage/TestUnnamedPackage.java
changeset 50167 cc705c956798
parent 47216 71c04702a3d5
child 51260 b7a307084247
equal deleted inserted replaced
50166:1d683e243d8d 50167:cc705c956798
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2018, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug      4904075 4774450 5015144 8043698
    26  * @bug      4904075 4774450 5015144 8043698 8196201
    27  * @summary  Reference unnamed package as "Unnamed", not empty string.
    27  * @summary  Reference unnamed package as "Unnamed", not empty string.
    28  *           Generate a package summary for the unnamed package.
    28  *           Generate a package summary for the unnamed package.
    29  * @author   jamieh
    29  * @author   jamieh
    30  * @library  ../lib
    30  * @library  ../lib
    31  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    31  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    62                 "title=\"class in <Unnamed>\"");
    62                 "title=\"class in <Unnamed>\"");
    63 
    63 
    64         checkOutput("C.html", true,
    64         checkOutput("C.html", true,
    65                 "<a href=\"package-summary.html\">");
    65                 "<a href=\"package-summary.html\">");
    66 
    66 
       
    67         checkOutput("allclasses-index.html", true,
       
    68                 "<table class=\"typeSummary\">\n"
       
    69                 + "<caption><span>Class Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
       
    70                 + "<tr>\n"
       
    71                 + "<th class=\"colFirst\" scope=\"col\">Class</th>\n"
       
    72                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
       
    73                 + "</tr>\n"
       
    74                 + "<tr id=\"i0\" class=\"altColor\">\n"
       
    75                 + "<td class=\"colFirst\"><a href=\"C.html\" title=\"class in &lt;Unnamed&gt;\">C</a></td>\n"
       
    76                 + "<th class=\"colLast\" scope=\"row\">\n"
       
    77                 + "<div class=\"block\">This is a class in the unnamed package.</div>\n"
       
    78                 + "</th>\n"
       
    79                 + "</tr>\n"
       
    80                 + "</table>");
       
    81 
       
    82         checkOutput("allpackages-index.html", true,
       
    83                 "<table class=\"packagesSummary\">\n"
       
    84                 + "<caption><span>Package Summary</span><span class=\"tabEnd\">&nbsp;</span></caption>\n"
       
    85                 + "<tr>\n"
       
    86                 + "<th class=\"colFirst\" scope=\"col\">Package</th>\n"
       
    87                 + "<th class=\"colLast\" scope=\"col\">Description</th>\n"
       
    88                 + "</tr>\n"
       
    89                 + "<tbody>\n"
       
    90                 + "<tr class=\"altColor\">\n"
       
    91                 + "<th class=\"colFirst\" scope=\"row\"><a href=\"package-summary.html\">&lt;Unnamed&gt;</a></th>\n"
       
    92                 + "<td class=\"colLast\">\n"
       
    93                 + "<div class=\"block\">This is a package comment for the unnamed package.</div>\n"
       
    94                 + "</td>\n"
       
    95                 + "</tr>\n"
       
    96                 + "</tbody>\n"
       
    97                 + "</table>");
       
    98 
       
    99         checkOutput("type-search-index.js", true,
       
   100                 "{\"l\":\"All Classes\",\"url\":\"allclasses-index.html\"}");
       
   101 
       
   102         checkOutput("package-search-index.js", true,
       
   103                 "{\"l\":\"All Packages\",\"url\":\"allpackages-index.html\"}");
       
   104 
       
   105         checkOutput("index-all.html", true,
       
   106                 "<br><a href=\"allclasses-index.html\">All&nbsp;Classes</a>&nbsp;"
       
   107                 + "<a href=\"allpackages-index.html\">All&nbsp;Packages</a>");
       
   108 
    67         checkOutput(Output.OUT, false,
   109         checkOutput(Output.OUT, false,
    68                 "BadSource");
   110                 "BadSource");
    69     }
   111     }
    70 }
   112 }