Path: blob/master/test/langtools/jdk/javadoc/doclet/testConstructors/TestConstructors.java
40971 views
/*1* Copyright (c) 2013, 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 8025524 8031625 8081854 8175200 8186332 818276526* @summary Test for constructor name which should be a non-qualified name.27* @library ../../lib28* @modules jdk.javadoc/jdk.javadoc.internal.tool29* @build javadoc.tester.*30* @run main TestConstructors31*/3233import javadoc.tester.JavadocTester;3435public class TestConstructors extends JavadocTester {3637public static void main(String... args) throws Exception {38TestConstructors tester = new TestConstructors();39tester.runTests();40}4142@Test43public void test() {44javadoc("-d", "out",45"-sourcepath", testSrc,46"pkg1");47checkExit(Exit.OK);4849checkOutput("pkg1/Outer.html", true,50"""51<dt>See Also:</dt>52<dd>53<ul class="see-list">54<li><a href="Outer.Inner.html#%3Cinit%3E()"><code>Inner()</code></a></li>55<li><a href="Outer.Inner.html#%3Cinit%3E(int)"><code>Inner(int)</code></a></li>56<li><a href="Outer.Inner.NestedInner.html#%3Cinit%3E()"><code>NestedInner()</code></a></li>57<li><a href="Outer.Inner.NestedInner.html#%3Cinit%3E(int)"><code>NestedInner(int)</code></a></li>58<li><a href="#%3Cinit%3E()"><code>Outer()</code></a></li>59<li><a href="#%3Cinit%3E(int)"><code>Outer(int)</code></a></li>60</ul>61</dd>""",62"""63Link: <a href="Outer.Inner.html#%3Cinit%3E()"><code>Inner()</code></a>, <a href=\64"#%3Cinit%3E(int)"><code>Outer(int)</code></a>, <a href="Outer.Inner.NestedInner\65.html#%3Cinit%3E(int)"><code>NestedInner(int)</code></a>""",66"""67<a href="#%3Cinit%3E()" class="member-name-link">Outer</a>()""",68"""69<section class="detail" id="<init>()">""",70"""71<a href="#%3Cinit%3E(int)" class="member-name-link">Outer</a><wbr>(int i)""",72"""73<section class="detail" id="<init>(int)">""");7475checkOutput("pkg1/Outer.Inner.html", true,76"""77<a href="#%3Cinit%3E()" class="member-name-link">Inner</a>()""",78"""79<section class="detail" id="<init>()">""",80"""81<a href="#%3Cinit%3E(int)" class="member-name-link">Inner</a><wbr>(int i)""",82"""83<section class="detail" id="<init>(int)">""");8485checkOutput("pkg1/Outer.Inner.NestedInner.html", true,86"""87<a href="#%3Cinit%3E()" class="member-name-link">NestedInner</a>()""",88"""89<section class="detail" id="<init>()">""",90"""91<a href="#%3Cinit%3E(int)" class="member-name-link">NestedInner</a><wbr>(int i)""",92"""93<section class="detail" id="<init>(int)">""");9495checkOutput("pkg1/Outer.Inner.html", false,96"Outer.Inner()",97"Outer.Inner(int)");9899checkOutput("pkg1/Outer.Inner.NestedInner.html", false,100"Outer.Inner.NestedInner()",101"Outer.Inner.NestedInner(int)");102103checkOutput("pkg1/Outer.html", false,104"""105<a href="Outer.Inner.html#Outer.Inner()"><code>Outer.Inner()</code></a>""",106"""107<a href="Outer.Inner.html#Outer.Inner(int)"><code>Outer.Inner(int)</code></a>""",108"""109<a href="Outer.Inner.NestedInner.html#Outer.Inner.NestedInner()"><code>Outer.Inner.NestedInner()</code></a>""",110"""111<a href="Outer.Inner.NestedInner.html#Outer.Inner.NestedInner(int)"><code>Outer.Inner.NestedInner(int)</code></a>""");112}113}114115116