bpatel@1568: /* bpatel@1568: * Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved. bpatel@1568: * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. bpatel@1568: * bpatel@1568: * This code is free software; you can redistribute it and/or modify it bpatel@1568: * under the terms of the GNU General Public License version 2 only, as bpatel@1568: * published by the Free Software Foundation. bpatel@1568: * bpatel@1568: * This code is distributed in the hope that it will be useful, but WITHOUT bpatel@1568: * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or bpatel@1568: * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License bpatel@1568: * version 2 for more details (a copy is included in the LICENSE file that bpatel@1568: * accompanied this code). bpatel@1568: * bpatel@1568: * You should have received a copy of the GNU General Public License version bpatel@1568: * 2 along with this work; if not, write to the Free Software Foundation, bpatel@1568: * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. bpatel@1568: * bpatel@1568: * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA bpatel@1568: * or visit www.oracle.com if you need additional information or have any bpatel@1568: * questions. bpatel@1568: */ bpatel@1568: bpatel@1568: /* bpatel@1568: * @test bpatel@2084: * @bug 8006124 8009684 8016921 8023700 8024096 8008164 bpatel@1568: * @summary Test javadoc support for profiles. jjg@1999: * @author Bhavesh Patel, Evgeniya Stepanova bpatel@1568: * @library ../lib/ bpatel@1568: * @build JavadocTester TestProfiles bpatel@1568: * @run main TestProfiles bpatel@1568: */ bpatel@1568: public class TestProfiles extends JavadocTester { bpatel@1568: bpatel@1568: //Test information. bpatel@1952: private static final String BUG_ID = "8006124-8009684-8016921"; bpatel@1568: private static final String PROFILE_BUG_ID = BUG_ID + "-1"; bpatel@1568: private static final String PACKAGE_BUG_ID = BUG_ID + "-2"; bpatel@1568: //Javadoc arguments. bpatel@1568: private static final String[] ARGS1 = new String[]{ jjg@1999: "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", jjg@1999: SRC_DIR + FS + "profile-rtjar-includes.txt", "pkg1", "pkg2", jjg@1999: "pkg3", "pkg4", "pkg5", "pkgDeprecated" bpatel@1568: }; bpatel@1568: private static final String[] ARGS2 = new String[]{ bpatel@1568: "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" bpatel@1568: }; bpatel@1568: //Input for string tests for profiles. bpatel@1568: private static final String[][] PROFILES_TEST = { bpatel@1568: // Tests for profile-overview-frame.html listing all profiles. bpatel@1568: {PROFILE_BUG_ID + FS + "profile-overview-frame.html", bpatel@1568: "All Packages" bpatel@1568: }, bpatel@1568: {PROFILE_BUG_ID + FS + "profile-overview-frame.html", bpatel@1635: "
  • " bpatel@1568: + "compact1
  • " bpatel@1568: }, bpatel@1568: // Tests for profileName-frame.html listing all packages in a profile. bpatel@1568: {PROFILE_BUG_ID + FS + "compact2-frame.html", bpatel@1635: "" jjg@1993: + "All PackagesAll Profiles" bpatel@1568: }, bpatel@1568: {PROFILE_BUG_ID + FS + "compact2-frame.html", bpatel@1568: "
  • pkg4
  • " bpatel@1568: }, bpatel@1568: // Test for profileName-package-frame.html listing all types in a bpatel@1568: // package of a profile. bpatel@1568: {PROFILE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html", bpatel@1568: "" bpatel@1568: + "compact2 - pkg2" bpatel@1568: }, bpatel@1568: // Tests for profileName-summary.html listing the summary for a profile. bpatel@1568: {PROFILE_BUG_ID + FS + "compact2-summary.html", jjg@1993: "
  • Prev Profile
  • " + NL jjg@1993: + "
  • Next Profile
  • " bpatel@1568: }, bpatel@1568: {PROFILE_BUG_ID + FS + "compact2-summary.html", bpatel@1568: "

    Profile compact2

    " bpatel@1568: }, bpatel@1568: {PROFILE_BUG_ID + FS + "compact2-summary.html", bpatel@1568: "

    pkg2

    " bpatel@1568: }, bpatel@1568: // Tests for profileName-package-summary.html listing the summary for a bpatel@1568: // package in a profile. bpatel@1568: {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", jjg@1993: "
  • Prev Package" bpatel@1568: + "
  • " bpatel@1568: }, bpatel@1568: {PROFILE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html", bpatel@1568: "
    compact3
    " bpatel@1568: }, bpatel@1568: //Test for "overview-frame.html" showing the "All Profiles" link. bpatel@1568: {PROFILE_BUG_ID + FS + "overview-frame.html", bpatel@1568: "All Profiles" bpatel@1568: }, bpatel@1568: //Test for "className.html" showing the profile information for the type. bpatel@1568: {PROFILE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", bpatel@1568: "
    compact1, compact2, compact3
    " bpatel@1635: }, bpatel@1635: {PROFILE_BUG_ID + FS + "index.html", bpatel@1635: "" bpatel@1952: }, bpatel@1952: //Test for "overview-summary.html" showing the profile list. bpatel@1952: {PROFILE_BUG_ID + FS + "overview-summary.html", bpatel@1952: "" jjg@1999: }, jjg@1999: //Test deprecated class in profiles jjg@1999: {PROFILE_BUG_ID + FS + "compact1-summary.html","" jjg@1999: + "Class1Pkg2" jjg@1999: + NL + "Deprecated" jjg@1999: }, jjg@1999: {PROFILE_BUG_ID + FS + "deprecated-list.html","" jjg@1999: + "pkg2.Class1Pkg2" jjg@1999: + NL +"
    Class1Pkg2. This class is deprecated
    " jjg@1999: }, jjg@1999: //Test deprecated package in profile jjg@1999: {PROFILE_BUG_ID + FS + "deprecated-list.html","" jjg@1999: + "pkgDeprecated" jjg@1999: + NL +"
    This package is Deprecated." jjg@1999: + " Use pkg1.
    " jjg@1999: }, jjg@1999: {PROFILE_BUG_ID + FS + "pkgDeprecated" + FS + "package-summary.html", jjg@1999: "
    Deprecated." jjg@1999: + NL + "
    This package is Deprecated." jjg@1999: + " Use pkg1.
    " jjg@1999: }, jjg@1999: // need to add teststring when JDK-8015496 will be fixed jjg@1999: //Test exception in profiles bpatel@2084: {PROFILE_BUG_ID + FS + "compact1-summary.html","" jjg@1999: + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" jjg@1999: + NL + "" jjg@1999: }, jjg@1999: //Test errors in profiles jjg@1999: {PROFILE_BUG_ID + FS + "compact1-summary.html", bpatel@2084: "
    Exception Summary" jjg@1999: + " 
    Exception" jjg@1999: + "Description
    ClassException
    " jjg@1999: + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" jjg@1999: + NL + "" + NL + "" bpatel@1568: } bpatel@1568: }; bpatel@1568: private static final String[][] PROFILES_NEGATED_TEST = { bpatel@1568: {PROFILE_BUG_ID + FS + "pkg3" + FS + "Class2Pkg3.html", bpatel@1568: "
    compact1" bpatel@1568: }, bpatel@1568: {PROFILE_BUG_ID + FS + "pkg3" + FS + "Interface1Pkg3.html", bpatel@1568: "
    compact1" bpatel@1568: }, bpatel@1568: {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html", bpatel@1568: "
  • Anno1Pkg4
  • " jjg@1999: }, jjg@1999: {PROFILE_BUG_ID + FS + "compact1-summary.html","
  • Use
  • " bpatel@1568: } bpatel@1568: }; bpatel@1568: private static final String[][] PACKAGES_TEST = { bpatel@1568: {PACKAGE_BUG_ID + FS + "overview-frame.html", bpatel@1568: "

    Packages

    " bpatel@1568: }, bpatel@1568: {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-frame.html", bpatel@1568: "

    pkg4

    " bpatel@1568: }, bpatel@1568: {PACKAGE_BUG_ID + FS + "pkg4" + FS + "package-summary.html", bpatel@1568: "
    " + NL + "

    Package pkg4

    " + NL + "
    " bpatel@1568: } bpatel@1568: }; bpatel@1568: private static final String[][] PACKAGES_NEGATED_TEST = { bpatel@1568: {PACKAGE_BUG_ID + FS + "overview-frame.html", bpatel@1568: "All Profiles" bpatel@1568: }, bpatel@1568: {PACKAGE_BUG_ID + FS + "pkg2" + FS + "Class1Pkg2.html", bpatel@1568: "
    compact1, compact2, compact3
    " bpatel@1952: }, bpatel@1952: {PACKAGE_BUG_ID + FS + "overview-summary.html", bpatel@1952: "" bpatel@1568: } bpatel@1568: }; bpatel@2036: private static final String[] PACKAGES_NEGATED_FILE_TEST = { bpatel@2036: PACKAGE_BUG_ID + FS + "profile-overview-frame.html", bpatel@2036: PACKAGE_BUG_ID + FS + "compact2-frame.html", bpatel@2036: PACKAGE_BUG_ID + FS + "pkg2" + FS + "compact2-package-frame.html", bpatel@2036: PACKAGE_BUG_ID + FS + "compact2-summary.html", bpatel@2036: PACKAGE_BUG_ID + FS + "pkg5" + FS + "compact3-package-summary.html" bpatel@2036: }; bpatel@1568: bpatel@1568: /** bpatel@1568: * The entry point of the test. bpatel@1568: * bpatel@1568: * @param args the array of command line arguments. bpatel@1568: */ bpatel@1568: public static void main(String[] args) { bpatel@1568: TestProfiles tester = new TestProfiles(); bpatel@1568: run(tester, ARGS1, PROFILES_TEST, PROFILES_NEGATED_TEST); bpatel@2036: run(tester, ARGS2, PACKAGES_TEST, PACKAGES_NEGATED_TEST, NO_FILE_TEST, PACKAGES_NEGATED_FILE_TEST); bpatel@1568: tester.printSummary(); bpatel@1568: } bpatel@1568: bpatel@1568: /** bpatel@1568: * {@inheritDoc} bpatel@1568: */ bpatel@1568: public String getBugId() { bpatel@1568: return BUG_ID; bpatel@1568: } bpatel@1568: bpatel@1568: /** bpatel@1568: * {@inheritDoc} bpatel@1568: */ bpatel@1568: public String getBugName() { bpatel@1568: return getClass().getName(); bpatel@1568: } bpatel@1568: }
    Error Summary " jjg@1999: + "
    ErrorDescription
    " jjg@1999: + "ClassError