langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java
author jjg
Wed, 16 Apr 2014 16:17:09 -0700
changeset 23971 f5ff1f5a8dee
parent 22448 a85fbad9d687
child 24065 fc4022e50129
permissions -rw-r--r--
8031649: Clean up javadoc tests Reviewed-by: jjg Contributed-by: neil.toda@oracle.com
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
/*
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
     2
 * Copyright (c) 2012, 2014, 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
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    30
 * @library  ../lib/
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    31
 * @build    JavadocTester TestAbstractMethod
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    32
 * @run main TestAbstractMethod
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    33
 */
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
public class TestAbstractMethod extends JavadocTester {
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    36
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    37
    //Test information.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    38
    private static final String BUG_ID = "8004891";
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    39
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    40
    //Javadoc arguments.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    41
    private static final String[] ARGS = new String[] {
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    42
        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    43
    };
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    44
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    45
    //Input for string search tests.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    46
    private static final String[][] TEST = {
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    47
        {BUG_ID + "/pkg/A.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    48
            "<td class=\"colFirst\"><code>default void</code></td>"},
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    49
        {BUG_ID + "/pkg/A.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    50
            "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    51
            "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    52
            "<span id=\"t2\" class=\"tableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    53
            "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    54
            "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" " +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    55
            "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    56
            "Abstract Methods</a></span><span class=\"tabEnd\">&nbsp;</span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    57
            "</span><span id=\"t5\" class=\"tableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    58
            "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    59
            "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    60
        {BUG_ID + "/pkg/B.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    61
            "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    62
            "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    63
            "<span id=\"t2\" class=\"tableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    64
            "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    65
            "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" " +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    66
            "class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract " +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    67
            "Methods</a></span><span class=\"tabEnd\">&nbsp;</span></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    68
            "<span id=\"t4\" class=\"tableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    69
            "<a href=\"javascript:show(8);\">Concrete Methods</a></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    70
            "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    71
        {BUG_ID + "/pkg/B.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    72
            "<td class=\"colFirst\"><code>abstract void</code></td>"},
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    73
        {BUG_ID + "/pkg/C.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    74
            "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    75
            "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    76
            "<span id=\"t2\" class=\"tableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    77
            "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    78
            "<span class=\"tabEnd\">&nbsp;</span></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    79
            "<span id=\"t5\" class=\"tableTab\"><span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    80
            "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    81
            "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    82
        {BUG_ID + "/pkg/C.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    83
            "<td class=\"colFirst\"><code>default void</code></td>"}
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    84
    };
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    85
    private static final String[][] NEGATED_TEST = {
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    86
        {BUG_ID + "/pkg/A.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    87
            "<td class=\"colFirst\"><code>abstract void</code></td>"},
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    88
        {BUG_ID + "/pkg/B.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    89
            "<span><a href=\"javascript:show(16);\">Default Methods</a></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    90
            "<span class=\"tabEnd\">&nbsp;</span>"},
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    91
        {BUG_ID + "/pkg/B.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    92
            "<td class=\"colFirst\"><code>default void</code></td>"},
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 22448
diff changeset
    93
        {BUG_ID + "/pkg/C.html",
15034
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    94
            "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" +
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    95
            "<span class=\"tabEnd\">&nbsp;</span>"}
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    96
    };
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
    97
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
     * The entry point of the test.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   100
     * @param args the array of command line arguments.
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   101
     */
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   102
    public static void main(String[] args) {
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   103
        TestAbstractMethod tester = new TestAbstractMethod();
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   104
        run(tester, ARGS, TEST, NEGATED_TEST);
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   105
        tester.printSummary();
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   106
    }
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   107
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   108
    /**
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   109
     * {@inheritDoc}
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   110
     */
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   111
    public String getBugId() {
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   112
        return BUG_ID;
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   113
    }
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   114
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   115
    /**
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   116
     * {@inheritDoc}
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   117
     */
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   118
    public String getBugName() {
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   119
        return getClass().getName();
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   120
    }
b7c791bc4526 8004891: Check for abstract method in javadoc does not conform to the language model
bpatel
parents:
diff changeset
   121
}