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

Mon, 21 Jan 2013 00:45:35 -0500

author
bpatel
date
Mon, 21 Jan 2013 00:45:35 -0500
changeset 1568
5f0731e4e5e6
child 1635
e0ef84e33167
permissions
-rw-r--r--

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

mercurial