/* * Copyright (c) 2009, 2019, 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 6786688 8008164 8162363 8169819 8183037 8182765 8184205 * @summary HTML tables should have table summary, caption and table headers. * @library ../../lib * @modules jdk.javadoc/jdk.javadoc.internal.tool * @build javadoc.tester.* * @run main TestHtmlTableTags */ import javadoc.tester.JavadocTester; public class TestHtmlTableTags extends JavadocTester { //Javadoc arguments. private static final String[] ARGS = new String[] { }; public static void main(String... args) throws Exception { TestHtmlTableTags tester = new TestHtmlTableTags(); tester.runTests(); } @Test public void test() { javadoc("-d", "out", "-sourcepath", testSrc, "-use", "pkg1", "pkg2"); checkExit(Exit.OK); checkHtmlTableTag(); checkHtmlTableCaptions(); checkHtmlTableHeaders(); } /* * Tests for validating table tag for HTML tables */ void checkHtmlTableTag() { //Package summary checkOutput("pkg1/package-summary.html", true, "
\n", "
\n
"); checkOutput("pkg2/package-summary.html", true, "
\n
", "
\n
"); // Class documentation checkOutput("pkg1/C1.html", true, "
\n
", "
\n
"); checkOutput("pkg2/C2.html", true, "
\n
", "
\n
"); checkOutput("pkg2/C2.ModalExclusionType.html", true, "
\n
"); checkOutput("pkg2/C3.html", true, "
\n
"); checkOutput("pkg2/C4.html", true, "
\n
"); // Class use documentation checkOutput("pkg1/class-use/I1.html", true, "
\n
"); checkOutput("pkg1/class-use/C1.html", true, "
\n
", "
\n
"); checkOutput("pkg2/class-use/C2.html", true, "
\n
", "
\n
"); checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, "
\n
"); checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, "
\n
"); // Package use documentation checkOutput("pkg1/package-use.html", true, "
\n
", "
\n
"); checkOutput("pkg2/package-use.html", true, "
\n
", "
\n
"); // Deprecated checkOutput("deprecated-list.html", true, "
\n
", "
\n
"); // Constant values checkOutput("constant-values.html", true, "
\n
"); // Overview Summary checkOutput("index.html", true, "
\n
"); } /* * Tests for validating summary for HTML tables */ void checkHtmlTableSummaries() { //Package summary checkOutput("pkg1/package-summary.html", true, "
\n" + "
", "
\n" + "
"); checkOutput("pkg2/package-summary.html", true, "
\n" + "
", "
\n" + "
"); // Class documentation checkOutput("pkg1/C1.html", true, "
\n" + "
", "
\n", "
"); checkOutput("pkg2/C2.html", true, "
\n" + "
", "
\n" + "
"); checkOutput("pkg2/C2.ModalExclusionType.html", true, "
\n" + "
"); checkOutput("pkg2/C3.html", true, "
\n" + "
"); checkOutput("pkg2/C4.html", true, "
\n" + "
"); // Class use documentation checkOutput("pkg1/class-use/I1.html", true, "
\n" + "
"); checkOutput("pkg1/class-use/C1.html", true, "
\n" + "
", "
\n" + "
"); checkOutput("pkg2/class-use/C2.html", true, "
\n" + "
", "
\n" + "
"); checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, "
\n" + "
"); checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, "
\n" + "
"); // Package use documentation checkOutput("pkg1/package-use.html", true, "
\n" + "
", "
\n" + "
"); checkOutput("pkg2/package-use.html", true, "
\n" + "
", "
\n" + "
"); // Deprecated checkOutput("deprecated-list.html", true, "
\n" + "
", "
\n" + "
"); // Constant values checkOutput("constant-values.html", true, "
\n" + "
"); // Overview Summary checkOutput("index.html", true, "
\n" + "
"); } /* * Tests for validating caption for HTML tables */ void checkHtmlTableCaptions() { //Package summary checkOutput("pkg1/package-summary.html", true, "", ""); checkOutput("pkg2/package-summary.html", true, "", ""); // Class documentation checkOutput("pkg1/C1.html", true, "", "
\n"); checkOutput("pkg2/C2.html", true, "", ""); checkOutput("pkg2/C2.ModalExclusionType.html", true, ""); checkOutput("pkg2/C3.html", true, ""); checkOutput("pkg2/C4.html", true, ""); // Class use documentation checkOutput("pkg1/class-use/I1.html", true, ""); checkOutput("pkg1/class-use/C1.html", true, "", ""); checkOutput("pkg2/class-use/C2.html", true, "", ""); checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, ""); // Package use documentation checkOutput("pkg1/package-use.html", true, "", ""); checkOutput("pkg2/package-use.html", true, "", ""); // Deprecated checkOutput("deprecated-list.html", true, "", ""); // Constant values checkOutput("constant-values.html", true, ""); // Overview Summary checkOutput("index.html", true, ""); } /* * Test for validating headers for HTML tables */ void checkHtmlTableHeaders() { //Package summary checkOutput("pkg1/package-summary.html", true, "\n" + "", "\n" + ""); checkOutput("pkg2/package-summary.html", true, "\n" + "", "\n" + ""); // Class documentation checkOutput("pkg1/C1.html", true, "\n" + "\n" + "", "\n" + "\n" + ""); checkOutput("pkg2/C2.html", true, "\n" + "\n" + "", "\n" + ""); checkOutput("pkg2/C2.ModalExclusionType.html", true, "\n" + ""); checkOutput("pkg2/C3.html", true, "\n" + "\n" + ""); checkOutput("pkg2/C4.html", true, "\n" + "\n" + ""); // Class use documentation checkOutput("pkg1/class-use/I1.html", true, "\n" + ""); checkOutput("pkg1/class-use/C1.html", true, "\n" + "\n" + "", "\n" + "\n" + ""); checkOutput("pkg2/class-use/C2.html", true, "\n" + "\n" + "", "\n" + "\n" + ""); checkOutput("pkg2/class-use/C2.ModalExclusionType.html", true, "\n" + "", "\n" + "\n" + ""); // Package use documentation checkOutput("pkg1/package-use.html", true, "\n" + "", "\n" + ""); checkOutput("pkg2/package-use.html", true, "\n" + "", "\n" + ""); // Deprecated checkOutput("deprecated-list.html", true, "\n" + "", "\n" + ""); // Constant values checkOutput("constant-values.html", true, "\n" + "\n" + ""); // Overview Summary checkOutput("index.html", true, "\n" + ""); } }
Class Summary" + " Interface Summary" + " Enum Summary" + " Annotation Types Summary" + " Fields Nested Classes Constructors Enum Constants Required Elements " + "Optional Elements " + "Packages that use I1" + " Fields in " + "pkg2 declared as C1 " + "Methods in " + "pkg2 that return C1" + " Fields in " + "pkg1 declared as C2" + " Methods in " + "pkg1 that return C2" + " Methods in " + "pkg2 that return C2.ModalExclusionType" + " Packages that use " + "pkg1 Classes in " + "pkg1 used by pkg1" + " Packages that use " + "pkg2 Classes in " + "pkg2 used by pkg1" + " Fields" + " Methods" + " pkg1." + "C1 Packages 
" + "ClassDescription" + "InterfaceDescription" + "EnumDescription" + "Annotation TypeDescriptionModifier and TypeFieldDescriptionModifier and TypeMethodDescriptionModifier and TypeClassDescriptionConstructorDescriptionEnum ConstantDescriptionModifier and TypeRequired ElementDescriptionModifier and TypeOptional ElementDescriptionPackageDescriptionModifier and TypeFieldDescriptionModifier and TypeMethodDescriptionModifier and TypeFieldDescriptionModifier and TypeMethodDescriptionPackageDescriptionModifier and TypeMethodDescriptionPackageDescriptionClassDescriptionPackageDescriptionClassDescriptionFieldDescriptionMethodDescription" + "Modifier and TypeConstant FieldValue" + "PackageDescription