test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java

Wed, 11 Sep 2013 14:50:11 -0700

author
bpatel
date
Wed, 11 Sep 2013 14:50:11 -0700
changeset 2023
cf37c3775397
parent 1999
7993cfab8610
child 2147
130b8c0e570e
permissions
-rw-r--r--

8015496: Information that package is deprecated is missing in profiles view
Reviewed-by: jjg

     1 /*
     2  * Copyright (c) 2013, 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  */
    24 /*
    25  * @test
    26  * @bug      8006124 8009684 8015663 8015496
    27  * @summary  Test javadoc options support for profiles.
    28  * @author   Evgeniya Stepanova
    29  * @library  ../lib/
    30  * @build    JavadocTester TestProfilesConfiguration
    31  * @run main TestProfilesConfiguration
    32  */
    33 public class TestProfilesConfiguration extends JavadocTester {
    35     //Test information.
    36     private static final String BUG_ID = "8006124-8009684";
    37     private static final String PROFILE_CONFIGURATION_BUG_ID = BUG_ID + "-3";
    38     private static final String NODEPR_NOPKGS_BUG_ID = BUG_ID + "-4";
    39     //Javadoc arguments.
    40     private static final String[] ARGS3 = new String[]{
    41         "-d", PROFILE_CONFIGURATION_BUG_ID, "-sourcepath", SRC_DIR, "-nocomment",
    42         "-keywords", "-Xprofilespath", SRC_DIR + FS + "profile-rtjar-includes.txt",
    43         "-doctitle", "Simple doctitle", "-use", "pkg3", "pkg1", "pkg2", "pkg4",
    44         "pkg5", "-packagesheader", "Simple packages header","pkgDeprecated"
    45     };
    46     private static final String[] ARGS4 = new String[]{
    47         "-d", NODEPR_NOPKGS_BUG_ID, "-sourcepath", SRC_DIR, "-nocomment", "-nodeprecated",
    48         "-keywords", "-Xprofilespath", SRC_DIR + FS + "profile-rtjar-includes-nopkgs.txt",
    49         "-doctitle", "Simple doctitle", "-use", "-packagesheader", "Simple packages header",
    50         "pkg1", "pkg2", "pkg3", "pkg4", "pkg5", "pkgDeprecated"
    51     };
    52     private static final String[][] NODEPR_NOPKGS_TEST = {
    53         {NODEPR_NOPKGS_BUG_ID + FS + "overview-summary.html",
    54             "<ul>" + NL + "<li><a href=\"compact2-summary.html\" target=\"classFrame\">" +
    55             "compact2</a></li>" + NL + "<li><a href=\"compact3-summary.html\" target=\"" +
    56             "classFrame\">compact3</a></li>" + NL + "</ul>"
    57         },
    58         {NODEPR_NOPKGS_BUG_ID + FS + "profile-overview-frame.html",
    59             "<ul title=\"Profiles\">" + NL + "<li><a href=\"compact2-frame.html\" target=\"packageListFrame\">" +
    60             "compact2</a></li>" + NL + "<li><a href=\"compact3-frame.html\" target=\"" +
    61             "packageListFrame\">compact3</a></li>" + NL + "</ul>"
    62         }
    63     };
    64     private static final String[][] NODEPR_NOPKGS_NEGATED_TEST = {
    65         {NODEPR_NOPKGS_BUG_ID + FS + "overview-summary.html",
    66             "compact1"
    67         }
    68     };
    70     private static final String[][] PROFILES_CONFIGURATION_TEST = {
    71         //-use option test string fo profile view page
    72         {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html","<li>Use</li>"
    73         },
    74         //-doctitle option test string
    75         {PROFILE_CONFIGURATION_BUG_ID + FS + "overview-summary.html",
    76             "<div class=\"header\">" + NL + "<h1 class=\"title\">Simple doctitle</h1>"
    77         },
    78         //-packagesheader option test string fo profiles
    79         {PROFILE_CONFIGURATION_BUG_ID + FS + "profile-overview-frame.html",
    80             "<h1 title=\"Simple packages header\" class=\"bar\">Simple packages header</h1>"
    81         },
    82         //-keywords option test string for profiles
    83         {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html",
    84             "<meta name=\"keywords\" content=\"compact1 profile\">"
    85         },
    86         //Deprecated information on a package
    87         {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html",
    88             "<h3><a href=\"pkgDeprecated/compact1-package-summary.html\" target=\"" +
    89             "classFrame\">pkgDeprecated</a></h3>" + NL + "<div class=\"deprecatedContent\">" +
    90             "<span class=\"strong\">Deprecated.</span></div>"
    91         }
    92     };
    93     private static final String[][] PROFILES_CONFIGURATION_NEGATED_TEST = {
    94         //-nocomments option test string
    95         {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html",
    96             "<div class=\"block\"><i>Class1Pkg2.</i></div>"
    97         }
    98     };
   100     /**
   101      * The entry point of the test.
   102      *
   103      * @param args the array of command line arguments.
   104      */
   105     public static void main(String[] args) {
   106         TestProfilesConfiguration tester = new TestProfilesConfiguration();
   107         run(tester, ARGS3, PROFILES_CONFIGURATION_TEST,
   108         PROFILES_CONFIGURATION_NEGATED_TEST);
   109         run(tester, ARGS4, NODEPR_NOPKGS_TEST,
   110         NODEPR_NOPKGS_NEGATED_TEST);
   111         tester.printSummary();
   112     }
   114     /**
   115      * {@inheritDoc}
   116      */
   117     public String getBugId() {
   118         return BUG_ID;
   119     }
   121     /**
   122      * {@inheritDoc}
   123      */
   124     public String getBugName() {
   125         return getClass().getName();
   126     }
   127 }

mercurial