/* * Copyright (c) 2013, 2015, Oracle and/or its affiliates. All rights reserved. * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. * * This code is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License version 2 only, as * published by the Free Software Foundation. * * This code is distributed in the hope that it will be useful, but WITHOUT * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License * version 2 for more details (a copy is included in the LICENSE file that * accompanied this code). * * You should have received a copy of the GNU General Public License version * 2 along with this work; if not, write to the Free Software Foundation, * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. * * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA * or visit www.oracle.com if you need additional information or have any * questions. */ /* * @test * @bug 8025633 8025524 8081854 * @summary Test for valid name attribute in HTML anchors. * @author Bhavesh Patel * @library ../lib * @modules jdk.javadoc * @build JavadocTester * @run main TestAnchorNames */ public class TestAnchorNames extends JavadocTester { private static final String[] ARGS = new String[] { }; public static void main(String[] args) throws Exception { TestAnchorNames tester = new TestAnchorNames(); tester.runTests(); } @Test void test() { javadoc("-d", "out", "-sourcepath", testSrc, "-source", "8", //so that '_' can be used as an identifier "-use", "pkg1"); checkExit(Exit.OK); // Test some section markers and links to these markers checkOutput("pkg1/RegClass.html", true, "", "", "", "", "", "", "", "", "", ""); // Test some members and link to these members checkOutput("pkg1/RegClass.html", true, //The marker for this appears in the serialized-form.html which we will //test below ""); // Test some fields checkOutput("pkg1/RegClass.html", true, "", "", "", "", "", "", "", "", "", "", "", "", "", ""); checkOutput("pkg1/DeprMemClass.html", true, "", ""); // Test constructor checkOutput("pkg1/RegClass.html", true, "", ""); // Test some methods checkOutput("pkg1/RegClass.html", true, "", "", "", "", "", "", "", "", "", "", "", "", "", ""); checkOutput("pkg1/DeprMemClass.html", true, "", ""); // Test enum checkOutput("pkg1/RegClass.Te$t_Enum.html", true, "", ""); // Test nested class checkOutput("pkg1/RegClass._NestedClas$.html", true, "", ""); // Test class use page checkOutput("pkg1/class-use/DeprMemClass.html", true, ""); // Test deprecated list page checkOutput("deprecated-list.html", true, "", ""); // Test constant values page checkOutput("constant-values.html", true, ""); // Test serialized form page checkOutput("serialized-form.html", true, //This is the marker for the link that appears in the pkg1.RegClass.html page ""); // Test member name index page checkOutput("index-all.html", true, "", "$", "_"); // The marker name conversion should only affect HTML anchors. It should not // affect the lables. checkOutput("pkg1/RegClass.html", false, " Z:Z_", " Z:Z:Dfield", " Z:Z_field_In_Class", " S_:D:D:D:D:DINT"); } }