test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java
changeset 49139 771616d26ca1
parent 48654 36f58bd6269f
child 51127 c2e676c2cf7b
equal deleted inserted replaced
49138:67912cbf784a 49139:771616d26ca1
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug      4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417 8186332
    26  * @bug      4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417 8186332 8182765
    27  * @summary  Test the case where the overriden method returns a different
    27  * @summary  Test the case where the overriden method returns a different
    28  *           type than the method in the child class.  Make sure the
    28  *           type than the method in the child class.  Make sure the
    29  *           documentation is inherited but the return type isn't.
    29  *           documentation is inherited but the return type isn't.
    30  * @author   jamieh
    30  * @author   jamieh
    31  * @library  ../lib
    31  * @library  ../lib
    41         tester.runTests();
    41         tester.runTests();
    42     }
    42     }
    43 
    43 
    44     @Test
    44     @Test
    45     void test() {
    45     void test() {
    46         javadoc("-d", "out", "-private",
    46         javadoc("-d", "out",
       
    47                 "-private",
       
    48                 "-sourcepath", testSrc,
       
    49                 "pkg","pkg2");
       
    50         checkExit(Exit.OK);
       
    51 
       
    52         checkOutput("pkg/PublicChild.html", true,
       
    53                 // Check return type in member summary.
       
    54                 "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
       
    55                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest()\">"
       
    56                 + "returnTypeTest</a></span>()</code>",
       
    57                 // Check return type in member detail.
       
    58                 "<pre>public&nbsp;<a href=\"PublicChild.html\" title=\"class in pkg\">"
       
    59                 + "PublicChild</a>&nbsp;returnTypeTest()</pre>",
       
    60                 "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
       
    61                 + "<a href=\"#%3Cinit%3E()\">PublicChild</a></span>()</code></th>");
       
    62 
       
    63         checkOutput("pkg/PrivateParent.html", true,
       
    64                 "<td class=\"colFirst\"><code>private </code></td>\n"
       
    65                 + "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
       
    66                 + "<a href=\"#%3Cinit%3E(int)\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
       
    67                 + "</th>");
       
    68 
       
    69         // Legacy anchor dimensions (6290760)
       
    70         checkOutput("pkg2/A.html", true,
       
    71                 "<a id=\"f(java.lang.Object[])\">\n"
       
    72                 + "<!--   -->\n"
       
    73                 + "</a><a id=\"f(T[])\">\n"
       
    74                 + "<!--   -->\n"
       
    75                 + "</a>");
       
    76     }
       
    77 
       
    78     @Test
       
    79     void test_html4() {
       
    80         javadoc("-d", "out-html4",
       
    81                 "-html4",
       
    82                 "-private",
    47                 "-sourcepath", testSrc,
    83                 "-sourcepath", testSrc,
    48                 "pkg","pkg2");
    84                 "pkg","pkg2");
    49         checkExit(Exit.OK);
    85         checkExit(Exit.OK);
    50 
    86 
    51         checkOutput("pkg/PublicChild.html", true,
    87         checkOutput("pkg/PublicChild.html", true,
    52                 // Check return type in member summary.
    88                 // Check return type in member summary.
    53                 "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
    89                 "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
    54                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest--\">"
    90                 + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest--\">"
    55                 + "returnTypeTest</a></span>()</code>",
    91                 + "returnTypeTest</a></span>()</code>",
    56                 // Check return type in member detail.
       
    57                 "<pre>public&nbsp;<a href=\"PublicChild.html\" title=\"class in pkg\">"
       
    58                 + "PublicChild</a>&nbsp;returnTypeTest()</pre>",
       
    59                 "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
    92                 "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
    60                 + "<a href=\"#PublicChild--\">PublicChild</a></span>()</code></th>");
    93                 + "<a href=\"#PublicChild--\">PublicChild</a></span>()</code></th>");
    61 
    94 
    62         checkOutput("pkg/PrivateParent.html", true,
    95         checkOutput("pkg/PrivateParent.html", true,
    63                 "<td class=\"colFirst\"><code>private </code></td>\n"
    96                 "<td class=\"colFirst\"><code>private </code></td>\n"