Path: blob/master/test/langtools/jdk/javadoc/doclet/testClassTree/TestClassTree.java
40971 views
/*1* Copyright (c) 2004, 2020, 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* @library ../../lib31* @modules jdk.javadoc/jdk.javadoc.internal.tool32* @build javadoc.tester.*33* @run main TestClassTree34*/3536import javadoc.tester.JavadocTester;3738public class TestClassTree extends JavadocTester {3940public static void main(String... args) throws Exception {41TestClassTree tester = new TestClassTree();42tester.runTests();43}4445@Test46public void test() {47javadoc("-d", "out",48"--no-platform-links",49"-sourcepath", testSrc,50"pkg");51checkExit(Exit.OK);5253checkOutput("pkg/package-tree.html", true,54"""55<ul>56<li class="circle">pkg.<a href="ParentClass.html" class="type-name-link" title="\57class in pkg">ParentClass</a>""",58"""59<h2 title="Annotation Interface Hierarchy">Annotation Interface Hierarchy</h2>60<ul>61<li class="circle">pkg.<a href="AnnotationType.html" class="type-name-link" titl\62e="annotation interface in pkg">AnnotationType</a> (implements java.lang.annotat\63ion.Annotation)</li>64</ul>""",65"""66<h2 title="Enum Class Hierarchy">Enum Class Hierarchy</h2>67<ul>68<li class="circle">java.lang.Object69<ul>70<li class="circle">java.lang.Enum<E> (implements java.lang.Comparable<T\71>, java.lang.constant.Constable, java.io.Serializable)72<ul>73<li class="circle">pkg.<a href="Coin.html" class="type-name-link" title="enum cl\74ass in pkg">Coin</a></li>75</ul>76</li>77</ul>78</li>79</ul>""");8081checkOutput("pkg/package-tree.html", false,82"""83<li class="circle">class pkg.<a href=".ParentClass.html" class="type-name-link" \84title="class in pkg">ParentClass</a></li>""");85}86}878889