TestPrivateClasses.java revision 0
2362N/A * Copyright 2003-2004 Sun Microsystems, Inc. All Rights Reserved. 0N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 0N/A * This code is free software; you can redistribute it and/or modify it 0N/A * under the terms of the GNU General Public License version 2 only, as 0N/A * published by the Free Software Foundation. 0N/A * This code is distributed in the hope that it will be useful, but WITHOUT 0N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 0N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 0N/A * version 2 for more details (a copy is included in the LICENSE file that 0N/A * accompanied this code). 0N/A * You should have received a copy of the GNU General Public License version 0N/A * 2 along with this work; if not, write to the Free Software Foundation, 0N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 2362N/A * Please contact Sun Microsystems, Inc., 4150 Network Circle, Santa Clara, 2362N/A * CA 95054 USA or visit www.sun.com if you need additional information or 0N/A * @bug 4780441 4874845 4978816 0N/A * @summary Make sure that when the -private flag is not used, members 0N/A * inherited from package private class are documented in the child. 0N/A * Make sure that when a method inherits documentation from a method 0N/A * is not mentioned anywhere (not even in the signature or tree). 0N/A * Make sure that when a private interface method with generic parameters 0N/A * is implemented, the comments can be inherited properly. 0N/A * @build JavadocTester 0N/A * @build TestPrivateClasses 0N/A * @run main TestPrivateClasses 0N/A //Javadoc arguments. 0N/A "-source",
"1.5",
"pkg",
"pkg2" 0N/A // Test output when -private flag is not used. 0N/A // Field inheritence from non-public superclass. 0N/A "fieldInheritedFromParent</A>" 0N/A // Method inheritence from non-public superclass. 0N/A "methodInheritedFromParent</A>" 0N/A // Field inheritence from non-public superinterface. 0N/A "fieldInheritedFromInterface</A>" 0N/A // Method inheritence from non-public superinterface. 0N/A "methodInterface</A>" 0N/A // private class does not show up in tree "java.lang.Object" +
NL +
"ALT=\"extended by \"><B>pkg.PublicChild</B>" +
NL +
// Method is documented as though it is declared in the inheriting method. "public void <B>methodInheritedFromParent</B>(int p1)" //Make sure implemented interfaces from private superclass are inherited "title=\"class in pkg\">PublicChild</A>"},
"title=\"interface in pkg\">PublicInterface</A>"},
//Generic interface method test. "This comment should get copied to the implementing class"},
// Should not document that a method overrides method from private class. // Should not document that a method specified by private interface. // Should not mention that any documentation was copied. "Description copied from"},
"Description copied from"},
// Don't extend private classes or interfaces // Make inherited constant are documented correctly. //Do not inherit private interface method with generic parameters. //This method has been implemented. "<B><A HREF=\"../pkg2/I.html#hello(T)\">hello</A></B>"},
// Test output when -private flag is used. // Field inheritence from non-public superclass. "Fields inherited from class " +
"title=\"class in pkg\">PrivateParent</A>" "fieldInheritedFromParent</A>" // Field inheritence from non-public superinterface. "Fields inherited from interface " +
"title=\"interface in pkg\">PrivateInterface</A>" "fieldInheritedFromInterface</A>" // Method inheritence from non-public superclass. "Methods inherited from class " +
"title=\"class in pkg\">PrivateParent</A>" "methodInheritedFromParent</A>" // Should document that a method overrides method from private class. "<B>Overrides:</B><DD><CODE>" +
"methodOverridenFromParent</A></CODE> in class <CODE>" +
"PrivateParent</A></CODE></DL>"},
// Should document that a method is specified by private interface. "<B>Specified by:</B><DD><CODE>" +
"methodInterface</A></CODE> in interface <CODE>" +
"PrivateInterface</A></CODE></DL>" +
NL +
"</DD>"},
// Method inheritence from non-public superinterface. "Methods inherited from interface " +
"title=\"interface in pkg\">PrivateInterface</A>" // Should mention that any documentation was copied. "Description copied from"},
// Extend documented private classes or interfaces //Make sure implemented interfaces from private superclass are inherited "title=\"class in pkg\">PrivateParent</A>, " +
"title=\"interface in pkg\">PrivateInterface</A>, " +
//Since private flag is used, we can document that private interface method //with generic parameters has been implemented. "<B>Description copied from interface: " +
"<CODE><A HREF=\"../pkg2/I.html#hello(T)\">I</A></CODE></B>"},
"<B>Specified by:</B><DD><CODE><A HREF=\"../pkg2/I.html#hello(T)\">" +
"hello</A></CODE> in interface <CODE><A HREF=\"../pkg2/I.html\" " +
"title=\"interface in pkg2\">I</A>"},
* The entry point of the test. * @param args the array of command line arguments.