Path: blob/master/test/langtools/jdk/javadoc/doclet/testAbstractMethod/TestAbstractMethod.java
40971 views
/*1* Copyright (c) 2012, 2021, 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 8004891 818420526* @summary Make sure that the abstract method is identified correctly27* if the abstract modifier is present explicitly or implicitly.28* @library ../../lib29* @modules jdk.javadoc/jdk.javadoc.internal.tool30* @build javadoc.tester.*31* @run main TestAbstractMethod32*/3334import javadoc.tester.JavadocTester;3536public class TestAbstractMethod extends JavadocTester {3738public static void main(String... args) throws Exception {39TestAbstractMethod tester = new TestAbstractMethod();40tester.runTests();41}4243@Test44public void test() {45javadoc("-d", "out",46"-sourcepath", testSrc,47"pkg");48checkExit(Exit.OK);4950checkOutput("pkg/A.html", true,51"""52<div class="col-first even-row-color method-summary-table method-summary-table-t\53ab2 method-summary-table-tab5"><code>default void</code></div>""",54"""55<div class="table-tabs" role="tablist" aria-orientation="horizontal">\56<button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-cont\57rols="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" o\58nclick="show('method-summary-table', 'method-summary-table', 3)" class="active-t\59able-tab">All Methods</button>\60<button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-con\61trols="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)"\62onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="t\63able-tab">Instance Methods</button>\64<button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-con\65trols="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)"\66onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="t\67able-tab">Abstract Methods</button>\68<button id="method-summary-table-tab5" role="tab" aria-selected="false" aria-con\69trols="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)"\70onclick="show('method-summary-table', 'method-summary-table-tab5', 3)" class="t\71able-tab">Default Methods</button>\72</div>""");7374checkOutput("pkg/B.html", true,75"""76<div class="table-tabs" role="tablist" aria-orientation="horizontal">\77<button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-cont\78rols="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" o\79nclick="show('method-summary-table', 'method-summary-table', 3)" class="active-t\80able-tab">All Methods</button>\81<button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-con\82trols="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)"\83onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="t\84able-tab">Instance Methods</button>\85<button id="method-summary-table-tab3" role="tab" aria-selected="false" aria-con\86trols="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)"\87onclick="show('method-summary-table', 'method-summary-table-tab3', 3)" class="t\88able-tab">Abstract Methods</button>\89<button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-con\90trols="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)"\91onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="t\92able-tab">Concrete Methods</button>\93</div>""",94"""95<div class="col-first even-row-color method-summary-table method-summary-table-t\96ab2 method-summary-table-tab3"><code>abstract void</code></div>""");9798checkOutput("pkg/C.html", true,99"""100<div class="table-tabs" role="tablist" aria-orientation="horizontal">\101<button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-cont\102rols="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" o\103nclick="show('method-summary-table', 'method-summary-table', 3)" class="active-t\104able-tab">All Methods</button>\105<button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-con\106trols="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)"\107onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="t\108able-tab">Instance Methods</button>\109<button id="method-summary-table-tab5" role="tab" aria-selected="false" aria-con\110trols="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)"\111onclick="show('method-summary-table', 'method-summary-table-tab5', 3)" class="t\112able-tab">Default Methods</button>\113</div>""");114115checkOutput("pkg/A.html", false,116"""117<div class="col-first even-row-color method-summary-table-tab2 method-summary-ta\118ble method-summary-table-tab3"><code>abstract void</code></div>""");119120checkOutput("pkg/B.html", false,121"""122Default Methods""",123"""124<div class="col-first even-row-color method-summary-table-tab2 method-summary-ta\125ble-tab5 method-summary-table"><code>default void</code></div>""");126127checkOutput("pkg/C.html", false,128"""129Abstract Methods""");130}131}132133134