Mon, 23 Jan 2017 17:03:12 -0800
Merge
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@2163 | 26 | * @bug 8006124 8009684 8016921 8023700 8024096 8008164 8026567 8026770 |
bpatel@1568 | 27 | * @summary Test javadoc support for profiles. |
jjg@1999 | 28 | * @author Bhavesh Patel, Evgeniya Stepanova |
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[]{ |
jjg@1999 | 41 | "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", |
jjg@1999 | 42 | SRC_DIR + FS + "profile-rtjar-includes.txt", "pkg1", "pkg2", |
jjg@1999 | 43 | "pkg3", "pkg4", "pkg5", "pkgDeprecated" |
bpatel@1568 | 44 | }; |
bpatel@1568 | 45 | private static final String[] ARGS2 = new String[]{ |
bpatel@1568 | 46 | "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" |
bpatel@1568 | 47 | }; |
bpatel@1568 | 48 | //Input for string tests for profiles. |
bpatel@1568 | 49 | private static final String[][] PROFILES_TEST = { |
bpatel@1568 | 50 | // Tests for profile-overview-frame.html listing all profiles. |
bpatel@1568 | 51 | {PROFILE_BUG_ID + FS + "profile-overview-frame.html", |
bpatel@1568 | 52 | "<span><a href=\"overview-frame.html\" " |
jjg@1993 | 53 | + "target=\"packageListFrame\">All Packages</a></span>" |
bpatel@1568 | 54 | }, |
bpatel@1568 | 55 | {PROFILE_BUG_ID + FS + "profile-overview-frame.html", |
bpatel@1635 | 56 | "<li><a href=\"compact1-frame.html\" target=\"packageListFrame\">" |
bpatel@1568 | 57 | + "compact1</a></li>" |
bpatel@1568 | 58 | }, |
bpatel@1568 | 59 | // Tests for profileName-frame.html listing all packages in a profile. |
bpatel@1568 | 60 | {PROFILE_BUG_ID + FS + "compact2-frame.html", |
bpatel@1635 | 61 | "<span><a href=\"overview-frame.html\" target=\"packageListFrame\">" |
jjg@1993 | 62 | + "All Packages</a></span><span><a href=\"profile-overview-frame.html\" " |
jjg@1993 | 63 | + "target=\"packageListFrame\">All Profiles</a></span>" |
bpatel@1568 | 64 | }, |
bpatel@1568 | 65 | {PROFILE_BUG_ID + FS + "compact2-frame.html", |
bpatel@1568 | 66 | "<li><a href=\"pkg4/compact2-package-frame.html\" " |
bpatel@1568 | 67 | + "target=\"packageFrame\">pkg4</a></li>" |
bpatel@1568 | 68 | }, |
bpatel@1568 | 69 | // Test for profileName-package-frame.html listing all types in a |
bpatel@1568 | 70 | // package of a profile. |
bpatel@1568 | 71 | {PROFILE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html", |
bpatel@1568 | 72 | "<a href=\"../compact2-summary.html\" target=\"classFrame\">" |
bpatel@1568 | 73 | + "compact2</a> - <a href=\"../pkg2/compact2-package-summary.html\" " |
bpatel@1568 | 74 | + "target=\"classFrame\">pkg2</a>" |
bpatel@1568 | 75 | }, |
bpatel@1568 | 76 | // Tests for profileName-summary.html listing the summary for a profile. |
bpatel@1568 | 77 | {PROFILE_BUG_ID + FS + "compact2-summary.html", |
jjg@1993 | 78 | "<li><a href=\"compact1-summary.html\">Prev Profile</a></li>" + NL |
jjg@1993 | 79 | + "<li><a href=\"compact3-summary.html\">Next Profile</a></li>" |
bpatel@1568 | 80 | }, |
bpatel@1568 | 81 | {PROFILE_BUG_ID + FS + "compact2-summary.html", |
bpatel@1568 | 82 | "<h1 title=\"Profile\" class=\"title\">Profile compact2</h1>" |
bpatel@1568 | 83 | }, |
bpatel@1568 | 84 | {PROFILE_BUG_ID + FS + "compact2-summary.html", |
bpatel@1568 | 85 | "<h3><a href=\"pkg2/compact2-package-summary.html\" " |
bpatel@1568 | 86 | + "target=\"classFrame\">pkg2</a></h3>" |
bpatel@1568 | 87 | }, |
bpatel@2163 | 88 | {PROFILE_BUG_ID + FS + "compact2-summary.html", |
bpatel@2163 | 89 | "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL |
bpatel@2163 | 90 | + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">" |
bpatel@2163 | 91 | + "pkg2</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" " |
bpatel@2163 | 92 | + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " |
bpatel@2163 | 93 | + "listing classes, and an explanation\">" |
bpatel@2163 | 94 | }, |
bpatel@2163 | 95 | {PROFILE_BUG_ID + FS + "compact2-summary.html", |
bpatel@2163 | 96 | "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL |
bpatel@2163 | 97 | + "<h3><a href=\"pkg4/compact2-package-summary.html\" target=\"classFrame\">" |
bpatel@2163 | 98 | + "pkg4</a></h3>" + NL + "<table class=\"typeSummary\" border=\"0\" " |
bpatel@2163 | 99 | + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " |
bpatel@2163 | 100 | + "listing classes, and an explanation\">" |
bpatel@2163 | 101 | }, |
bpatel@1568 | 102 | // Tests for profileName-package-summary.html listing the summary for a |
bpatel@1568 | 103 | // package in a profile. |
bpatel@1568 | 104 | {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", |
jjg@1993 | 105 | "<li><a href=\"../pkg4/compact3-package-summary.html\">Prev Package" |
bpatel@1568 | 106 | + "</a></li>" |
bpatel@1568 | 107 | }, |
bpatel@1568 | 108 | {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", |
bpatel@1568 | 109 | "<div class=\"subTitle\">compact3</div>" |
bpatel@1568 | 110 | }, |
bpatel@2163 | 111 | {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", |
bpatel@2163 | 112 | "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL |
bpatel@2163 | 113 | + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" " |
bpatel@2163 | 114 | + "cellspacing=\"0\" summary=\"Interface Summary table, listing " |
bpatel@2163 | 115 | + "interfaces, and an explanation\">" |
bpatel@2163 | 116 | }, |
bpatel@1568 | 117 | //Test for "overview-frame.html" showing the "All Profiles" link. |
bpatel@1568 | 118 | {PROFILE_BUG_ID + FS + "overview-frame.html", |
bpatel@1568 | 119 | "<span><a href=\"profile-overview-frame.html\" " |
jjg@1993 | 120 | + "target=\"packageListFrame\">All Profiles</a></span>" |
bpatel@1568 | 121 | }, |
bpatel@1568 | 122 | //Test for "className.html" showing the profile information for the type. |
bpatel@1568 | 123 | {PROFILE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", |
bpatel@1568 | 124 | "<div class=\"subTitle\">compact1, compact2, compact3</div>" |
bpatel@1635 | 125 | }, |
bpatel@1635 | 126 | {PROFILE_BUG_ID + FS + "index.html", |
bpatel@1635 | 127 | "<frame src=\"overview-frame.html\" name=\"packageListFrame\" " + |
bpatel@1635 | 128 | "title=\"All Packages\">" |
bpatel@1952 | 129 | }, |
bpatel@1952 | 130 | //Test for "overview-summary.html" showing the profile list. |
bpatel@1952 | 131 | {PROFILE_BUG_ID + FS + "overview-summary.html", |
bpatel@1952 | 132 | "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" + |
bpatel@1952 | 133 | "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " + |
bpatel@1952 | 134 | "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" + |
bpatel@1952 | 135 | "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL + |
bpatel@1952 | 136 | "</ul>" |
jjg@1999 | 137 | }, |
jjg@1999 | 138 | //Test deprecated class in profiles |
jjg@1999 | 139 | {PROFILE_BUG_ID + FS + "compact1-summary.html","<td class=\"colFirst\">" |
jjg@1999 | 140 | + "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">Class1Pkg2</a></td>" |
jjg@1999 | 141 | + NL + "<td class=\"colLast\">Deprecated" |
jjg@1999 | 142 | }, |
jjg@1999 | 143 | {PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">" |
jjg@1999 | 144 | + "<a href=\"pkg2/Class1Pkg2.html\" title=\"class in pkg2\">pkg2.Class1Pkg2</a>" |
bpatel@2147 | 145 | + NL +"<div class=\"block\"><span class=\"deprecationComment\">Class1Pkg2. This class is deprecated</span></div>" |
jjg@1999 | 146 | }, |
jjg@1999 | 147 | //Test deprecated package in profile |
jjg@1999 | 148 | {PROFILE_BUG_ID + FS + "deprecated-list.html","<td class=\"colOne\">" |
jjg@1999 | 149 | + "<a href=\"pkgDeprecated/package-summary.html\">pkgDeprecated</a>" |
bpatel@2147 | 150 | + NL +"<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>." |
jjg@1999 | 151 | + " Use pkg1.</span></div>" |
jjg@1999 | 152 | }, |
jjg@1999 | 153 | {PROFILE_BUG_ID + FS + "pkgDeprecated" + FS + "package-summary.html", |
bpatel@2147 | 154 | "<div class=\"deprecatedContent\"><span class=\"deprecatedLabel\">Deprecated.</span>" |
bpatel@2147 | 155 | + NL + "<div class=\"block\"><span class=\"deprecationComment\">This package is <b>Deprecated</b>." |
jjg@1999 | 156 | + " Use pkg1.</span></div>" |
jjg@1999 | 157 | }, |
jjg@1999 | 158 | // need to add teststring when JDK-8015496 will be fixed |
jjg@1999 | 159 | //Test exception in profiles |
bpatel@2084 | 160 | {PROFILE_BUG_ID + FS + "compact1-summary.html","<table class=\"typeSummary\" " |
jjg@1999 | 161 | + "border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " |
jjg@1999 | 162 | + "summary=\"Exception Summary table, listing exceptions, and an explanation\">" |
jjg@1999 | 163 | + NL + "<caption><span>Exception Summary</span><span class=\"tabEnd\">" |
jjg@1999 | 164 | + " </span></caption>" + NL + "<tr>" + NL + "<th class=\"colFirst\" " |
jjg@1999 | 165 | + "scope=\"col\">Exception</th>" + NL + "<th class=\"colLast\" scope=\"col\">" |
jjg@1999 | 166 | + "Description</th>" + NL + "</tr>" + NL + "<tbody>" + NL + "<tr class=\"altColor\">" |
jjg@1999 | 167 | + NL + "<td class=\"colFirst\"><a href=\"pkg2/ClassException.html\"" |
jjg@1999 | 168 | + " title=\"class in pkg2\">ClassException</a></td>" |
jjg@1999 | 169 | }, |
jjg@1999 | 170 | //Test errors in profiles |
jjg@1999 | 171 | {PROFILE_BUG_ID + FS + "compact1-summary.html", |
bpatel@2084 | 172 | "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" cellspacing=\"0\" " |
jjg@1999 | 173 | + "summary=\"Error Summary table, listing errors, and an explanation\">" |
jjg@1999 | 174 | + NL + "<caption><span>Error Summary</span><span class=\"tabEnd\"> " |
jjg@1999 | 175 | + "</span></caption>" + NL + "<tr>" + NL + "<th class=\"colFirst\"" |
jjg@1999 | 176 | + " scope=\"col\">Error</th>" + NL + "<th class=\"colLast\" " |
jjg@1999 | 177 | + "scope=\"col\">Description</th>" + NL + "</tr>" + NL + "<tbody>" |
jjg@1999 | 178 | + NL + "<tr class=\"altColor\">" + NL + "<td class=\"colFirst\">" |
jjg@1999 | 179 | + "<a href=\"pkg2/ClassError.html\" title=\"class in pkg2\">ClassError</a></td>" |
bpatel@1568 | 180 | } |
bpatel@1568 | 181 | }; |
bpatel@1568 | 182 | private static final String[][] PROFILES_NEGATED_TEST = { |
bpatel@1568 | 183 | {PROFILE_BUG_ID + FS + "pkg3" + FS + "Class2Pkg3.html", |
bpatel@1568 | 184 | "<div class=\"subTitle\">compact1" |
bpatel@1568 | 185 | }, |
bpatel@1568 | 186 | {PROFILE_BUG_ID + FS + "pkg3" + FS + "Interface1Pkg3.html", |
bpatel@1568 | 187 | "<div class=\"subTitle\">compact1" |
bpatel@1568 | 188 | }, |
bpatel@1568 | 189 | {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html", |
bpatel@1568 | 190 | "<li><a href=\"Anno1Pkg4.html\" title=\"annotation in pkg4\" " |
bpatel@1568 | 191 | + "target=\"classFrame\">Anno1Pkg4</a></li>" |
jjg@1999 | 192 | }, |
jjg@1999 | 193 | {PROFILE_BUG_ID + FS + "compact1-summary.html","<li>Use</li>" |
bpatel@2163 | 194 | }, |
bpatel@2163 | 195 | {PROFILE_BUG_ID + FS + "compact2-summary.html", |
bpatel@2163 | 196 | "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL |
bpatel@2163 | 197 | + "<h3><a href=\"pkg2/compact2-package-summary.html\" target=\"classFrame\">" |
bpatel@2163 | 198 | + "pkg2</a></h3>" + NL + "<li class=\"blockList\">" + NL |
bpatel@2163 | 199 | + "<table class=\"typeSummary\" border=\"0\" " |
bpatel@2163 | 200 | + "cellpadding=\"3\" cellspacing=\"0\" summary=\"Class Summary table, " |
bpatel@2163 | 201 | + "listing classes, and an explanation\">" |
bpatel@2163 | 202 | }, |
bpatel@2163 | 203 | {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", |
bpatel@2163 | 204 | "<ul class=\"blockList\">" + NL + "<li class=\"blockList\">" + NL |
bpatel@2163 | 205 | + "<li class=\"blockList\">" + NL |
bpatel@2163 | 206 | + "<table class=\"typeSummary\" border=\"0\" cellpadding=\"3\" " |
bpatel@2163 | 207 | + "cellspacing=\"0\" summary=\"Interface Summary table, listing " |
bpatel@2163 | 208 | + "interfaces, and an explanation\">" |
bpatel@1568 | 209 | } |
bpatel@1568 | 210 | }; |
bpatel@1568 | 211 | private static final String[][] PACKAGES_TEST = { |
bpatel@1568 | 212 | {PACKAGE_BUG_ID + FS + "overview-frame.html", |
bpatel@1568 | 213 | "<h2 title=\"Packages\">Packages</h2>" |
bpatel@1568 | 214 | }, |
bpatel@1568 | 215 | {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-frame.html", |
bpatel@1568 | 216 | "<h1 class=\"bar\"><a href=\"../pkg4/package-summary.html\" " |
bpatel@1568 | 217 | + "target=\"classFrame\">pkg4</a></h1>" |
bpatel@1568 | 218 | }, |
bpatel@1568 | 219 | {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-summary.html", |
bpatel@1568 | 220 | "<div class=\"header\">" + NL + "<h1 title=\"Package\" " |
bpatel@1568 | 221 | + "class=\"title\">Package pkg4</h1>" + NL + "</div>" |
bpatel@1568 | 222 | } |
bpatel@1568 | 223 | }; |
bpatel@1568 | 224 | private static final String[][] PACKAGES_NEGATED_TEST = { |
bpatel@1568 | 225 | {PACKAGE_BUG_ID + FS + "overview-frame.html", |
bpatel@1568 | 226 | "<span><a href=\"profile-overview-frame.html\" " |
jjg@1993 | 227 | + "target=\"packageListFrame\">All Profiles</a></span>" |
bpatel@1568 | 228 | }, |
bpatel@1568 | 229 | {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", |
bpatel@1568 | 230 | "<div class=\"subTitle\">compact1, compact2, compact3</div>" |
bpatel@1952 | 231 | }, |
bpatel@1952 | 232 | {PACKAGE_BUG_ID + FS + "overview-summary.html", |
bpatel@1952 | 233 | "<ul>" + NL +"<li><a href=\"compact1-summary.html\" target=\"classFrame\">" + |
bpatel@1952 | 234 | "compact1</a></li>" + NL + "<li><a href=\"compact2-summary.html\" " + |
bpatel@1952 | 235 | "target=\"classFrame\">compact2</a></li>" + NL + "<li><a href=\"" + |
bpatel@1952 | 236 | "compact3-summary.html\" target=\"classFrame\">compact3</a></li>" + NL + |
bpatel@1952 | 237 | "</ul>" |
bpatel@1568 | 238 | } |
bpatel@1568 | 239 | }; |
bpatel@2036 | 240 | private static final String[] PACKAGES_NEGATED_FILE_TEST = { |
bpatel@2036 | 241 | PACKAGE_BUG_ID + FS + "profile-overview-frame.html", |
bpatel@2036 | 242 | PACKAGE_BUG_ID + FS + "compact2-frame.html", |
bpatel@2036 | 243 | PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html", |
bpatel@2036 | 244 | PACKAGE_BUG_ID + FS + "compact2-summary.html", |
bpatel@2036 | 245 | PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html" |
bpatel@2036 | 246 | }; |
bpatel@1568 | 247 | |
bpatel@1568 | 248 | /** |
bpatel@1568 | 249 | * The entry point of the test. |
bpatel@1568 | 250 | * |
bpatel@1568 | 251 | * @param args the array of command line arguments. |
bpatel@1568 | 252 | */ |
bpatel@1568 | 253 | public static void main(String[] args) { |
bpatel@1568 | 254 | TestProfiles tester = new TestProfiles(); |
bpatel@1568 | 255 | run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST); |
bpatel@2036 | 256 | run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST, NO_FILE_TEST, PACKAGES_NEGATED_FILE_TEST); |
bpatel@1568 | 257 | tester.printSummary(); |
bpatel@1568 | 258 | } |
bpatel@1568 | 259 | |
bpatel@1568 | 260 | /** |
bpatel@1568 | 261 | * {@inheritDoc} |
bpatel@1568 | 262 | */ |
bpatel@1568 | 263 | public String getBugId() { |
bpatel@1568 | 264 | return BUG_ID; |
bpatel@1568 | 265 | } |
bpatel@1568 | 266 | |
bpatel@1568 | 267 | /** |
bpatel@1568 | 268 | * {@inheritDoc} |
bpatel@1568 | 269 | */ |
bpatel@1568 | 270 | public String getBugName() { |
bpatel@1568 | 271 | return getClass().getName(); |
bpatel@1568 | 272 | } |
bpatel@1568 | 273 | } |