test/langtools/jdk/javadoc/doclet/testMemberSummary/TestMemberSummary.java
author chegar
Thu, 17 Oct 2019 20:54:25 +0100
branchdatagramsocketimpl-branch
changeset 58679 9c3209ff7550
parent 58678 9cf78a70fa4f
parent 55339 0530705ca300
permissions -rw-r--r--
datagramsocketimpl-branch: merge with default
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
53562
0d9dee001667 8215577: Remove javadoc support for HTML 4
pmuthuswamy
parents: 53097
diff changeset
     2
 * Copyright (c) 2003, 2019, Oracle and/or its affiliates. All rights reserved.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
06bc494ca11e Initial load
duke
parents:
diff changeset
     4
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
06bc494ca11e Initial load
duke
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
06bc494ca11e Initial load
duke
parents:
diff changeset
     7
 * published by the Free Software Foundation.
06bc494ca11e Initial load
duke
parents:
diff changeset
     8
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
06bc494ca11e Initial load
duke
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
06bc494ca11e Initial load
duke
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
06bc494ca11e Initial load
duke
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
06bc494ca11e Initial load
duke
parents:
diff changeset
    13
 * accompanied this code).
06bc494ca11e Initial load
duke
parents:
diff changeset
    14
 *
06bc494ca11e Initial load
duke
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
06bc494ca11e Initial load
duke
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
06bc494ca11e Initial load
duke
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
06bc494ca11e Initial load
duke
parents:
diff changeset
    18
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1787
diff changeset
    21
 * questions.
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    22
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    23
06bc494ca11e Initial load
duke
parents:
diff changeset
    24
/*
06bc494ca11e Initial load
duke
parents:
diff changeset
    25
 * @test
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    26
 * @bug      4951228 6290760 8025633 8026567 8081854 8162363 8175200 8177417 8186332 8182765
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    27
 * @summary  Test the case where the overriden method returns a different
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
 *           type than the method in the child class.  Make sure the
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
 *           documentation is inherited but the return type isn't.
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
 * @author   jamieh
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 51127
diff changeset
    31
 * @library  ../../lib
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    32
 * @modules jdk.javadoc/jdk.javadoc.internal.tool
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 51127
diff changeset
    33
 * @build    javadoc.tester.*
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    34
 * @run main TestMemberSummary
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 51127
diff changeset
    37
import javadoc.tester.JavadocTester;
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 51127
diff changeset
    38
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    39
public class TestMemberSummary extends JavadocTester {
06bc494ca11e Initial load
duke
parents:
diff changeset
    40
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    41
    public static void main(String... args) throws Exception {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    42
        TestMemberSummary tester = new TestMemberSummary();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    43
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    44
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    45
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
    @Test
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 51127
diff changeset
    47
    public void test() {
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    48
        javadoc("-d", "out",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    49
                "-private",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    50
                "-sourcepath", testSrc,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    51
                "pkg","pkg2");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    52
        checkExit(Exit.OK);
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    53
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    54
        checkOutput("pkg/PublicChild.html", true,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    55
                // Check return type in member summary.
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    56
                "<code><a href=\"PublicChild.html\" title=\"class in pkg\">PublicChild</a></code></td>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    57
                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\"><a href=\"#returnTypeTest()\">"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    58
                + "returnTypeTest</a></span>()</code>",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    59
                // Check return type in member detail.
55197
0ca8e495bbba 8214126: Method signatures not formatted correctly in browser
hannesw
parents: 53562
diff changeset
    60
                "<div class=\"memberSignature\"><span class=\"modifiers\">public</span>&nbsp;"
0ca8e495bbba 8214126: Method signatures not formatted correctly in browser
hannesw
parents: 53562
diff changeset
    61
                + "<span class=\"returnType\"><a href=\"PublicChild.html\" title=\"class in pkg\">"
0ca8e495bbba 8214126: Method signatures not formatted correctly in browser
hannesw
parents: 53562
diff changeset
    62
                + "PublicChild</a></span>&nbsp;<span class=\"memberName\">returnTypeTest</span>()</div>",
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    63
                "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    64
                + "<a href=\"#%3Cinit%3E()\">PublicChild</a></span>()</code></th>");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    65
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    66
        checkOutput("pkg/PrivateParent.html", true,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    67
                "<td class=\"colFirst\"><code>private </code></td>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    68
                + "<th class=\"colConstructorName\" scope=\"row\"><code><span class=\"memberNameLink\">"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    69
                + "<a href=\"#%3Cinit%3E(int)\">PrivateParent</a></span>&#8203;(int&nbsp;i)</code>"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    70
                + "</th>");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    71
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    72
        // Legacy anchor dimensions (6290760)
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    73
        checkOutput("pkg2/A.html", true,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    74
                "<a id=\"f(java.lang.Object[])\">\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    75
                + "<!--   -->\n"
55339
0530705ca300 8223364: Bad placement of anchor relative to header
hannesw
parents: 55197
diff changeset
    76
                + "</a><a id=\"f(T[])\">f</a>");
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
    77
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    78
}