langtools/test/com/sun/javadoc/testConstructors/TestConstructors.java
author bpatel
Tue, 23 Jun 2015 15:41:05 -0700
changeset 31297 86fe1414f12c
parent 30730 d3ce7619db2c
permissions -rw-r--r--
8081854: Javadoc should generate named anchors for HTML4 output Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
21717
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
     1
/*
29957
7740f9657f56 8072945: Javadoc should generate valid and compliant HTML5 output
bpatel
parents: 24399
diff changeset
     2
 * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved.
21717
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
     4
 *
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
     8
 *
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    13
 * accompanied this code).
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    14
 *
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    18
 *
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    21
 * questions.
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    22
 */
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    23
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    24
/*
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    25
 * @test
31297
86fe1414f12c 8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents: 30730
diff changeset
    26
 * @bug 8025524 8031625 8081854
21717
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    27
 * @summary Test for constructor name which should be a non-qualified name.
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    28
 * @author Bhavesh Patel
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    29
 * @library ../lib
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 29957
diff changeset
    30
 * @modules jdk.javadoc
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    31
 * @build JavadocTester
21717
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    32
 * @run main TestConstructors
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    33
 */
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    34
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    35
public class TestConstructors extends JavadocTester {
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    36
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    37
    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
    38
        TestConstructors tester = new TestConstructors();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    39
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    40
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    41
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    42
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    43
    void test() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    44
        javadoc("-d", "out",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    45
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
                "pkg1");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    47
        checkExit(Exit.OK);
21717
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    48
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    49
        checkOutput("pkg1/Outer.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    50
                "<dt><span class=\"seeLabel\">See Also:</span></dt>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    51
                + "<dd><a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, \n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    52
                + "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\"><code>Inner(int)</code></a>, \n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    53
                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\"><code>NestedInner()</code></a>, \n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    54
                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>NestedInner(int)</code></a>, \n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    55
                + "<a href=\"../pkg1/Outer.html#Outer--\"><code>Outer()</code></a>, \n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    56
                + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
                "Link: <a href=\"../pkg1/Outer.Inner.html#Inner--\"><code>Inner()</code></a>, "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    58
                + "<a href=\"../pkg1/Outer.html#Outer-int-\"><code>Outer(int)</code></a>, "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    59
                + "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\"><code>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    60
                + "NestedInner(int)</code></a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    61
                "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()",
31297
86fe1414f12c 8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents: 30730
diff changeset
    62
                "<a name=\"Outer--\">",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    63
                "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>(int&nbsp;i)",
31297
86fe1414f12c 8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents: 30730
diff changeset
    64
                "<a name=\"Outer-int-\">");
21717
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    65
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    66
        checkOutput("pkg1/Outer.Inner.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    67
                "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()",
31297
86fe1414f12c 8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents: 30730
diff changeset
    68
                "<a name=\"Inner--\">",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    69
                "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>(int&nbsp;i)",
31297
86fe1414f12c 8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents: 30730
diff changeset
    70
                "<a name=\"Inner-int-\">");
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    71
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    72
        checkOutput("pkg1/Outer.Inner.NestedInner.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    73
                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()",
31297
86fe1414f12c 8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents: 30730
diff changeset
    74
                "<a name=\"NestedInner--\">",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    75
                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>(int&nbsp;i)",
31297
86fe1414f12c 8081854: Javadoc should generate named anchors for HTML4 output
bpatel
parents: 30730
diff changeset
    76
                "<a name=\"NestedInner-int-\">");
21717
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
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("pkg1/Outer.Inner.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    79
                "Outer.Inner--",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    80
                "Outer.Inner-int-");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    81
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    82
        checkOutput("pkg1/Outer.Inner.NestedInner.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    83
                "Outer.Inner.NestedInner--",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    84
                "Outer.Inner.NestedInner-int-");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    85
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    86
        checkOutput("pkg1/Outer.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    87
                "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner--\"><code>Outer.Inner()</code></a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    88
                "<a href=\"../pkg1/Outer.Inner.html#Outer.Inner-int-\"><code>Outer.Inner(int)</code></a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    89
                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner--\"><code>Outer.Inner.NestedInner()</code></a>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    90
                "<a href=\"../pkg1/Outer.Inner.NestedInner.html#Outer.Inner.NestedInner-int-\"><code>Outer.Inner.NestedInner(int)</code></a>");
21717
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    91
    }
11ba59c9bbb5 8025524: javadoc does not correctly locate constructors for nested classes
bpatel
parents:
diff changeset
    92
}