1 /*
   2  * Copyright (c) 2013, 2015, 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 8008164
  27  * @summary Test styles on HTML tables generated by javadoc.
  28  * @author Bhavesh Patel
  29  * @library ../lib
  30  * @modules jdk.javadoc
  31  * @build JavadocTester
  32  * @run main TestHtmlTableStyles
  33  */
  34 
  35 public class TestHtmlTableStyles extends JavadocTester {
  36 
  37     public static void main(String... args) throws Exception {
  38         TestHtmlTableStyles tester = new TestHtmlTableStyles();
  39         tester.runTests();
  40     }
  41 
  42     @Test
  43     void test() {
  44         javadoc("-d", "out",
  45                 "-sourcepath", testSrc,
  46                 "-use",
  47                 "pkg1", "pkg2");
  48         checkExit(Exit.OK);
  49 
  50         checkOutput("pkg1/TestTable.html", true,
  51                 "<table summary=\"Summary\" border cellpadding=3 cellspacing=1>",
  52                 "<table class=\"memberSummary\" summary=\"Field Summary table, listing fields, "
  53                 + "and an explanation\">",
  54                 "<table class=\"memberSummary\" summary=\"Constructor Summary table, listing "
  55                 + "constructors, and an explanation\">",
  56                 "<table class=\"memberSummary\" summary=\"Method Summary table, listing methods, "
  57                 + "and an explanation\">");
  58 
  59         checkOutput("pkg1/package-summary.html", true,
  60                 "<table class=\"typeSummary\" summary=\"Class Summary table, listing classes, "
  61                 + "and an explanation\">");
  62 
  63         checkOutput("pkg1/class-use/TestTable.html", true,
  64                 "<table class=\"useSummary\" summary=\"Use table, listing fields, and an explanation\">");
  65 
  66         checkOutput("overview-summary.html", true,
  67                 "<table class=\"overviewSummary\" "
  68                 + "summary=\"Packages table, listing packages, and an explanation\">");
  69 
  70         checkOutput("deprecated-list.html", true,
  71             "<table class=\"deprecatedSummary\" summary=\"Deprecated Methods table, listing " +
  72             "deprecated methods, and an explanation\">");
  73 
  74         checkOutput("constant-values.html", true,
  75             "<table class=\"constantsSummary\" summary=\"Constant Field Values table, listing " +
  76             "constant fields, and values\">");
  77     }
  78 }