test/langtools/jdk/javadoc/doclet/testInterface/TestInterface.java
author pmuthuswamy
Tue, 17 Jul 2018 16:49:55 +0530
changeset 51127 c2e676c2cf7b
parent 50810 0358dad944c7
child 53097 2e82ca64b25d
permissions -rw-r--r--
8207190: JDK 11 javadoc generates bad code example Reviewed-by: sundar
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
10
06bc494ca11e Initial load
duke
parents:
diff changeset
     1
/*
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
     2
 * Copyright (c) 2003, 2018, 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: 2985
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2985
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 2985
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
47311
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
    26
 * @bug      4682448 4947464 5029946 8025633 8026567 8035473 8139101 8175200
50810
0358dad944c7 8187288: bad (no) wrapping for modifier and type column
pmuthuswamy
parents: 49139
diff changeset
    27
             8186332 8186703 8182765 8187288
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    28
 * @summary  Verify that the public modifier does not show up in the
06bc494ca11e Initial load
duke
parents:
diff changeset
    29
 *           documentation for public methods, as recommended by the JLS.
06bc494ca11e Initial load
duke
parents:
diff changeset
    30
 *           If A implements I and B extends A, B should be in the list of
06bc494ca11e Initial load
duke
parents:
diff changeset
    31
 *           implementing classes in the documentation for I.
06bc494ca11e Initial load
duke
parents:
diff changeset
    32
 * @author   jamieh
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    33
 * @library  ../lib
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    34
 * @modules jdk.javadoc/jdk.javadoc.internal.tool
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    35
 * @build    JavadocTester
06bc494ca11e Initial load
duke
parents:
diff changeset
    36
 * @run main TestInterface
06bc494ca11e Initial load
duke
parents:
diff changeset
    37
 */
06bc494ca11e Initial load
duke
parents:
diff changeset
    38
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    39
/*
40506
258ad5fd9b57 8163800: The fix for JDK-8072052 shows up other minor incorrect use of styles
jjg
parents: 36526
diff changeset
    40
 * TODO: make it Interface<PE> ie. fix all ParameterTypes, likely should get
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    41
 * fixed when Doc is replace by j.l.m, but meanwhile this test has been adjusted
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    42
 * take the current format this is better than @ignore because we can follow the
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    43
 * differences as the work progress.
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    44
 *
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    45
 * The consensus is that we should have something as follows:
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    46
 * In Child.html
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    47
 *  Specified by:  method in interface<IE>
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    48
 *  Overrides:     method in class Parent<PE>
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    49
 * In otherwords the TypeParameter in scope should be used ex: Interface<IE>, Parent<PE>
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    50
   and Child<CE>
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    51
 */
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    52
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    53
public class TestInterface extends JavadocTester {
06bc494ca11e Initial load
duke
parents:
diff changeset
    54
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    55
    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
    56
        TestInterface tester = new TestInterface();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    58
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    59
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    60
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    61
    void test() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    62
        javadoc("-d", "out",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    63
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    64
                "pkg");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    65
        checkExit(Exit.OK);
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    66
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    67
        checkOutput("pkg/Interface.html", true,
51127
c2e676c2cf7b 8207190: JDK 11 javadoc generates bad code example
pmuthuswamy
parents: 50810
diff changeset
    68
                "<pre class=\"methodSignature\">int&nbsp;method()</pre>",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    69
                "<pre>static final&nbsp;int field</pre>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    70
                // Make sure known implementing class list is correct and omits type parameters.
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    71
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    72
                + "<dt>All Known Implementing Classes:</dt>\n"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
    73
                + "<dd><code><a href=\"Child.html\" title=\"class in pkg\">Child"
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
    74
                + "</a></code>, <code><a href=\"Parent.html\" title=\"class in pkg\">Parent"
40506
258ad5fd9b57 8163800: The fix for JDK-8072052 shows up other minor incorrect use of styles
jjg
parents: 36526
diff changeset
    75
                + "</a></code></dd>\n"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    76
                + "</dl>");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
    77
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    78
        checkOutput("pkg/Child.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    79
                // Make sure "All Implemented Interfaces": has substituted type parameters
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    80
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    81
                + "<dt>All Implemented Interfaces:</dt>\n"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
    82
                + "<dd><code><a href=\"Interface.html\" title=\"interface in pkg\">"
40506
258ad5fd9b57 8163800: The fix for JDK-8072052 shows up other minor incorrect use of styles
jjg
parents: 36526
diff changeset
    83
                + "Interface</a>&lt;CE&gt;</code></dd>\n"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    84
                + "</dl>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    85
                //Make sure Class Tree has substituted type parameters.
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    86
                "<ul class=\"inheritance\">\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    87
                + "<li>java.lang.Object</li>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    88
                + "<li>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    89
                + "<ul class=\"inheritance\">\n"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
    90
                + "<li><a href=\"Parent.html\" title=\"class in pkg\">"
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    91
                + "pkg.Parent</a>&lt;CE&gt;</li>\n"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    92
                + "<li>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    93
                + "<ul class=\"inheritance\">\n"
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
    94
                + "<li>pkg.Child&lt;CE&gt;</li>\n"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    95
                + "</ul>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    96
                + "</li>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    97
                + "</ul>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    98
                + "</li>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    99
                + "</ul>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   100
                //Make sure "Specified By" has substituted type parameters.
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   101
                "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   102
                + "<dd><code><a href=\"Interface.html#method()\">method</a>"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   103
                + "</code>&nbsp;in interface&nbsp;<code>"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   104
                + "<a href=\"Interface.html\" title=\"interface in pkg\">"
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   105
                + "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   106
                + "CE</a>&gt;</code></dd>",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   107
                //Make sure "Overrides" has substituted type parameters.
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   108
                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   109
                + "<dd><code><a href=\"Parent.html#method()\">method</a>"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   110
                + "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   111
                + "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   112
                + "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   113
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   114
        checkOutput("pkg/Parent.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   115
                //Make sure "Direct Know Subclasses" omits type parameters
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   116
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   117
                + "<dt>Direct Known Subclasses:</dt>\n"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   118
                + "<dd><code><a href=\"Child.html\" title=\"class in pkg\">Child"
40506
258ad5fd9b57 8163800: The fix for JDK-8072052 shows up other minor incorrect use of styles
jjg
parents: 36526
diff changeset
   119
                + "</a></code></dd>\n"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   120
                + "</dl>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   121
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   122
        checkOutput("pkg/Interface.html", false,
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   123
                "public int&nbsp;method--",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   124
                "public static final&nbsp;int field");
42417
8e1573096052 8139101: javadoc emits "specified by" clause when class has a method that matches a static interface method
bpatel
parents: 40506
diff changeset
   125
47311
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   126
        checkOutput("pkg/ClassWithStaticMembers.html", false,
42417
8e1573096052 8139101: javadoc emits "specified by" clause when class has a method that matches a static interface method
bpatel
parents: 40506
diff changeset
   127
                //Make sure "Specified By" does not appear on class documentation when
8e1573096052 8139101: javadoc emits "specified by" clause when class has a method that matches a static interface method
bpatel
parents: 40506
diff changeset
   128
                //the method is a static method in the interface.
8e1573096052 8139101: javadoc emits "specified by" clause when class has a method that matches a static interface method
bpatel
parents: 40506
diff changeset
   129
                "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n");
47311
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   130
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   131
        checkOutput("pkg/ClassWithStaticMembers.html", true,
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   132
                "<h4>f</h4>\n"
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   133
                + "<pre>public static&nbsp;int f</pre>\n"
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   134
                + "<div class=\"block\">A hider field</div>",
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   135
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   136
                "<td class=\"colFirst\"><code>static void</code></td>\n"
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   137
                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   138
                + "<a href=\"#m()\">m</a></span>()</code></th>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   139
                + "<td class=\"colLast\">\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   140
                + "<div class=\"block\">A hider method</div>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   141
                + "</td>\n",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   142
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   143
                "<h4>staticMethod</h4>\n"
51127
c2e676c2cf7b 8207190: JDK 11 javadoc generates bad code example
pmuthuswamy
parents: 50810
diff changeset
   144
                + "<pre class=\"methodSignature\">public static&nbsp;void&nbsp;staticMethod()</pre>\n"
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   145
                + "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   146
                + "Description copied from interface:&nbsp;<code>"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   147
                + "<a href=\"InterfaceWithStaticMembers.html#staticMethod()\">"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   148
                + "InterfaceWithStaticMembers</a></code></span></div>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   149
                + "<div class=\"block\">A static method</div>\n");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   150
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   151
        checkOutput("pkg/ClassWithStaticMembers.InnerClass.html", true,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   152
                "<pre>public static class <span class=\"typeNameLabel\">"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   153
                + "ClassWithStaticMembers.InnerClass</span>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   154
                + "extends java.lang.Object</pre>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   155
                + "<div class=\"block\">A hider inner class</div>");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   156
    }
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   157
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   158
    @Test
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   159
    void test_html4() {
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   160
        javadoc("-d", "out-html4",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   161
                "-html4",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   162
                "-sourcepath", testSrc,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   163
                "pkg");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   164
        checkExit(Exit.OK);
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   165
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   166
        checkOutput("pkg/Child.html", true,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   167
                //Make sure "Specified By" has substituted type parameters.
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   168
                "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   169
                + "<dd><code><a href=\"Interface.html#method--\">method</a>"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   170
                + "</code>&nbsp;in interface&nbsp;<code>"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   171
                + "<a href=\"Interface.html\" title=\"interface in pkg\">"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   172
                + "Interface</a>&lt;<a href=\"Child.html\" title=\"type parameter in Child\">"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   173
                + "CE</a>&gt;</code></dd>",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   174
                //Make sure "Overrides" has substituted type parameters.
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   175
                "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   176
                + "<dd><code><a href=\"Parent.html#method--\">method</a>"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   177
                + "</code>&nbsp;in class&nbsp;<code><a href=\"Parent.html\" "
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   178
                + "title=\"class in pkg\">Parent</a>&lt;<a href=\"Child.html\" "
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   179
                + "title=\"type parameter in Child\">CE</a>&gt;</code></dd>");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   180
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   181
        checkOutput("pkg/ClassWithStaticMembers.html", true,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   182
                "<td class=\"colFirst\"><code>static void</code></td>\n"
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   183
                + "<th class=\"colSecond\" scope=\"row\"><code><span class=\"memberNameLink\">"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   184
                + "<a href=\"#m--\">m</a></span>()</code></th>\n"
47311
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   185
                + "<td class=\"colLast\">\n"
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   186
                + "<div class=\"block\">A hider method</div>\n"
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   187
                + "</td>\n",
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   188
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   189
                "<h4>staticMethod</h4>\n"
51127
c2e676c2cf7b 8207190: JDK 11 javadoc generates bad code example
pmuthuswamy
parents: 50810
diff changeset
   190
                + "<pre class=\"methodSignature\">public static&nbsp;void&nbsp;staticMethod()</pre>\n"
47311
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   191
                + "<div class=\"block\"><span class=\"descfrmTypeLabel\">"
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   192
                + "Description copied from interface:&nbsp;<code>"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   193
                + "<a href=\"InterfaceWithStaticMembers.html#staticMethod--\">"
47311
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   194
                + "InterfaceWithStaticMembers</a></code></span></div>\n"
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   195
                + "<div class=\"block\">A static method</div>\n");
ff631a3cadbc 8186703: javadoc needs a test to verify member hiding
ksrini
parents: 47284
diff changeset
   196
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   197
        checkOutput("pkg/Interface.html", false,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   198
                "public int&nbsp;method()");
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   199
    }
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   200
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   201
    @Test
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   202
    void test1() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   203
        javadoc("-d", "out-1",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   204
                "-sourcepath", testSrc,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   205
                "pkg1");
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   206
        checkExit(Exit.OK);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   207
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   208
        checkOutput("pkg1/Child.html", true,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   209
            // Ensure the correct Overrides in the inheritance hierarchy is reported
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   210
            "<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
49139
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   211
            "<dd><code><a href=\"GrandParent.html#method1()\">method1</a></code>" +
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   212
            "&nbsp;in class&nbsp;" +
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   213
            "<code><a href=\"GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   214
            "&lt;<a href=\"Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   215
    }
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   216
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   217
    @Test
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   218
    void test1_html4() {
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   219
        javadoc("-d", "out-1-html4",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   220
                "-html4",
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   221
                "-sourcepath", testSrc,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   222
                "pkg1");
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   223
        checkExit(Exit.OK);
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   224
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   225
        checkOutput("pkg1/Child.html", true,
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   226
            // Ensure the correct Overrides in the inheritance hierarchy is reported
771616d26ca1 8182765: HTML5 must be the default javadoc codegen mode in the near future
bpatel
parents: 48654
diff changeset
   227
            "<span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n" +
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   228
            "<dd><code><a href=\"GrandParent.html#method1--\">method1</a></code>" +
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   229
            "&nbsp;in class&nbsp;" +
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   230
            "<code><a href=\"GrandParent.html\" title=\"class in pkg1\">GrandParent</a>" +
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   231
            "&lt;<a href=\"Child.html\" title=\"type parameter in Child\">CE</a>&gt;</code>");
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   232
    }
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   233
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   234
    @Test
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   235
    void test2() {
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   236
        javadoc("-d", "out-2",
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   237
                "-sourcepath", testSrc,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   238
                "pkg2");
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   239
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   240
        checkExit(Exit.OK);
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   241
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   242
        checkOutput("pkg2/Spliterator.OfDouble.html", true,
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   243
            // Ensure the correct type parameters are displayed correctly
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   244
            "<h3>Nested classes/interfaces inherited from interface&nbsp;pkg2."
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   245
            + "<a href=\"Spliterator.html\" title=\"interface in pkg2\">Spliterator</a></h3>\n"
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   246
            + "<code><a href=\"Spliterator.OfDouble.html\" title=\"interface in pkg2\">"
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   247
            + "Spliterator.OfDouble</a>, <a href=\"Spliterator.OfInt.html\" "
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   248
            + "title=\"interface in pkg2\">Spliterator.OfInt</a>&lt;"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   249
            + "<a href=\"Spliterator.OfInt.html\" title=\"type parameter in Spliterator.OfInt\">"
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   250
            + "Integer</a>&gt;, <a href=\"Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   251
            + "Spliterator.OfPrimitive</a>&lt;<a href=\"Spliterator.OfPrimitive.html\" "
50810
0358dad944c7 8187288: bad (no) wrapping for modifier and type column
pmuthuswamy
parents: 49139
diff changeset
   252
            + "title=\"type parameter in Spliterator.OfPrimitive\">T</a>,&#8203;<a href=\"Spliterator.OfPrimitive.html\" "
0358dad944c7 8187288: bad (no) wrapping for modifier and type column
pmuthuswamy
parents: 49139
diff changeset
   253
            + "title=\"type parameter in Spliterator.OfPrimitive\">T_CONS</a>,&#8203;"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   254
            + "<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   255
            + "T_SPLITR</a> extends <a href=\"Spliterator.OfPrimitive.html\" title=\"interface in pkg2\">"
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   256
            + "Spliterator.OfPrimitive</a>&lt;<a href=\"Spliterator.OfPrimitive.html\" "
50810
0358dad944c7 8187288: bad (no) wrapping for modifier and type column
pmuthuswamy
parents: 49139
diff changeset
   257
            + "title=\"type parameter in Spliterator.OfPrimitive\">T</a>,&#8203;"
48654
36f58bd6269f 8195796: Reduce the size of relative URLs in generated docs
jjg
parents: 47311
diff changeset
   258
            + "<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
50810
0358dad944c7 8187288: bad (no) wrapping for modifier and type column
pmuthuswamy
parents: 49139
diff changeset
   259
            + "T_CONS</a>,&#8203;<a href=\"Spliterator.OfPrimitive.html\" title=\"type parameter in Spliterator.OfPrimitive\">"
35426
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   260
            + "T_SPLITR</a>&gt;&gt;</code>");
374342e56a56 8035473: [javadoc] Revamp the existing Doclet APIs
ksrini
parents: 30730
diff changeset
   261
    }
10
06bc494ca11e Initial load
duke
parents:
diff changeset
   262
}