test/com/sun/javadoc/testProfiles/TestProfiles.java

Wed, 14 Aug 2013 21:44:51 -0700

author
bpatel
date
Wed, 14 Aug 2013 21:44:51 -0700
changeset 1952
3d4f0fa2ad05
parent 1635
e0ef84e33167
child 1993
240f424cc0d5
permissions
-rw-r--r--

8016921: Change the profiles table on overview-summary.html page to a list
Reviewed-by: jjg

bpatel@1568 1 /*
bpatel@1568 2 * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.
bpatel@1568 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bpatel@1568 4 *
bpatel@1568 5 * This code is free software; you can redistribute it and/or modify it
bpatel@1568 6 * under the terms of the GNU General Public License version 2 only, as
bpatel@1568 7 * published by the Free Software Foundation.
bpatel@1568 8 *
bpatel@1568 9 * This code is distributed in the hope that it will be useful, but WITHOUT
bpatel@1568 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bpatel@1568 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
bpatel@1568 12 * version 2 for more details (a copy is included in the LICENSE file that
bpatel@1568 13 * accompanied this code).
bpatel@1568 14 *
bpatel@1568 15 * You should have received a copy of the GNU General Public License version
bpatel@1568 16 * 2 along with this work; if not, write to the Free Software Foundation,
bpatel@1568 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bpatel@1568 18 *
bpatel@1568 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bpatel@1568 20 * or visit www.oracle.com if you need additional information or have any
bpatel@1568 21 * questions.
bpatel@1568 22 */
bpatel@1568 23
bpatel@1568 24 /*
bpatel@1568 25 * @test
bpatel@1952 26 * @bug 8006124 8009684 8016921
bpatel@1568 27 * @summary Test javadoc support for profiles.
bpatel@1568 28 * @author Bhavesh Patel
bpatel@1568 29 * @library ../lib/
bpatel@1568 30 * @build JavadocTester TestProfiles
bpatel@1568 31 * @run main TestProfiles
bpatel@1568 32 */
bpatel@1568 33 public class TestProfiles extends JavadocTester {
bpatel@1568 34
bpatel@1568 35 //Test information.
bpatel@1952 36 private static final String BUG_ID = "8006124-8009684-8016921";
bpatel@1568 37 private static final String PROFILE_BUG_ID = BUG_ID + "-1";
bpatel@1568 38 private static final String PACKAGE_BUG_ID = BUG_ID + "-2";
bpatel@1568 39 //Javadoc arguments.
bpatel@1568 40 private static final String[] ARGS1 = new String[]{
bpatel@1568 41 "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", SRC_DIR + FS
bpatel@1568 42 + "profile-rtjar-includes.txt", "pkg1", "pkg2", "pkg3", "pkg4", "pkg5"
bpatel@1568 43 };
bpatel@1568 44 private static final String[] ARGS2 = new String[]{
bpatel@1568 45 "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5"
bpatel@1568 46 };
bpatel@1568 47 //Input for string tests for profiles.
bpatel@1568 48 private static final String[][] PROFILES_TEST = {
bpatel@1568 49 // Tests for profile-overview-frame.html listing all profiles.
bpatel@1568 50 {PROFILE_BUG_ID + FS + "profile-overview-frame.html",
bpatel@1568 51 "<span><a href=\"overview-frame.html\" "
bpatel@1635 52 + "target=\"packageListFrame\">All Packages</a></span>"
bpatel@1568 53 },
bpatel@1568 54 {PROFILE_BUG_ID + FS + "profile-overview-frame.html",
bpatel@1635 55 "<li><a href=\"compact1-frame.html\" target=\"packageListFrame\">"
bpatel@1568 56 + "compact1</a></li>"
bpatel@1568 57 },
bpatel@1568 58 // Tests for profileName-frame.html listing all packages in a profile.
bpatel@1568 59 {PROFILE_BUG_ID + FS + "compact2-frame.html",
bpatel@1635 60 "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
bpatel@1568 61 + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
bpatel@1635 62 + "target=\"packageListFrame\">All Profiles</a></span>"
bpatel@1568 63 },
bpatel@1568 64 {PROFILE_BUG_ID + FS + "compact2-frame.html",
bpatel@1568 65 "<li><a href=\"pkg4/compact2-package-frame.html\" "
bpatel@1568 66 + "target=\"packageFrame\">pkg4</a></li>"
bpatel@1568 67 },
bpatel@1568 68 // Test for profileName-package-frame.html listing all types in a
bpatel@1568 69 // package of a profile.
bpatel@1568 70 {PROFILE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
bpatel@1568 71 "<a href=\"../compact2-summary.html\" target=\"classFrame\">"
bpatel@1568 72 + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" "
bpatel@1568 73 + "target=\"classFrame\">pkg2</a>"
bpatel@1568 74 },
bpatel@1568 75 // Tests for profileName-summary.html listing the summary for a profile.
bpatel@1568 76 {PROFILE_BUG_ID + FS + "compact2-summary.html",
bpatel@1568 77 "<li><a href=\"compact1-summary.html\">Prev Profile</a></li>" + NL
bpatel@1568 78 + "<li><a href=\"compact3-summary.html\">Next Profile</a></li>"
bpatel@1568 79 },
bpatel@1568 80 {PROFILE_BUG_ID + FS + "compact2-summary.html",
bpatel@1568 81 "<h1 title=\"Profile\" class=\"title\">Profile&nbsp;compact2</h1>"
bpatel@1568 82 },
bpatel@1568 83 {PROFILE_BUG_ID + FS + "compact2-summary.html",
bpatel@1568 84 "<h3><a href=\"pkg2/compact2-package-summary.html\" "
bpatel@1568 85 + "target=\"classFrame\">pkg2</a></h3>"
bpatel@1568 86 },
bpatel@1568 87 // Tests for profileName-package-summary.html listing the summary for a
bpatel@1568 88 // package in a profile.
bpatel@1568 89 {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
bpatel@1568 90 "<li><a href=\"../pkg4/compact3-package-summary.html\">Prev Package"
bpatel@1568 91 + "</a></li>"
bpatel@1568 92 },
bpatel@1568 93 {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
bpatel@1568 94 "<div class=\"subTitle\">compact3</div>"
bpatel@1568 95 },
bpatel@1568 96 //Test for "overview-frame.html" showing the "All Profiles" link.
bpatel@1568 97 {PROFILE_BUG_ID + FS + "overview-frame.html",
bpatel@1568 98 "<span><a href=\"profile-overview-frame.html\" "
bpatel@1635 99 + "target=\"packageListFrame\">All Profiles</a></span>"
bpatel@1568 100 },
bpatel@1568 101 //Test for "className.html" showing the profile information for the type.
bpatel@1568 102 {PROFILE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
bpatel@1568 103 "<div class=\"subTitle\">compact1, compact2, compact3</div>"
bpatel@1635 104 },
bpatel@1635 105 {PROFILE_BUG_ID + FS + "index.html",
bpatel@1635 106 "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " +
bpatel@1635 107 "title=\"All Packages\">"
bpatel@1952 108 },
bpatel@1952 109 //Test for "overview-summary.html" showing the profile list.
bpatel@1952 110 {PROFILE_BUG_ID + FS + "overview-summary.html",
bpatel@1952 111 "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" +
bpatel@1952 112 "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " +
bpatel@1952 113 "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" +
bpatel@1952 114 "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL +
bpatel@1952 115 "</ul>"
bpatel@1568 116 }
bpatel@1568 117 };
bpatel@1568 118 private static final String[][] PROFILES_NEGATED_TEST = {
bpatel@1568 119 {PROFILE_BUG_ID + FS + "pkg3" + FS + "Class2Pkg3.html",
bpatel@1568 120 "<div class=\"subTitle\">compact1"
bpatel@1568 121 },
bpatel@1568 122 {PROFILE_BUG_ID + FS + "pkg3" + FS + "Interface1Pkg3.html",
bpatel@1568 123 "<div class=\"subTitle\">compact1"
bpatel@1568 124 },
bpatel@1568 125 {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html",
bpatel@1568 126 "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" "
bpatel@1568 127 + "target=\"classFrame\">Anno1Pkg4</a></li>"
bpatel@1568 128 }
bpatel@1568 129 };
bpatel@1568 130 private static final String[][] PACKAGES_TEST = {
bpatel@1568 131 {PACKAGE_BUG_ID + FS + "overview-frame.html",
bpatel@1568 132 "<h2 title=\"Packages\">Packages</h2>"
bpatel@1568 133 },
bpatel@1568 134 {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-frame.html",
bpatel@1568 135 "<h1 class=\"bar\"><a href=\"../pkg4/package-summary.html\" "
bpatel@1568 136 + "target=\"classFrame\">pkg4</a></h1>"
bpatel@1568 137 },
bpatel@1568 138 {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-summary.html",
bpatel@1568 139 "<div class=\"header\">" + NL + "<h1 title=\"Package\" "
bpatel@1568 140 + "class=\"title\">Package&nbsp;pkg4</h1>" + NL + "</div>"
bpatel@1568 141 }
bpatel@1568 142 };
bpatel@1568 143 private static final String[][] PACKAGES_NEGATED_TEST = {
bpatel@1568 144 {PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
bpatel@1568 145 "<span><a href=\"overview-frame.html\" "
bpatel@1635 146 + "target=\"packageListFrame\">All Packages</a></span>"
bpatel@1568 147 },
bpatel@1568 148 {PACKAGE_BUG_ID + FS + "compact2-frame.html",
bpatel@1635 149 "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
bpatel@1568 150 + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
bpatel@1635 151 + "target=\"packageListFrame\">All Profiles</a></span>"
bpatel@1568 152 },
bpatel@1568 153 {PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
bpatel@1568 154 "<a href=\"../compact2-summary.html\" target=\"classFrame\">"
bpatel@1568 155 + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" "
bpatel@1568 156 + "target=\"classFrame\">pkg2</a>"
bpatel@1568 157 },
bpatel@1568 158 {PACKAGE_BUG_ID + FS + "compact2-summary.html",
bpatel@1568 159 "<h1 title=\"Profile\" class=\"title\">Profile&nbsp;compact2</h1>"
bpatel@1568 160 },
bpatel@1568 161 {PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
bpatel@1568 162 "<div class=\"subTitle\">compact3</div>"
bpatel@1568 163 },
bpatel@1568 164 {PACKAGE_BUG_ID + FS + "overview-frame.html",
bpatel@1568 165 "<span><a href=\"profile-overview-frame.html\" "
bpatel@1635 166 + "target=\"packageListFrame\">All Profiles</a></span>"
bpatel@1568 167 },
bpatel@1568 168 {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
bpatel@1568 169 "<div class=\"subTitle\">compact1, compact2, compact3</div>"
bpatel@1952 170 },
bpatel@1952 171 {PACKAGE_BUG_ID + FS + "overview-summary.html",
bpatel@1952 172 "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" +
bpatel@1952 173 "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " +
bpatel@1952 174 "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" +
bpatel@1952 175 "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL +
bpatel@1952 176 "</ul>"
bpatel@1568 177 }
bpatel@1568 178 };
bpatel@1568 179
bpatel@1568 180 /**
bpatel@1568 181 * The entry point of the test.
bpatel@1568 182 *
bpatel@1568 183 * @param args the array of command line arguments.
bpatel@1568 184 */
bpatel@1568 185 public static void main(String[] args) {
bpatel@1568 186 TestProfiles tester = new TestProfiles();
bpatel@1568 187 run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST);
bpatel@1568 188 run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST);
bpatel@1568 189 tester.printSummary();
bpatel@1568 190 }
bpatel@1568 191
bpatel@1568 192 /**
bpatel@1568 193 * {@inheritDoc}
bpatel@1568 194 */
bpatel@1568 195 public String getBugId() {
bpatel@1568 196 return BUG_ID;
bpatel@1568 197 }
bpatel@1568 198
bpatel@1568 199 /**
bpatel@1568 200 * {@inheritDoc}
bpatel@1568 201 */
bpatel@1568 202 public String getBugName() {
bpatel@1568 203 return getClass().getName();
bpatel@1568 204 }
bpatel@1568 205 }

mercurial