diff --git a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java index 5f84abfe7ba..8dda141791c 100644 --- a/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java +++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfiles.java @@ -25,7 +25,7 @@ * @test * @bug 8006124 8009684 8016921 8023700 * @summary Test javadoc support for profiles. - * @author Bhavesh Patel + * @author Bhavesh Patel, Evgeniya Stepanova * @library ../lib/ * @build JavadocTester TestProfiles * @run main TestProfiles @@ -38,8 +38,9 @@ public class TestProfiles extends JavadocTester { private static final String PACKAGE_BUG_ID = BUG_ID + "-2"; //Javadoc arguments. private static final String[] ARGS1 = new String[]{ - "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", SRC_DIR + FS - + "profile-rtjar-includes.txt", "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" + "-d", PROFILE_BUG_ID, "-sourcepath", SRC_DIR, "-Xprofilespath", + SRC_DIR + FS + "profile-rtjar-includes.txt", "pkg1", "pkg2", + "pkg3", "pkg4", "pkg5", "pkgDeprecated" }; private static final String[] ARGS2 = new String[]{ "-d", PACKAGE_BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2", "pkg3", "pkg4", "pkg5" @@ -113,6 +114,49 @@ public class TestProfiles extends JavadocTester { "target=\"classFrame\">compact2" + NL + "
  • compact3
  • " + NL + "" + }, + //Test deprecated class in profiles + {PROFILE_BUG_ID + FS + "compact1-summary.html","" + + "Class1Pkg2" + + NL + "Deprecated" + }, + {PROFILE_BUG_ID + FS + "deprecated-list.html","" + + "pkg2.Class1Pkg2" + + NL +"
    Class1Pkg2. This class is deprecated
    " + }, + //Test deprecated package in profile + {PROFILE_BUG_ID + FS + "deprecated-list.html","" + + "pkgDeprecated" + + NL +"
    This package is Deprecated." + + " Use pkg1.
    " + }, + {PROFILE_BUG_ID + FS + "pkgDeprecated" + FS + "package-summary.html", + "
    Deprecated." + + NL + "
    This package is Deprecated." + + " Use pkg1.
    " + }, + // need to add teststring when JDK-8015496 will be fixed + //Test exception in profiles + {PROFILE_BUG_ID + FS + "compact1-summary.html","" + + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + + NL + "" + }, + //Test errors in profiles + {PROFILE_BUG_ID + FS + "compact1-summary.html", + "
    Exception Summary" + + " 
    Exception" + + "Description
    ClassException
    " + + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + NL + "" + + NL + "" + NL + "" } }; private static final String[][] PROFILES_NEGATED_TEST = { @@ -125,6 +169,8 @@ public class TestProfiles extends JavadocTester { {PROFILE_BUG_ID + FS + "pkg4" + FS + "compact2-package-frame.html", "
  • Anno1Pkg4
  • " + }, + {PROFILE_BUG_ID + FS + "compact1-summary.html","
  • Use
  • " } }; private static final String[][] PACKAGES_TEST = { diff --git a/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java b/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java new file mode 100644 index 00000000000..140728e1ac5 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testProfiles/TestProfilesConfiguration.java @@ -0,0 +1,94 @@ +/* + * Copyright (c) 2013, 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 8006124 8009684 8015663 + * @summary Test javadoc options support for profiles. + * @author Evgeniya Stepanova + * @library ../lib/ + * @build JavadocTester TestProfilesConfiguration + * @run main TestProfilesConfiguration + */ +public class TestProfilesConfiguration extends JavadocTester { + + //Test information. + private static final String BUG_ID = "8006124-8009684"; + private static final String PROFILE_CONFIGURATION_BUG_ID = BUG_ID + "-3"; + //Javadoc arguments. + private static final String[] ARGS3 = new String[]{ + "-d", PROFILE_CONFIGURATION_BUG_ID, "-sourcepath", SRC_DIR, "-nocomment", + "-keywords", "-Xprofilespath", SRC_DIR + FS + "profile-rtjar-includes.txt", + "-doctitle", "Simple doctitle", "-use", "pkg3", "pkg1", "pkg2", "pkg4", + "pkg5", "-packagesheader", "Simple packages header","pkgDeprecated" + }; + private static final String[][] PROFILES_CONFIGURATION_TEST = { + //-use option test string fo profile view page + {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html","
  • Use
  • " + }, + //-doctitle option test string + {PROFILE_CONFIGURATION_BUG_ID + FS + "overview-summary.html", + "
    " + NL + "

    Simple doctitle

    " + }, + //-packagesheader option test string fo profiles + {PROFILE_CONFIGURATION_BUG_ID + FS + "profile-overview-frame.html", + "

    Simple packages header

    " + }, + //-keywords option test string for profiles + {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html", + "" + } + }; + private static final String[][] PROFILES_CONFIGURATION_NEGATED_TEST = { + //-nocomments option test string + {PROFILE_CONFIGURATION_BUG_ID + FS + "compact1-summary.html", + "
    Class1Pkg2.
    " + } + }; + + /** + * The entry point of the test. + * + * @param args the array of command line arguments. + */ + public static void main(String[] args) { + TestProfilesConfiguration tester = new TestProfilesConfiguration(); + run(tester, ARGS3, PROFILES_CONFIGURATION_TEST, + PROFILES_CONFIGURATION_NEGATED_TEST); + tester.printSummary(); + } + + /** + * {@inheritDoc} + */ + public String getBugId() { + return BUG_ID; + } + + /** + * {@inheritDoc} + */ + public String getBugName() { + return getClass().getName(); + } +} diff --git a/langtools/test/com/sun/javadoc/testProfiles/pkg2/Class1Pkg2.java b/langtools/test/com/sun/javadoc/testProfiles/pkg2/Class1Pkg2.java index afa13d8444e..935bd3643ae 100644 --- a/langtools/test/com/sun/javadoc/testProfiles/pkg2/Class1Pkg2.java +++ b/langtools/test/com/sun/javadoc/testProfiles/pkg2/Class1Pkg2.java @@ -24,7 +24,7 @@ package pkg2; /** - * Another test class. + * @deprecated Class1Pkg2. This class is deprecated * * @author Bhavesh Patel */ diff --git a/langtools/test/com/sun/javadoc/testProfiles/pkg2/ClassError.java b/langtools/test/com/sun/javadoc/testProfiles/pkg2/ClassError.java new file mode 100644 index 00000000000..427b8f9c896 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testProfiles/pkg2/ClassError.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013, 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. + */ + +package pkg2; + +/** + * Simple error class. + * + * @author Evgeniya Stepanova + */ +public class ClassError extends Error {} diff --git a/langtools/test/com/sun/javadoc/testProfiles/pkg2/ClassException.java b/langtools/test/com/sun/javadoc/testProfiles/pkg2/ClassException.java new file mode 100644 index 00000000000..d56412e7da2 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testProfiles/pkg2/ClassException.java @@ -0,0 +1,31 @@ +/* + * Copyright (c) 2013, 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. + */ + +package pkg2; + +/** + * Simple exception class. + * + * @author Evgeniya Stepanova + */ +public class ClassException extends Exception {} diff --git a/langtools/test/com/sun/javadoc/testProfiles/pkgDeprecated/Class1PkgDeprecated.java b/langtools/test/com/sun/javadoc/testProfiles/pkgDeprecated/Class1PkgDeprecated.java new file mode 100644 index 00000000000..51475499286 --- /dev/null +++ b/langtools/test/com/sun/javadoc/testProfiles/pkgDeprecated/Class1PkgDeprecated.java @@ -0,0 +1,36 @@ +/* + * Copyright (c) 2013, 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. + */ + +package pkgDeprecated; + +/** + * Simple deprecated class of deprecated package. + * + * @author Evgeniya Stepanova + */ +public class Class1PkgDeprecated { + + public void method(int t) { + return null; + } +} diff --git a/langtools/test/com/sun/javadoc/testProfiles/pkgDeprecated/package-info.java b/langtools/test/com/sun/javadoc/testProfiles/pkgDeprecated/package-info.java new file mode 100644 index 00000000000..0cc070077cb --- /dev/null +++ b/langtools/test/com/sun/javadoc/testProfiles/pkgDeprecated/package-info.java @@ -0,0 +1,29 @@ +/* + * Copyright (c) 2013, 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. + */ + +/** + * Deprecated package. + * + * @deprecated This package is Deprecated. Use pkg1. + */ +package pkgDeprecated; diff --git a/langtools/test/com/sun/javadoc/testProfiles/profile-rtjar-includes.txt b/langtools/test/com/sun/javadoc/testProfiles/profile-rtjar-includes.txt index 9460b3f985b..eff8d14b438 100644 --- a/langtools/test/com/sun/javadoc/testProfiles/profile-rtjar-includes.txt +++ b/langtools/test/com/sun/javadoc/testProfiles/profile-rtjar-includes.txt @@ -1,5 +1,6 @@ PROFILE_1_RTJAR_INCLUDE_PACKAGES := \ - pkg2 + pkg2 \ + pkgDeprecated PROFILE_1_RTJAR_INCLUDE_TYPES := \ pkg3/Class1Pkg3.class
    Error Summary " + + "
    ErrorDescription
    " + + "ClassError