|
1 /* |
|
2 * Copyright (c) 2013, 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 8025524 |
|
27 * @summary Test for constructor name which should be a non-qualified name. |
|
28 * @author Bhavesh Patel |
|
29 * @library ../lib/ |
|
30 * @build JavadocTester TestConstructors |
|
31 * @run main TestConstructors |
|
32 */ |
|
33 |
|
34 public class TestConstructors extends JavadocTester { |
|
35 |
|
36 private static final String BUG_ID = "8025524"; |
|
37 |
|
38 //Input for string search tests. |
|
39 private static final String[][] TEST = { |
|
40 {BUG_ID + FS + "pkg1" + FS + "Outer.html", |
|
41 "<a href=\"../pkg1/Outer.html#Outer--\">Outer</a></span>()" |
|
42 }, |
|
43 {BUG_ID + FS + "pkg1" + FS + "Outer.html", |
|
44 "<a name=\"Outer--\">" |
|
45 }, |
|
46 {BUG_ID + FS + "pkg1" + FS + "Outer.html", |
|
47 "<a href=\"../pkg1/Outer.html#Outer-int-\">Outer</a></span>(int i)" |
|
48 }, |
|
49 {BUG_ID + FS + "pkg1" + FS + "Outer.html", |
|
50 "<a name=\"Outer-int-\">" |
|
51 }, |
|
52 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", |
|
53 "<a href=\"../pkg1/Outer.Inner.html#Inner--\">Inner</a></span>()" |
|
54 }, |
|
55 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", |
|
56 "<a name=\"Inner--\">" |
|
57 }, |
|
58 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", |
|
59 "<a href=\"../pkg1/Outer.Inner.html#Inner-int-\">Inner</a></span>(int i)" |
|
60 }, |
|
61 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", |
|
62 "<a name=\"Inner-int-\">" |
|
63 }, |
|
64 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", |
|
65 "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner--\">NestedInner</a></span>()" |
|
66 }, |
|
67 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", |
|
68 "<a name=\"NestedInner--\">" |
|
69 }, |
|
70 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", |
|
71 "<a href=\"../pkg1/Outer.Inner.NestedInner.html#NestedInner-int-\">NestedInner</a></span>(int i)" |
|
72 }, |
|
73 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", |
|
74 "<a name=\"NestedInner-int-\">" |
|
75 } |
|
76 }; |
|
77 |
|
78 private static final String[][] NEGATED_TEST = { |
|
79 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", |
|
80 "Outer.Inner--" |
|
81 }, |
|
82 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.html", |
|
83 "Outer.Inner-int-" |
|
84 }, |
|
85 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", |
|
86 "Outer.Inner.NestedInner--" |
|
87 }, |
|
88 {BUG_ID + FS + "pkg1" + FS + "Outer.Inner.NestedInner.html", |
|
89 "Outer.Inner.NestedInner-int-" |
|
90 } |
|
91 }; |
|
92 |
|
93 private static final String[] ARGS = new String[] { |
|
94 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" |
|
95 }; |
|
96 |
|
97 /** |
|
98 * The entry point of the test. |
|
99 * @param args the array of command line arguments. |
|
100 */ |
|
101 public static void main(String[] args) throws Exception { |
|
102 TestConstructors tester = new TestConstructors(); |
|
103 run(tester, ARGS, TEST, NEGATED_TEST); |
|
104 tester.printSummary(); |
|
105 } |
|
106 |
|
107 /** |
|
108 * {@inheritDoc} |
|
109 */ |
|
110 public String getBugId() { |
|
111 return BUG_ID; |
|
112 } |
|
113 |
|
114 /** |
|
115 * {@inheritDoc} |
|
116 */ |
|
117 public String getBugName() { |
|
118 return getClass().getName(); |
|
119 } |
|
120 } |