Wed, 08 Oct 2014 12:38:55 -0700
Added tag jdk8u40-b09 for changeset 8bb38a350722
1 /*
2 * Copyright (c) 2012, 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 */
24 /*
25 * @test
26 * @bug 8005092
27 * @summary Test repeated annotations output.
28 * @author bpatel
29 * @library ../lib/
30 * @build JavadocTester TestRepeatedAnnotations
31 * @run main TestRepeatedAnnotations
32 */
34 public class TestRepeatedAnnotations extends JavadocTester {
36 //Test information.
37 private static final String BUG_ID = "8005092";
39 //Javadoc arguments.
40 private static final String[] ARGS = new String[] {
41 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "pkg1"
42 };
44 //Input for string search tests.
45 private static final String[][] TEST = {
46 {BUG_ID + FS + "pkg" + FS + "C.html",
47 "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
48 "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " +
49 "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
50 "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"},
51 {BUG_ID + FS + "pkg" + FS + "C.html",
52 "<a href=\"../pkg/ContaineeRegDoc.html\" " +
53 "title=\"annotation in pkg\">@ContaineeRegDoc</a> " +
54 "<a href=\"../pkg/ContaineeRegDoc.html\" " +
55 "title=\"annotation in pkg\">@ContaineeRegDoc</a>"},
56 {BUG_ID + FS + "pkg" + FS + "C.html",
57 "<a href=\"../pkg/RegContainerDoc.html\" " +
58 "title=\"annotation in pkg\">@RegContainerDoc</a>" +
59 "(<a href=\"../pkg/RegContainerDoc.html#value--\">value</a>={" +
60 "<a href=\"../pkg/RegContaineeNotDoc.html\" " +
61 "title=\"annotation in pkg\">@RegContaineeNotDoc</a>," +
62 "<a href=\"../pkg/RegContaineeNotDoc.html\" " +
63 "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})"},
64 {BUG_ID + FS + "pkg" + FS + "C.html",
65 "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
66 "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " +
67 "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
68 "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " +
69 "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
70 "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"},
71 {BUG_ID + FS + "pkg" + FS + "C.html",
72 "<a href=\"../pkg/ContainerSynthDoc.html\" " +
73 "title=\"annotation in pkg\">@ContainerSynthDoc</a>(" +
74 "<a href=\"../pkg/ContainerSynthDoc.html#value--\">value</a>=" +
75 "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
76 "title=\"annotation in pkg\">@ContaineeSynthDoc</a>)"},
77 {BUG_ID + FS + "pkg" + FS + "C.html",
78 "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
79 "title=\"annotation in pkg\">@ContaineeSynthDoc</a> " +
80 "<a href=\"../pkg/ContaineeSynthDoc.html\" " +
81 "title=\"annotation in pkg\">@ContaineeSynthDoc</a>"},
83 {BUG_ID + FS + "pkg" + FS + "D.html",
84 "<a href=\"../pkg/RegDoc.html\" title=\"annotation in pkg\">@RegDoc</a>" +
85 "(<a href=\"../pkg/RegDoc.html#x--\">x</a>=1)"},
86 {BUG_ID + FS + "pkg" + FS + "D.html",
87 "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>" +
88 "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>=1)"},
89 {BUG_ID + FS + "pkg" + FS + "D.html",
90 "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>" +
91 "(<a href=\"../pkg/RegArryDoc.html#y--\">y</a>={1,2})"},
92 {BUG_ID + FS + "pkg" + FS + "D.html",
93 "<a href=\"../pkg/NonSynthDocContainer.html\" " +
94 "title=\"annotation in pkg\">@NonSynthDocContainer</a>" +
95 "(<a href=\"../pkg/NonSynthDocContainer.html#value--\">value</a>=" +
96 "<a href=\"../pkg/RegArryDoc.html\" title=\"annotation in pkg\">@RegArryDoc</a>)"},
98 {BUG_ID + FS + "pkg1" + FS + "C.html",
99 "<a href=\"../pkg1/RegContainerValDoc.html\" " +
100 "title=\"annotation in pkg1\">@RegContainerValDoc</a>" +
101 "(<a href=\"../pkg1/RegContainerValDoc.html#value--\">value</a>={" +
102 "<a href=\"../pkg1/RegContaineeNotDoc.html\" " +
103 "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>," +
104 "<a href=\"../pkg1/RegContaineeNotDoc.html\" " +
105 "title=\"annotation in pkg1\">@RegContaineeNotDoc</a>}," +
106 "<a href=\"../pkg1/RegContainerValDoc.html#y--\">y</a>=3)"},
107 {BUG_ID + FS + "pkg1" + FS + "C.html",
108 "<a href=\"../pkg1/ContainerValDoc.html\" " +
109 "title=\"annotation in pkg1\">@ContainerValDoc</a>" +
110 "(<a href=\"../pkg1/ContainerValDoc.html#value--\">value</a>={" +
111 "<a href=\"../pkg1/ContaineeNotDoc.html\" " +
112 "title=\"annotation in pkg1\">@ContaineeNotDoc</a>," +
113 "<a href=\"../pkg1/ContaineeNotDoc.html\" " +
114 "title=\"annotation in pkg1\">@ContaineeNotDoc</a>}," +
115 "<a href=\"../pkg1/ContainerValDoc.html#x--\">x</a>=1)"}
116 };
118 private static final String[][] NEGATED_TEST = {
119 {BUG_ID + FS + "pkg" + FS + "C.html",
120 "<a href=\"../pkg/RegContaineeDoc.html\" " +
121 "title=\"annotation in pkg\">@RegContaineeDoc</a> " +
122 "<a href=\"../pkg/RegContaineeDoc.html\" " +
123 "title=\"annotation in pkg\">@RegContaineeDoc</a>"},
124 {BUG_ID + FS + "pkg" + FS + "C.html",
125 "<a href=\"../pkg/RegContainerNotDoc.html\" " +
126 "title=\"annotation in pkg\">@RegContainerNotDoc</a>" +
127 "(<a href=\"../pkg/RegContainerNotDoc.html#value--\">value</a>={" +
128 "<a href=\"../pkg/RegContaineeNotDoc.html\" " +
129 "title=\"annotation in pkg\">@RegContaineeNotDoc</a>," +
130 "<a href=\"../pkg/RegContaineeNotDoc.html\" " +
131 "title=\"annotation in pkg\">@RegContaineeNotDoc</a>})"},
133 {BUG_ID + FS + "pkg1" + FS + "C.html",
134 "<a href=\"../pkg1/ContaineeSynthDoc.html\" " +
135 "title=\"annotation in pkg1\">@ContaineeSynthDoc</a> " +
136 "<a href=\"../pkg1/ContaineeSynthDoc.html\" " +
137 "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>"},
138 {BUG_ID + FS + "pkg1" + FS + "C.html",
139 "<a href=\"../pkg1/RegContainerValNotDoc.html\" " +
140 "title=\"annotation in pkg1\">@RegContainerValNotDoc</a>" +
141 "(<a href=\"../pkg1/RegContainerValNotDoc.html#value--\">value</a>={" +
142 "<a href=\"../pkg1/RegContaineeDoc.html\" " +
143 "title=\"annotation in pkg1\">@RegContaineeDoc</a>," +
144 "<a href=\"../pkg1/RegContaineeDoc.html\" " +
145 "title=\"annotation in pkg1\">@RegContaineeDoc</a>}," +
146 "<a href=\"../pkg1/RegContainerValNotDoc.html#y--\">y</a>=4)"},
147 {BUG_ID + FS + "pkg1" + FS + "C.html",
148 "<a href=\"../pkg1/ContainerValNotDoc.html\" " +
149 "title=\"annotation in pkg1\">@ContainerValNotDoc</a>" +
150 "(<a href=\"../pkg1/ContainerValNotDoc.html#value--\">value</a>={" +
151 "<a href=\"../pkg1/ContaineeNotDoc.html\" " +
152 "title=\"annotation in pkg1\">@ContaineeNotDoc</a>," +
153 "<a href=\"../pkg1/ContaineeNotDoc.html\" " +
154 "title=\"annotation in pkg1\">@ContaineeNotDoc</a>}," +
155 "<a href=\"../pkg1/ContainerValNotDoc.html#x--\">x</a>=2)"},
156 {BUG_ID + FS + "pkg1" + FS + "C.html",
157 "<a href=\"../pkg1/ContainerSynthNotDoc.html\" " +
158 "title=\"annotation in pkg1\">@ContainerSynthNotDoc</a>(" +
159 "<a href=\"../pkg1/ContainerSynthNotDoc.html#value--\">value</a>=" +
160 "<a href=\"../pkg1/ContaineeSynthDoc.html\" " +
161 "title=\"annotation in pkg1\">@ContaineeSynthDoc</a>)"}
162 };
164 /**
165 * The entry point of the test.
166 * @param args the array of command line arguments.
167 */
168 public static void main(String[] args) {
169 TestRepeatedAnnotations tester = new TestRepeatedAnnotations();
170 run(tester, ARGS, TEST, NEGATED_TEST);
171 tester.printSummary();
172 }
174 /**
175 * {@inheritDoc}
176 */
177 public String getBugId() {
178 return BUG_ID;
179 }
181 /**
182 * {@inheritDoc}
183 */
184 public String getBugName() {
185 return getClass().getName();
186 }
187 }