Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/test/com/sun/javadoc/testAbstractMethod/TestAbstractMethod.java
47525 views
/*1* Copyright (c) 2012, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 800489126* @summary Make sure that the abstract method is identified correctly27* if the abstract modifier is present explicitly or implicitly.28* @author bpatel29* @library ../lib/30* @build JavadocTester TestAbstractMethod31* @run main TestAbstractMethod32*/3334public class TestAbstractMethod extends JavadocTester {3536//Test information.37private static final String BUG_ID = "8004891";3839//Javadoc arguments.40private static final String[] ARGS = new String[] {41"-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"42};4344//Input for string search tests.45private static final String[][] TEST = {46{BUG_ID + FS + "pkg" + FS + "A.html",47"<td class=\"colFirst\"><code>default void</code></td>"},48{BUG_ID + FS + "pkg" + FS + "A.html",49"<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +50"All Methods</span><span class=\"tabEnd\"> </span></span>" +51"<span id=\"t2\" class=\"tableTab\"><span>" +52"<a href=\"javascript:show(2);\">Instance Methods</a></span>" +53"<span class=\"tabEnd\"> </span></span><span id=\"t3\" " +54"class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +55"Abstract Methods</a></span><span class=\"tabEnd\"> </span>" +56"</span><span id=\"t5\" class=\"tableTab\"><span>" +57"<a href=\"javascript:show(16);\">Default Methods</a></span>" +58"<span class=\"tabEnd\"> </span></span></caption>"},59{BUG_ID + FS + "pkg" + FS + "B.html",60"<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +61"All Methods</span><span class=\"tabEnd\"> </span></span>" +62"<span id=\"t2\" class=\"tableTab\"><span>" +63"<a href=\"javascript:show(2);\">Instance Methods</a></span>" +64"<span class=\"tabEnd\"> </span></span><span id=\"t3\" " +65"class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract " +66"Methods</a></span><span class=\"tabEnd\"> </span></span>" +67"<span id=\"t4\" class=\"tableTab\"><span>" +68"<a href=\"javascript:show(8);\">Concrete Methods</a></span>" +69"<span class=\"tabEnd\"> </span></span></caption>"},70{BUG_ID + FS + "pkg" + FS + "B.html",71"<td class=\"colFirst\"><code>abstract void</code></td>"},72{BUG_ID + FS + "pkg" + FS + "C.html",73"<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +74"All Methods</span><span class=\"tabEnd\"> </span></span>" +75"<span id=\"t2\" class=\"tableTab\"><span>" +76"<a href=\"javascript:show(2);\">Instance Methods</a></span>" +77"<span class=\"tabEnd\"> </span></span>" +78"<span id=\"t5\" class=\"tableTab\"><span>" +79"<a href=\"javascript:show(16);\">Default Methods</a></span>" +80"<span class=\"tabEnd\"> </span></span></caption>"},81{BUG_ID + FS + "pkg" + FS + "C.html",82"<td class=\"colFirst\"><code>default void</code></td>"}83};84private static final String[][] NEGATED_TEST = {85{BUG_ID + FS + "pkg" + FS + "A.html",86"<td class=\"colFirst\"><code>abstract void</code></td>"},87{BUG_ID + FS + "pkg" + FS + "B.html",88"<span><a href=\"javascript:show(16);\">Default Methods</a></span>" +89"<span class=\"tabEnd\"> </span>"},90{BUG_ID + FS + "pkg" + FS + "B.html",91"<td class=\"colFirst\"><code>default void</code></td>"},92{BUG_ID + FS + "pkg" + FS + "C.html",93"<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" +94"<span class=\"tabEnd\"> </span>"}95};9697/**98* The entry point of the test.99* @param args the array of command line arguments.100*/101public static void main(String[] args) {102TestAbstractMethod tester = new TestAbstractMethod();103run(tester, ARGS, TEST, NEGATED_TEST);104tester.printSummary();105}106107/**108* {@inheritDoc}109*/110public String getBugId() {111return BUG_ID;112}113114/**115* {@inheritDoc}116*/117public String getBugName() {118return getClass().getName();119}120}121122123