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

changeset 766
90af8d87741f
parent 554
9d9f26857129
child 798
4868a36f6fd8
equal deleted inserted replaced
758:bcbc86cc5b31 766:90af8d87741f
56 56
57 // Test output when -private flag is not used. 57 // Test output when -private flag is not used.
58 private static final String[][] TEST1 = { 58 private static final String[][] TEST1 = {
59 // Field inheritence from non-public superclass. 59 // Field inheritence from non-public superclass.
60 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 60 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
61 "<A HREF=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" + 61 "<a href=\"../pkg/PublicChild.html#fieldInheritedFromParent\">" +
62 "fieldInheritedFromParent</A>" 62 "fieldInheritedFromParent</a>"
63 }, 63 },
64 64
65 // Method inheritence from non-public superclass. 65 // Method inheritence from non-public superclass.
66 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 66 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
67 "<A HREF=\"../pkg/PublicChild.html#methodInheritedFromParent(int)\">" + 67 "<a href=\"../pkg/PublicChild.html#methodInheritedFromParent(int)\">" +
68 "methodInheritedFromParent</A>" 68 "methodInheritedFromParent</a>"
69 }, 69 },
70 70
71 // Field inheritence from non-public superinterface. 71 // Field inheritence from non-public superinterface.
72 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", 72 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
73 "<A HREF=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" + 73 "<a href=\"../pkg/PublicInterface.html#fieldInheritedFromInterface\">" +
74 "fieldInheritedFromInterface</A>" 74 "fieldInheritedFromInterface</a>"
75 }, 75 },
76 76
77 // Method inheritence from non-public superinterface. 77 // Method inheritence from non-public superinterface.
78 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", 78 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
79 "<A HREF=\"../pkg/PublicInterface.html#methodInterface(int)\">" + 79 "<a href=\"../pkg/PublicInterface.html#methodInterface(int)\">" +
80 "methodInterface</A>" 80 "methodInterface</a>"
81 }, 81 },
82 82
83 // private class does not show up in tree 83 // private class does not show up in tree
84 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 84 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
85 "<PRE>" + NL + 85 "<ul class=\"inheritance\">" + NL + "<li>java.lang.Object</li>" + NL +
86 "java.lang.Object" + NL + 86 "<li>" + NL + "<ul class=\"inheritance\">" + NL + "<li>pkg.PublicChild</li>" + NL +
87 " <IMG SRC=\"../resources/inherit.gif\" " + 87 "</ul>" + NL + "</li>" + NL + "</ul>"
88 "ALT=\"extended by \"><STRONG>pkg.PublicChild</STRONG>" + NL +
89 "</PRE>"
90 }, 88 },
91 89
92 // Method is documented as though it is declared in the inheriting method. 90 // Method is documented as though it is declared in the inheriting method.
93 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 91 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
94 "public void <STRONG>methodInheritedFromParent</STRONG>(int&nbsp;p1)" 92 "<pre>public&nbsp;void&nbsp;methodInheritedFromParent(int&nbsp;p1)"
95 }, 93 },
96 94
97 //Make sure implemented interfaces from private superclass are inherited 95 //Make sure implemented interfaces from private superclass are inherited
98 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", 96 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
99 "<STRONG>All Known Implementing Classes:</STRONG></DT> <DD><A HREF=\"../pkg/PublicChild.html\" " + 97 "<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL +
100 "title=\"class in pkg\">PublicChild</A>"}, 98 "<dd><a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">" +
101 99 "PublicChild</a></dd>" + NL + "</dl>"},
102 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 100
103 "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/PublicInterface.html\" " + 101 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
104 "title=\"interface in pkg\">PublicInterface</A>"}, 102 "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
103 "<dd><a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
104 "PublicInterface</a></dd>" + NL + "</dl>"},
105 105
106 //Generic interface method test. 106 //Generic interface method test.
107 {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html", 107 {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
108 "This comment should get copied to the implementing class"}, 108 "This comment should get copied to the implementing class"},
109 }; 109 };
110 private static final String[][] NEGATED_TEST1 = { 110 private static final String[][] NEGATED_TEST1 = {
111 // Should not document that a method overrides method from private class. 111 // Should not document that a method overrides method from private class.
112 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 112 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
113 "<STRONG>Overrides:</STRONG>"}, 113 "<strong>Overrides:</strong>"},
114 // Should not document that a method specified by private interface. 114 // Should not document that a method specified by private interface.
115 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 115 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
116 "<STRONG>Specified by:</STRONG>"}, 116 "<strong>Specified by:</strong>"},
117 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", 117 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
118 "<STRONG>Specified by:</STRONG>"}, 118 "<strong>Specified by:</strong>"},
119 // Should not mention that any documentation was copied. 119 // Should not mention that any documentation was copied.
120 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html", 120 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicChild.html",
121 "Description copied from"}, 121 "Description copied from"},
122 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html", 122 {BUG_ID + "-1" + FS + "pkg" + FS + "PublicInterface.html",
123 "Description copied from"}, 123 "Description copied from"},
135 "PrivateInterface"}, 135 "PrivateInterface"},
136 136
137 //Do not inherit private interface method with generic parameters. 137 //Do not inherit private interface method with generic parameters.
138 //This method has been implemented. 138 //This method has been implemented.
139 {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html", 139 {BUG_ID + "-1" + FS + "pkg2" + FS + "C.html",
140 "<STRONG><A HREF=\"../pkg2/I.html#hello(T)\">hello</A></STRONG>"}, 140 "<strong><a href=\"../pkg2/I.html#hello(T)\">hello</a></strong>"},
141 }; 141 };
142 142
143 // Test output when -private flag is used. 143 // Test output when -private flag is used.
144 private static final String[][] TEST2 = { 144 private static final String[][] TEST2 = {
145 // Field inheritence from non-public superclass. 145 // Field inheritence from non-public superclass.
146 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 146 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
147 "Fields inherited from class " + 147 "Fields inherited from class&nbsp;pkg." +
148 "pkg.<A HREF=\"../pkg/PrivateParent.html\" " + 148 "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
149 "title=\"class in pkg\">PrivateParent</A>" 149 "PrivateParent</a>"
150 }, 150 },
151 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 151 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
152 "<A HREF=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" + 152 "<a href=\"../pkg/PrivateParent.html#fieldInheritedFromParent\">" +
153 "fieldInheritedFromParent</A>" 153 "fieldInheritedFromParent</a>"
154 }, 154 },
155 // Field inheritence from non-public superinterface. 155 // Field inheritence from non-public superinterface.
156 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", 156 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
157 "Fields inherited from interface " + 157 "Fields inherited from interface&nbsp;pkg." +
158 "pkg.<A HREF=\"../pkg/PrivateInterface.html\" " + 158 "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
159 "title=\"interface in pkg\">PrivateInterface</A>" 159 "PrivateInterface</a>"
160 }, 160 },
161 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", 161 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
162 "<A HREF=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" + 162 "<a href=\"../pkg/PrivateInterface.html#fieldInheritedFromInterface\">" +
163 "fieldInheritedFromInterface</A>" 163 "fieldInheritedFromInterface</a>"
164 }, 164 },
165 // Method inheritence from non-public superclass. 165 // Method inheritence from non-public superclass.
166 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 166 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
167 "Methods inherited from class " + 167 "Methods inherited from class&nbsp;pkg." +
168 "pkg.<A HREF=\"../pkg/PrivateParent.html\" " + 168 "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
169 "title=\"class in pkg\">PrivateParent</A>" 169 "PrivateParent</a>"
170 }, 170 },
171 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 171 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
172 "<A HREF=\"../pkg/PrivateParent.html#methodInheritedFromParent(int)\">" + 172 "<a href=\"../pkg/PrivateParent.html#methodInheritedFromParent(int)\">" +
173 "methodInheritedFromParent</A>" 173 "methodInheritedFromParent</a>"
174 }, 174 },
175 // Should document that a method overrides method from private class. 175 // Should document that a method overrides method from private class.
176 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 176 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
177 "<STRONG>Overrides:</STRONG></DT><DD><CODE>" + 177 "<dt><strong>Overrides:</strong></dt>" + NL +
178 "<A HREF=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" + 178 "<dd><code><a href=\"../pkg/PrivateParent.html#methodOverridenFromParent(char[], int, T, V, java.util.List)\">" +
179 "methodOverridenFromParent</A></CODE> in class <CODE>" + 179 "methodOverridenFromParent</a></code>&nbsp;in class&nbsp;<code>" +
180 "<A HREF=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" + 180 "<a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
181 "PrivateParent</A></CODE></DD>" + NL + "</DL>"}, 181 "PrivateParent</a></code></dd>"},
182 // Should document that a method is specified by private interface. 182 // Should document that a method is specified by private interface.
183 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 183 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
184 "<STRONG>Specified by:</STRONG></DT><DD><CODE>" + 184 "<dt><strong>Specified by:</strong></dt>" + NL +
185 "<A HREF=\"../pkg/PrivateInterface.html#methodInterface(int)\">" + 185 "<dd><code><a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
186 "methodInterface</A></CODE> in interface <CODE>" + 186 "methodInterface</a></code>&nbsp;in interface&nbsp;<code>" +
187 "<A HREF=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" + 187 "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
188 "PrivateInterface</A></CODE></DD>" + NL + "</DL>" + NL + "</DD>"}, 188 "PrivateInterface</a></code></dd>"},
189 // Method inheritence from non-public superinterface. 189 // Method inheritence from non-public superinterface.
190 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", 190 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
191 "Methods inherited from interface " + 191 "Methods inherited from interface&nbsp;pkg." +
192 "pkg.<A HREF=\"../pkg/PrivateInterface.html\" " + 192 "<a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
193 "title=\"interface in pkg\">PrivateInterface</A>" 193 "PrivateInterface</a>"
194 }, 194 },
195 {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateInterface.html", 195 {BUG_ID + "-2" + FS + "pkg" + FS + "PrivateInterface.html",
196 "<A HREF=\"../pkg/PrivateInterface.html#methodInterface(int)\">" + 196 "<a href=\"../pkg/PrivateInterface.html#methodInterface(int)\">" +
197 "methodInterface</A>" 197 "methodInterface</a>"
198 }, 198 },
199 // Should mention that any documentation was copied. 199 // Should mention that any documentation was copied.
200 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 200 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
201 "Description copied from"}, 201 "Description copied from"},
202 // Extend documented private classes or interfaces 202 // Extend documented private classes or interfaces
207 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", 207 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
208 "All Superinterfaces"}, 208 "All Superinterfaces"},
209 209
210 //Make sure implemented interfaces from private superclass are inherited 210 //Make sure implemented interfaces from private superclass are inherited
211 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html", 211 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicInterface.html",
212 "<STRONG>All Known Implementing Classes:</STRONG></DT> <DD><A HREF=\"../pkg/PrivateParent.html\" " + 212 "<dl>" + NL + "<dt>All Known Implementing Classes:</dt>" + NL +
213 "title=\"class in pkg\">PrivateParent</A>, " + 213 "<dd><a href=\"../pkg/PrivateParent.html\" title=\"class in pkg\">" +
214 "<A HREF=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild</A>"}, 214 "PrivateParent</a>, " +
215 "<a href=\"../pkg/PublicChild.html\" title=\"class in pkg\">PublicChild" +
216 "</a></dd>" + NL + "</dl>"},
215 217
216 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html", 218 {BUG_ID + "-2" + FS + "pkg" + FS + "PublicChild.html",
217 "<STRONG>All Implemented Interfaces:</STRONG></DT> <DD><A HREF=\"../pkg/PrivateInterface.html\" " + 219 "<dl>" + NL + "<dt>All Implemented Interfaces:</dt>" + NL +
218 "title=\"interface in pkg\">PrivateInterface</A>, " + 220 "<dd><a href=\"../pkg/PrivateInterface.html\" title=\"interface in pkg\">" +
219 "<A HREF=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" + 221 "PrivateInterface</a>, " +
220 "PublicInterface</A>"}, 222 "<a href=\"../pkg/PublicInterface.html\" title=\"interface in pkg\">" +
223 "PublicInterface</a></dd>" + NL + "</dl>"},
221 224
222 //Since private flag is used, we can document that private interface method 225 //Since private flag is used, we can document that private interface method
223 //with generic parameters has been implemented. 226 //with generic parameters has been implemented.
224 {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html", 227 {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
225 "<STRONG>Description copied from interface: " + 228 "<strong>Description copied from interface:&nbsp;<code>" +
226 "<CODE><A HREF=\"../pkg2/I.html#hello(T)\">I</A></CODE></STRONG>"}, 229 "<a href=\"../pkg2/I.html#hello(T)\">I</a></code></strong>"},
227 230
228 {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html", 231 {BUG_ID + "-2" + FS + "pkg2" + FS + "C.html",
229 "<STRONG>Specified by:</STRONG></DT><DD><CODE><A HREF=\"../pkg2/I.html#hello(T)\">" + 232 "<dt><strong>Specified by:</strong></dt>" + NL +
230 "hello</A></CODE> in interface <CODE><A HREF=\"../pkg2/I.html\" " + 233 "<dd><code><a href=\"../pkg2/I.html#hello(T)\">hello</a></code>" +
231 "title=\"interface in pkg2\">I</A>"}, 234 "&nbsp;in interface&nbsp;<code>" +
235 "<a href=\"../pkg2/I.html\" title=\"interface in pkg2\">I</a>" +
236 "&lt;java.lang.String&gt;</code></dd>"},
232 }; 237 };
233 private static final String[][] NEGATED_TEST2 = NO_TEST; 238 private static final String[][] NEGATED_TEST2 = NO_TEST;
234 239
235 /** 240 /**
236 * The entry point of the test. 241 * The entry point of the test.

mercurial