TestAbstractMethod.java revision 2375:adf34d48dc1f
1/* 2 * Copyright (c) 2012, 2014, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24/* 25 * @test 26 * @bug 8004891 27 * @summary Make sure that the abstract method is identified correctly 28 * if the abstract modifier is present explicitly or implicitly. 29 * @author bpatel 30 * @library ../lib/ 31 * @build JavadocTester TestAbstractMethod 32 * @run main TestAbstractMethod 33 */ 34 35public class TestAbstractMethod extends JavadocTester { 36 37 //Test information. 38 private static final String BUG_ID = "8004891"; 39 40 //Javadoc arguments. 41 private static final String[] ARGS = new String[] { 42 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg" 43 }; 44 45 //Input for string search tests. 46 private static final String[][] TEST = { 47 {BUG_ID + "/pkg/A.html", 48 "<td class=\"colFirst\"><code>default void</code></td>"}, 49 {BUG_ID + "/pkg/A.html", 50 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + 51 "All Methods</span><span class=\"tabEnd\"> </span></span>" + 52 "<span id=\"t2\" class=\"tableTab\"><span>" + 53 "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + 54 "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + 55 "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" + 56 "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" + 57 "</span><span id=\"t5\" class=\"tableTab\"><span>" + 58 "<a href=\"javascript:show(16);\">Default Methods</a></span>" + 59 "<span class=\"tabEnd\"> </span></span></caption>"}, 60 {BUG_ID + "/pkg/B.html", 61 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + 62 "All Methods</span><span class=\"tabEnd\"> </span></span>" + 63 "<span id=\"t2\" class=\"tableTab\"><span>" + 64 "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + 65 "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " + 66 "class=\"tableTab\"><span><a href=\"javascript:show(4);\">Abstract " + 67 "Methods</a></span><span class=\"tabEnd\"> </span></span>" + 68 "<span id=\"t4\" class=\"tableTab\"><span>" + 69 "<a href=\"javascript:show(8);\">Concrete Methods</a></span>" + 70 "<span class=\"tabEnd\"> </span></span></caption>"}, 71 {BUG_ID + "/pkg/B.html", 72 "<td class=\"colFirst\"><code>abstract void</code></td>"}, 73 {BUG_ID + "/pkg/C.html", 74 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" + 75 "All Methods</span><span class=\"tabEnd\"> </span></span>" + 76 "<span id=\"t2\" class=\"tableTab\"><span>" + 77 "<a href=\"javascript:show(2);\">Instance Methods</a></span>" + 78 "<span class=\"tabEnd\"> </span></span>" + 79 "<span id=\"t5\" class=\"tableTab\"><span>" + 80 "<a href=\"javascript:show(16);\">Default Methods</a></span>" + 81 "<span class=\"tabEnd\"> </span></span></caption>"}, 82 {BUG_ID + "/pkg/C.html", 83 "<td class=\"colFirst\"><code>default void</code></td>"} 84 }; 85 private static final String[][] NEGATED_TEST = { 86 {BUG_ID + "/pkg/A.html", 87 "<td class=\"colFirst\"><code>abstract void</code></td>"}, 88 {BUG_ID + "/pkg/B.html", 89 "<span><a href=\"javascript:show(16);\">Default Methods</a></span>" + 90 "<span class=\"tabEnd\"> </span>"}, 91 {BUG_ID + "/pkg/B.html", 92 "<td class=\"colFirst\"><code>default void</code></td>"}, 93 {BUG_ID + "/pkg/C.html", 94 "<span><a href=\"javascript:show(4);\">Abstract Methods</a></span>" + 95 "<span class=\"tabEnd\"> </span>"} 96 }; 97 98 /** 99 * The entry point of the test. 100 * @param args the array of command line arguments. 101 */ 102 public static void main(String[] args) { 103 TestAbstractMethod tester = new TestAbstractMethod(); 104 tester.run(ARGS, TEST, NEGATED_TEST); 105 tester.printSummary(); 106 } 107 108 /** 109 * {@inheritDoc} 110 */ 111 public String getBugId() { 112 return BUG_ID; 113 } 114 115 /** 116 * {@inheritDoc} 117 */ 118 public String getBugName() { 119 return getClass().getName(); 120 } 121} 122