Fri, 30 Aug 2013 11:48:36 -0700
8023700: Use non breaking space in various labels
Reviewed-by: bpatel
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 */
24 /*
25 * @test
26 * @bug 8006124 8009684 8016921 8023700
27 * @summary Test javadoc support for profiles.
28 * @author Bhavesh Patel
29 * @library ../lib/
30 * @build JavadocTester TestProfiles
31 * @run main TestProfiles
32 */
33 public class TestProfiles extends JavadocTester {
35 //Test information.
36 private static final String BUG_ID = "8006124-8009684-8016921";
37 private static final String PROFILE_BUG_ID = BUG_ID + "-1";
38 private static final String PACKAGE_BUG_ID = BUG_ID + "-2";
39 //Javadoc arguments.
40 private static final String[] ARGS1 = new String[]{
41 "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", SRC_DIR + FS
42 + "profile-rtjar-includes.txt", "pkg1", "pkg2", "pkg3", "pkg4", "pkg5"
43 };
44 private static final String[] ARGS2 = new String[]{
45 "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5"
46 };
47 //Input for string tests for profiles.
48 private static final String[][] PROFILES_TEST = {
49 // Tests for profile-overview-frame.html listing all profiles.
50 {PROFILE_BUG_ID + FS + "profile-overview-frame.html",
51 "<span><a href=\"overview-frame.html\" "
52 + "target=\"packageListFrame\">All Packages</a></span>"
53 },
54 {PROFILE_BUG_ID + FS + "profile-overview-frame.html",
55 "<li><a href=\"compact1-frame.html\" target=\"packageListFrame\">"
56 + "compact1</a></li>"
57 },
58 // Tests for profileName-frame.html listing all packages in a profile.
59 {PROFILE_BUG_ID + FS + "compact2-frame.html",
60 "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
61 + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
62 + "target=\"packageListFrame\">All Profiles</a></span>"
63 },
64 {PROFILE_BUG_ID + FS + "compact2-frame.html",
65 "<li><a href=\"pkg4/compact2-package-frame.html\" "
66 + "target=\"packageFrame\">pkg4</a></li>"
67 },
68 // Test for profileName-package-frame.html listing all types in a
69 // package of a profile.
70 {PROFILE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
71 "<a href=\"../compact2-summary.html\" target=\"classFrame\">"
72 + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" "
73 + "target=\"classFrame\">pkg2</a>"
74 },
75 // Tests for profileName-summary.html listing the summary for a profile.
76 {PROFILE_BUG_ID + FS + "compact2-summary.html",
77 "<li><a href=\"compact1-summary.html\">Prev Profile</a></li>" + NL
78 + "<li><a href=\"compact3-summary.html\">Next Profile</a></li>"
79 },
80 {PROFILE_BUG_ID + FS + "compact2-summary.html",
81 "<h1 title=\"Profile\" class=\"title\">Profile compact2</h1>"
82 },
83 {PROFILE_BUG_ID + FS + "compact2-summary.html",
84 "<h3><a href=\"pkg2/compact2-package-summary.html\" "
85 + "target=\"classFrame\">pkg2</a></h3>"
86 },
87 // Tests for profileName-package-summary.html listing the summary for a
88 // package in a profile.
89 {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
90 "<li><a href=\"../pkg4/compact3-package-summary.html\">Prev Package"
91 + "</a></li>"
92 },
93 {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
94 "<div class=\"subTitle\">compact3</div>"
95 },
96 //Test for "overview-frame.html" showing the "All Profiles" link.
97 {PROFILE_BUG_ID + FS + "overview-frame.html",
98 "<span><a href=\"profile-overview-frame.html\" "
99 + "target=\"packageListFrame\">All Profiles</a></span>"
100 },
101 //Test for "className.html" showing the profile information for the type.
102 {PROFILE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
103 "<div class=\"subTitle\">compact1, compact2, compact3</div>"
104 },
105 {PROFILE_BUG_ID + FS + "index.html",
106 "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " +
107 "title=\"All Packages\">"
108 },
109 //Test for "overview-summary.html" showing the profile list.
110 {PROFILE_BUG_ID + FS + "overview-summary.html",
111 "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" +
112 "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " +
113 "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" +
114 "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL +
115 "</ul>"
116 }
117 };
118 private static final String[][] PROFILES_NEGATED_TEST = {
119 {PROFILE_BUG_ID + FS + "pkg3" + FS + "Class2Pkg3.html",
120 "<div class=\"subTitle\">compact1"
121 },
122 {PROFILE_BUG_ID + FS + "pkg3" + FS + "Interface1Pkg3.html",
123 "<div class=\"subTitle\">compact1"
124 },
125 {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html",
126 "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" "
127 + "target=\"classFrame\">Anno1Pkg4</a></li>"
128 }
129 };
130 private static final String[][] PACKAGES_TEST = {
131 {PACKAGE_BUG_ID + FS + "overview-frame.html",
132 "<h2 title=\"Packages\">Packages</h2>"
133 },
134 {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-frame.html",
135 "<h1 class=\"bar\"><a href=\"../pkg4/package-summary.html\" "
136 + "target=\"classFrame\">pkg4</a></h1>"
137 },
138 {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-summary.html",
139 "<div class=\"header\">" + NL + "<h1 title=\"Package\" "
140 + "class=\"title\">Package pkg4</h1>" + NL + "</div>"
141 }
142 };
143 private static final String[][] PACKAGES_NEGATED_TEST = {
144 {PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
145 "<span><a href=\"overview-frame.html\" "
146 + "target=\"packageListFrame\">All Packages</a></span>"
147 },
148 {PACKAGE_BUG_ID + FS + "compact2-frame.html",
149 "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
150 + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
151 + "target=\"packageListFrame\">All Profiles</a></span>"
152 },
153 {PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
154 "<a href=\"../compact2-summary.html\" target=\"classFrame\">"
155 + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" "
156 + "target=\"classFrame\">pkg2</a>"
157 },
158 {PACKAGE_BUG_ID + FS + "compact2-summary.html",
159 "<h1 title=\"Profile\" class=\"title\">Profile compact2</h1>"
160 },
161 {PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
162 "<div class=\"subTitle\">compact3</div>"
163 },
164 {PACKAGE_BUG_ID + FS + "overview-frame.html",
165 "<span><a href=\"profile-overview-frame.html\" "
166 + "target=\"packageListFrame\">All Profiles</a></span>"
167 },
168 {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
169 "<div class=\"subTitle\">compact1, compact2, compact3</div>"
170 },
171 {PACKAGE_BUG_ID + FS + "overview-summary.html",
172 "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" +
173 "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " +
174 "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" +
175 "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL +
176 "</ul>"
177 }
178 };
180 /**
181 * The entry point of the test.
182 *
183 * @param args the array of command line arguments.
184 */
185 public static void main(String[] args) {
186 TestProfiles tester = new TestProfiles();
187 run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST);
188 run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST);
189 tester.printSummary();
190 }
192 /**
193 * {@inheritDoc}
194 */
195 public String getBugId() {
196 return BUG_ID;
197 }
199 /**
200 * {@inheritDoc}
201 */
202 public String getBugName() {
203 return getClass().getName();
204 }
205 }