1 /* 2 * Copyright (c) 2012, 2015, 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 8002304 8024096 27 * @summary Test for various method types in the method summary table 28 * @author Bhavesh Patel 29 * @library ../lib 30 * @modules jdk.javadoc 31 * @build JavadocTester 32 * @run main TestMethodTypes 33 */ 34 35 public class TestMethodTypes extends JavadocTester { 36 37 public static void main(String... args) throws Exception { 38 TestMethodTypes tester = new TestMethodTypes(); 39 tester.runTests(); 40 } 41 42 @Test 43 void test() { 44 javadoc("-d", "out", 45 "-sourcepath", testSrc, 46 "pkg1"); 47 checkExit(Exit.OK); 48 49 checkOutput("pkg1/A.html", true, 50 "var methods = {", 51 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " 52 + "Methods</span><span class=\"tabEnd\"> </span></span>" 53 + "<span id=\"t1\" class=\"tableTab\"><span><a href=\"javascript:show(1);\">" 54 + "Static Methods</a></span><span class=\"tabEnd\"> </span></span>" 55 + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" 56 + "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" 57 + "<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" 58 + "Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" 59 + "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" 60 + "Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" 61 + "</caption>", 62 "<tr id=\"i0\" class=\"altColor\">"); 63 64 checkOutput("pkg1/B.html", true, 65 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " 66 + "Methods</span><span class=\"tabEnd\"> </span></span>" 67 + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" 68 + "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" 69 + "<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" 70 + "Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>" 71 + "</caption>"); 72 73 checkOutput("pkg1/D.html", true, 74 "var methods = {", 75 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>All " 76 + "Methods</span><span class=\"tabEnd\"> </span></span>" 77 + "<span id=\"t2\" class=\"tableTab\"><span><a href=\"javascript:show(2);\">" 78 + "Instance Methods</a></span><span class=\"tabEnd\"> </span></span>" 79 + "<span id=\"t3\" class=\"tableTab\"><span><a href=\"javascript:show(4);\">" 80 + "Abstract Methods</a></span><span class=\"tabEnd\"> </span></span>" 81 + "<span id=\"t4\" class=\"tableTab\"><span><a href=\"javascript:show(8);\">" 82 + "Concrete Methods</a></span><span class=\"tabEnd\"> </span></span>" 83 + "<span id=\"t6\" class=\"tableTab\"><span><a href=\"javascript:show(32);\">" 84 + "Deprecated Methods</a></span><span class=\"tabEnd\"> </span></span>" 85 + "</caption>", 86 "<tr id=\"i0\" class=\"altColor\">"); 87 88 checkOutput("pkg1/A.html", false, 89 "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" 90 + "</caption>"); 91 92 checkOutput("pkg1/B.html", false, 93 "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" 94 + "</caption>"); 95 96 checkOutput("pkg1/D.html", false, 97 "<caption><span>Methods</span><span class=\"tabEnd\"> </span>" 98 + "</caption>"); 99 } 100 }