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

Tue, 14 May 2013 10:14:54 -0700

author
jjg
date
Tue, 14 May 2013 10:14:54 -0700
changeset 1743
6a5288a298fd
parent 1635
e0ef84e33167
child 1952
3d4f0fa2ad05
permissions
-rw-r--r--

8012175: Convert TagletOutputImpl to use ContentBuilder instead of StringBuilder
Reviewed-by: darcy

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@1635 26 * @bug 8006124 8009684
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@1635 36 private static final String BUG_ID = "8006124-8009684";
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@1568 108 }
bpatel@1568 109 };
bpatel@1568 110 private static final String[][] PROFILES_NEGATED_TEST = {
bpatel@1568 111 {PROFILE_BUG_ID + FS + "pkg3" + FS + "Class2Pkg3.html",
bpatel@1568 112 "<div class=\"subTitle\">compact1"
bpatel@1568 113 },
bpatel@1568 114 {PROFILE_BUG_ID + FS + "pkg3" + FS + "Interface1Pkg3.html",
bpatel@1568 115 "<div class=\"subTitle\">compact1"
bpatel@1568 116 },
bpatel@1568 117 {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html",
bpatel@1568 118 "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" "
bpatel@1568 119 + "target=\"classFrame\">Anno1Pkg4</a></li>"
bpatel@1568 120 }
bpatel@1568 121 };
bpatel@1568 122 private static final String[][] PACKAGES_TEST = {
bpatel@1568 123 {PACKAGE_BUG_ID + FS + "overview-frame.html",
bpatel@1568 124 "<h2 title=\"Packages\">Packages</h2>"
bpatel@1568 125 },
bpatel@1568 126 {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-frame.html",
bpatel@1568 127 "<h1 class=\"bar\"><a href=\"../pkg4/package-summary.html\" "
bpatel@1568 128 + "target=\"classFrame\">pkg4</a></h1>"
bpatel@1568 129 },
bpatel@1568 130 {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-summary.html",
bpatel@1568 131 "<div class=\"header\">" + NL + "<h1 title=\"Package\" "
bpatel@1568 132 + "class=\"title\">Package&nbsp;pkg4</h1>" + NL + "</div>"
bpatel@1568 133 }
bpatel@1568 134 };
bpatel@1568 135 private static final String[][] PACKAGES_NEGATED_TEST = {
bpatel@1568 136 {PACKAGE_BUG_ID + FS + "profile-overview-frame.html",
bpatel@1568 137 "<span><a href=\"overview-frame.html\" "
bpatel@1635 138 + "target=\"packageListFrame\">All Packages</a></span>"
bpatel@1568 139 },
bpatel@1568 140 {PACKAGE_BUG_ID + FS + "compact2-frame.html",
bpatel@1635 141 "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">"
bpatel@1568 142 + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" "
bpatel@1635 143 + "target=\"packageListFrame\">All Profiles</a></span>"
bpatel@1568 144 },
bpatel@1568 145 {PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html",
bpatel@1568 146 "<a href=\"../compact2-summary.html\" target=\"classFrame\">"
bpatel@1568 147 + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" "
bpatel@1568 148 + "target=\"classFrame\">pkg2</a>"
bpatel@1568 149 },
bpatel@1568 150 {PACKAGE_BUG_ID + FS + "compact2-summary.html",
bpatel@1568 151 "<h1 title=\"Profile\" class=\"title\">Profile&nbsp;compact2</h1>"
bpatel@1568 152 },
bpatel@1568 153 {PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html",
bpatel@1568 154 "<div class=\"subTitle\">compact3</div>"
bpatel@1568 155 },
bpatel@1568 156 {PACKAGE_BUG_ID + FS + "overview-frame.html",
bpatel@1568 157 "<span><a href=\"profile-overview-frame.html\" "
bpatel@1635 158 + "target=\"packageListFrame\">All Profiles</a></span>"
bpatel@1568 159 },
bpatel@1568 160 {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html",
bpatel@1568 161 "<div class=\"subTitle\">compact1, compact2, compact3</div>"
bpatel@1568 162 }
bpatel@1568 163 };
bpatel@1568 164
bpatel@1568 165 /**
bpatel@1568 166 * The entry point of the test.
bpatel@1568 167 *
bpatel@1568 168 * @param args the array of command line arguments.
bpatel@1568 169 */
bpatel@1568 170 public static void main(String[] args) {
bpatel@1568 171 TestProfiles tester = new TestProfiles();
bpatel@1568 172 run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST);
bpatel@1568 173 run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST);
bpatel@1568 174 tester.printSummary();
bpatel@1568 175 }
bpatel@1568 176
bpatel@1568 177 /**
bpatel@1568 178 * {@inheritDoc}
bpatel@1568 179 */
bpatel@1568 180 public String getBugId() {
bpatel@1568 181 return BUG_ID;
bpatel@1568 182 }
bpatel@1568 183
bpatel@1568 184 /**
bpatel@1568 185 * {@inheritDoc}
bpatel@1568 186 */
bpatel@1568 187 public String getBugName() {
bpatel@1568 188 return getClass().getName();
bpatel@1568 189 }
bpatel@1568 190 }

mercurial