langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java
author hannesw
Tue, 22 Mar 2016 14:23:16 +0100
changeset 36690 06b714373aa4
parent 30730 d3ce7619db2c
permissions -rw-r--r--
8151810: for-in iteration does not provide per-iteration scope Reviewed-by: attila, lagergren
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
     1
/*
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 24399
diff changeset
     2
 * Copyright (c) 2012, 2015, Oracle and/or its affiliates. All rights reserved.
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
     4
 *
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
     8
 *
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    13
 * accompanied this code).
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    14
 *
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    18
 *
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    21
 * questions.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    22
 */
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    23
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    24
/*
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    25
 * @test
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    26
 * @bug      8004891
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    27
 * @summary  Make sure that the abstract method is identified correctly
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    28
 *           if the abstract modifier is present explicitly or implicitly.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    29
 * @author   bpatel
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    30
 * @library  ../lib
30730
d3ce7619db2c 8076543: Add @modules as needed to the langtools tests
akulyakh
parents: 24399
diff changeset
    31
 * @modules jdk.javadoc
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    32
 * @build    JavadocTester
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    33
 * @run main TestAbstractMethod
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    34
 */
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    35
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    36
public class TestAbstractMethod extends JavadocTester {
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    37
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    38
    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
    39
        TestAbstractMethod tester = new TestAbstractMethod();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    40
        tester.runTests();
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
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    43
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    44
    void test() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    45
        javadoc("-d", "out",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    47
                "pkg");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    48
        checkExit(Exit.OK);
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    49
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    50
        checkOutput("pkg/A.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    51
                "<td class=\"colFirst\"><code>default void</code></td>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    52
                "<caption><span id=\"t0\" class=\"activeTableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    53
                + "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    54
                + "<span id=\"t2\" class=\"tableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    55
                + "<a href=\"javascript:show(2);\">Instance Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    56
                + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
                + "class=\"tableTab\"><span><a href=\"javascript:show(4);\">"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    58
                + "Abstract Methods</a></span><span class=\"tabEnd\">&nbsp;</span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    59
                + "</span><span id=\"t5\" class=\"tableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    60
                + "<a href=\"javascript:show(16);\">Default Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    61
                + "<span class=\"tabEnd\">&nbsp;</span></span></caption>");
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    62
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    63
        checkOutput("pkg/B.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    64
                "<caption><span id=\"t0\" class=\"activeTableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    65
                + "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    66
                + "<span id=\"t2\" class=\"tableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    67
                + "<a href=\"javascript:show(2);\">Instance Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    68
                + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    69
                + "class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    70
                + "Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    71
                + "<span id=\"t4\" class=\"tableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    72
                + "<a href=\"javascript:show(8);\">Concrete Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    73
                + "<span class=\"tabEnd\">&nbsp;</span></span></caption>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    74
                "<td class=\"colFirst\"><code>abstract void</code></td>");
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    75
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    76
        checkOutput("pkg/C.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    77
                "<caption><span id=\"t0\" class=\"activeTableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    78
                + "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    79
                + "<span id=\"t2\" class=\"tableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    80
                + "<a href=\"javascript:show(2);\">Instance Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    81
                + "<span class=\"tabEnd\">&nbsp;</span></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    82
                + "<span id=\"t5\" class=\"tableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    83
                + "<a href=\"javascript:show(16);\">Default Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    84
                + "<span class=\"tabEnd\">&nbsp;</span></span></caption>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    85
                "<td class=\"colFirst\"><code>default void</code></td>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    86
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    87
        checkOutput("pkg/A.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    88
                "<td class=\"colFirst\"><code>abstract void</code></td>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    89
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    90
        checkOutput("pkg/B.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    91
                "<span><a href=\"javascript:show(16);\">Default Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    92
                + "<span class=\"tabEnd\">&nbsp;</span>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    93
                "<td class=\"colFirst\"><code>default void</code></td>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    94
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    95
        checkOutput("pkg/C.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    96
                "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    97
                + "<span class=\"tabEnd\">&nbsp;</span>");
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    98
    }
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    99
}