Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/test/com/sun/javadoc/testClassTree/TestClassTree.java
47854 views
/*1* Copyright (c) 2004, 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 4632553 4973607 802656726* @summary No need to include type name (class, interface, etc.) before27* every single type in class tree.28* Make sure class tree includes heirarchy for enums and annotation29* types.30* @author jamieh31* @library ../lib/32* @build JavadocTester33* @build TestClassTree34* @run main TestClassTree35*/3637public class TestClassTree extends JavadocTester {3839//Test information.40private static final String BUG_ID = "4632553-4973607";4142//Javadoc arguments.43private static final String[] ARGS = new String[] {44"-d", BUG_ID, "-source", "1.5","-sourcepath", SRC_DIR, "pkg"45};4647//Input for string search tests.48private static final String[][] TEST = {49{BUG_ID + FS + "pkg" + FS + "package-tree.html",50"<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/ParentClass.html\" " +51"title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a>"},5253{BUG_ID + FS + "pkg" + FS + "package-tree.html",54"<h2 title=\"Annotation Type Hierarchy\">Annotation Type Hierarchy</h2>" + NL +55"<ul>" + NL + "<li type=\"circle\">pkg.<a href=\"../pkg/AnnotationType.html\" " +56"title=\"annotation in pkg\"><span class=\"typeNameLink\">AnnotationType</span></a> " +57"(implements java.lang.annotation.Annotation)</li>" + NL + "</ul>"},5859{BUG_ID + FS + "pkg" + FS + "package-tree.html",60"<h2 title=\"Enum Hierarchy\">Enum Hierarchy</h2>" + NL + "<ul>" + NL +61"<li type=\"circle\">java.lang.Object" + NL + "<ul>" + NL +62"<li type=\"circle\">java.lang.Enum<E> (implements java.lang." +63"Comparable<T>, java.io.Serializable)" + NL + "<ul>" + NL +64"<li type=\"circle\">pkg.<a href=\"../pkg/Coin.html\" " +65"title=\"enum in pkg\"><span class=\"typeNameLink\">Coin</span></a></li>" + NL +66"</ul>" + NL + "</li>" + NL + "</ul>" + NL + "</li>" + NL + "</ul>"67},68};69private static final String[][] NEGATED_TEST = {70{BUG_ID + FS + "pkg" + FS + "package-tree.html",71"<li type=\"circle\">class pkg.<a href=\"../pkg/ParentClass.html\" " +72"title=\"class in pkg\"><span class=\"typeNameLink\">ParentClass</span></a></li>"}73};7475/**76* The entry point of the test.77* @param args the array of command line arguments.78*/79public static void main(String[] args) {80TestClassTree tester = new TestClassTree();81run(tester, ARGS, TEST, NEGATED_TEST);82tester.printSummary();83}8485/**86* {@inheritDoc}87*/88public String getBugId() {89return BUG_ID;90}9192/**93* {@inheritDoc}94*/95public String getBugName() {96return getClass().getName();97}98}99100101