test/com/sun/javadoc/testPrivateClasses/TestPrivateClasses.java

changeset 2147
130b8c0e570e
parent 2101
933ba3f81a87
child 2525
2eb010b6cb22
equal deleted inserted replaced
2146:7de97abc4a5c 2147:130b8c0e570e
21 * questions. 21 * questions.
22 */ 22 */
23 23
24 /* 24 /*
25 * @test 25 * @test
26 * @bug 4780441 4874845 4978816 8014017 8016328 8025633 26 * @bug 4780441 4874845 4978816 8014017 8016328 8025633 8026567
27 * @summary Make sure that when the -private flag is not used, members 27 * @summary Make sure that when the -private flag is not used, members
28 * inherited from package private class are documented in the child. 28 * inherited from package private class are documented in the child.
29 * 29 *
30 * Make sure that when a method inherits documentation from a method 30 * Make sure that when a method inherits documentation from a method
31 * in a non-public class/interface, the non-public class/interface 31 * in a non-public class/interface, the non-public class/interface
110 "This comment should get copied to the implementing class"}, 110 "This comment should get copied to the implementing class"},
111 }; 111 };
112 private static final String[][] NEGATED_TEST1 = { 112 private static final String[][] NEGATED_TEST1 = {
113 // Should not document that a method overrides method from private class. 113 // Should not document that a method overrides method from private class.
114 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 114 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
115 "<span class=\"strong\">Overrides:</span>"}, 115 "<span class=\"overrideSpecifyLabel\">Overrides:</span>"},
116 // Should not document that a method specified by private interface. 116 // Should not document that a method specified by private interface.
117 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 117 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
118 "<span class=\"strong\">Specified by:</span>"}, 118 "<span class=\"overrideSpecifyLabel\">Specified by:</span>"},
119 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", 119 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
120 "<span class=\"strong\">Specified by:</span>"}, 120 "<span class=\"overrideSpecifyLabel\">Specified by:</span>"},
121 // Should not mention that any documentation was copied. 121 // Should not mention that any documentation was copied.
122 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 122 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
123 "Description copied from"}, 123 "Description copied from"},
124 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", 124 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
125 "Description copied from"}, 125 "Description copied from"},
137 "PrivateInterface"}, 137 "PrivateInterface"},
138 138
139 //Do not inherit private interface method with generic parameters. 139 //Do not inherit private interface method with generic parameters.
140 //This method has been implemented. 140 //This method has been implemented.
141 {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html", 141 {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
142 "<span class=\"strong\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"}, 142 "<span class=\"memberNameLink\"><a href=\"../pkg2/I.html#hello-T-\">hello</a></span>"},
143 }; 143 };
144 144
145 // Test output when -private flag is used. 145 // Test output when -private flag is used.
146 private static final String[][] TEST2 = { 146 private static final String[][] TEST2 = {
147 // Field inheritence from non-public superclass. 147 // Field inheritence from non-public superclass.
174 "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent-int-\">" + 174 "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent-int-\">" +
175 "methodInheritedFromParent</a>" 175 "methodInheritedFromParent</a>"
176 }, 176 },
177 // Should document that a method overrides method from private class. 177 // Should document that a method overrides method from private class.
178 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 178 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
179 "<dt><span class=\"strong\">Overrides:</span></dt>" + NL + 179 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>" + NL +
180 "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">" + 180 "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent-char:A-int-T-V-java.util.List-\">" +
181 "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>" + 181 "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>" +
182 "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + 182 "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
183 "PrivateParent</a></code></dd>"}, 183 "PrivateParent</a></code></dd>"},
184 // Should document that a method is specified by private interface. 184 // Should document that a method is specified by private interface.
185 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 185 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
186 "<dt><span class=\"strong\">Specified by:</span></dt>" + NL + 186 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
187 "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" + 187 "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface-int-\">" +
188 "methodInterface</a></code>&nbsp;in interface&nbsp;<code>" + 188 "methodInterface</a></code>&nbsp;in interface&nbsp;<code>" +
189 "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + 189 "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
190 "PrivateInterface</a></code></dd>"}, 190 "PrivateInterface</a></code></dd>"},
191 // Method inheritence from non-public superinterface. 191 // Method inheritence from non-public superinterface.
225 "PublicInterface</a></dd>" + NL + "</dl>"}, 225 "PublicInterface</a></dd>" + NL + "</dl>"},
226 226
227 //Since private flag is used, we can document that private interface method 227 //Since private flag is used, we can document that private interface method
228 //with generic parameters has been implemented. 228 //with generic parameters has been implemented.
229 {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html", 229 {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
230 "<span class=\"strong\">Description copied from interface:&nbsp;<code>" + 230 "<span class=\"descfrmTypeLabel\">Description copied from interface:&nbsp;<code>" +
231 "<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>"}, 231 "<a href=\"../pkg2/I.html#hello-T-\">I</a></code></span>"},
232 232
233 {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html", 233 {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
234 "<dt><span class=\"strong\">Specified by:</span></dt>" + NL + 234 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>" + NL +
235 "<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>" + 235 "<dd><code><a href=\"../pkg2/I.html#hello-T-\">hello</a></code>" +
236 "&nbsp;in interface&nbsp;<code>" + 236 "&nbsp;in interface&nbsp;<code>" +
237 "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" + 237 "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
238 "&lt;java.lang.String&gt;</code></dd>"}, 238 "&lt;java.lang.String&gt;</code></dd>"},
239 239
240 //Make sure when no modifier appear in the class signature, the 240 //Make sure when no modifier appear in the class signature, the
241 //signature is displayed correctly without extra space at the beginning. 241 //signature is displayed correctly without extra space at the beginning.
242 {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html", 242 {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
243 "<pre>class <span class=\"strong\">PrivateParent</span>"}, 243 "<pre>class <span class=\"typeNameLabel\">PrivateParent</span>"},
244 244
245 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 245 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
246 "<pre>public class <span class=\"strong\">PublicChild</span>"}, 246 "<pre>public class <span class=\"typeNameLabel\">PublicChild</span>"},
247 }; 247 };
248 private static final String[][] NEGATED_TEST2 = { 248 private static final String[][] NEGATED_TEST2 = {
249 {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html", 249 {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateParent.html",
250 "<pre> class <span class=\"strong\">PrivateParent</span>"}, 250 "<pre> class <span class=\"typeNameLabel\">PrivateParent</span>"},
251 }; 251 };
252 252
253 /** 253 /**
254 * The entry point of the test. 254 * The entry point of the test.
255 * @param args the array of command line arguments. 255 * @param args the array of command line arguments.

mercurial