1 /* 2 * Copyright (c) 2016, 2019, Oracle and/or its affiliates. All rights reserved. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4 * 5 * This code is free software; you can redistribute it and/or modify it 6 * under the terms of the GNU General Public License version 2 only, as 7 * published by the Free Software Foundation. 8 * 9 * This code is distributed in the hope that it will be useful, but WITHOUT 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License 12 * version 2 for more details (a copy is included in the LICENSE file that 13 * accompanied this code). 14 * 15 * You should have received a copy of the GNU General Public License version 16 * 2 along with this work; if not, write to the Free Software Foundation, 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. 18 * 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA 20 * or visit www.oracle.com if you need additional information or have any 21 * questions. 22 */ 23 24 /* 25 * @test 26 * @bug 8073100 8182765 8196202 27 * @summary ensure the hidden tag works as intended 28 * @library ../../lib 29 * @modules jdk.javadoc/jdk.javadoc.internal.tool 30 * @build javadoc.tester.* 31 * @run main TestHiddenTag 32 */ 33 34 import javadoc.tester.JavadocTester; 35 36 public class TestHiddenTag extends JavadocTester { 37 38 public static void main(String... args) throws Exception { 39 TestHiddenTag tester = new TestHiddenTag(); 40 tester.runTests(); 41 } 42 43 /** 44 * Perform tests on @hidden tags 45 */ 46 @Test 47 public void test1() { 48 javadoc("-d", "out1", 49 "-sourcepath", testSrc, 50 "-package", 51 "pkg1"); 52 checkExit(Exit.OK); 53 54 checkOutput("pkg1/A.html", true, 55 "<a id=\"visibleField\">", 56 "<a id=\"visibleMethod()\">", 57 "<dt>Direct Known Subclasses:</dt>\n" + 58 "<dd><code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" + 59 "A.VisibleInner</a></code>, <code><a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " + 60 "title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></dd>"); 61 62 checkOutput("pkg1/A.html", false, 63 "<a id=\"inVisibleField\">", 64 "<a id=\"inVisibleMethod()\">"); 65 66 checkOutput("pkg1/A.VisibleInner.html", true, 67 "<code><a href=\"A.html#visibleField\">visibleField</a></code>", 68 "<code><a href=\"A.html#visibleMethod()\">visibleMethod</a></code>", 69 "<h2>Nested classes/interfaces inherited from class pkg1." + 70 "<a href=\"A.html\" title=\"class in pkg1\">A</a></h2>\n" + 71 "<a id=\"nested.classes.inherited.from.class.pkg1.A\">\n" + 72 "<!-- -->\n" + 73 "</a><code><a href=\"A.VisibleInner.html\" title=\"class in pkg1\">" + 74 "A.VisibleInner</a>, <a href=\"A.VisibleInnerExtendsInvisibleInner.html\" " + 75 "title=\"class in pkg1\">A.VisibleInnerExtendsInvisibleInner</a></code></div>\n"); 76 77 checkOutput("pkg1/A.VisibleInner.html", false, 78 "../pkg1/A.VisibleInner.html#VisibleInner()", 79 "<a id=\"inVisibleField\">", 80 "<a id=\"inVisibleMethod()\">"); 81 82 checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", true, 83 "<pre>public static class <span class=\"typeNameLabel\">" + 84 "A.VisibleInnerExtendsInvisibleInner</span>\n" + 85 "extends <a href=\"A.html\" title=\"class in pkg1\">A</a></pre>", 86 "<code><a href=\"A.html#visibleField\">visibleField</a></code>", 87 "<code><a href=\"A.html#visibleMethod()\">visibleMethod</a></code>"); 88 89 checkOutput("pkg1/A.VisibleInnerExtendsInvisibleInner.html", false, 90 "invisibleField", 91 "invisibleMethod", 92 "A.InvisibleInner"); 93 94 checkOutput("pkg1/package-summary.html", false, "A.InvisibleInner"); 95 96 checkOutput("pkg1/package-tree.html", false, "A.InvisibleInner"); 97 98 checkFiles(false, 99 "pkg1/A.InvisibleInner.html", 100 "pkg1/A.InvisibleInnerExtendsVisibleInner.html"); 101 } 102 }