994N/A/*
994N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
994N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
994N/A *
994N/A * This code is free software; you can redistribute it and/or modify it
994N/A * under the terms of the GNU General Public License version 2 only, as
994N/A * published by the Free Software Foundation.
994N/A *
994N/A * This code is distributed in the hope that it will be useful, but WITHOUT
994N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
994N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
994N/A * version 2 for more details (a copy is included in the LICENSE file that
994N/A * accompanied this code).
994N/A *
994N/A * You should have received a copy of the GNU General Public License version
994N/A * 2 along with this work; if not, write to the Free Software Foundation,
994N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
994N/A *
994N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
994N/A * or visit www.oracle.com if you need additional information or have any
994N/A * questions.
994N/A */
994N/A
994N/A/*
994N/A * @test
994N/A * @bug 6492694
994N/A * @summary Test package deprecation.
994N/A * @author bpatel
994N/A * @library ../lib/
994N/A * @build JavadocTester TestPackageDeprecation
994N/A * @run main TestPackageDeprecation
994N/A */
994N/A
994N/Apublic class TestPackageDeprecation extends JavadocTester {
994N/A
994N/A //Test information.
994N/A private static final String BUG_ID = "6492694";
994N/A
994N/A //Javadoc arguments.
994N/A private static final String[] ARGS1 = new String[]{
994N/A "-d", BUG_ID + "-1", "-source", "1.5", "-sourcepath", SRC_DIR, "-use", "pkg", "pkg1",
994N/A SRC_DIR + FS + "C2.java", SRC_DIR + FS + "FooDepr.java"
994N/A };
994N/A private static final String[] ARGS2 = new String[]{
994N/A "-d", BUG_ID + "-2", "-source", "1.5", "-sourcepath", SRC_DIR, "-use", "-nodeprecated",
994N/A "pkg", "pkg1", SRC_DIR + FS + "C2.java", SRC_DIR + FS + "FooDepr.java"
994N/A };
994N/A
994N/A //Input for string search tests.
994N/A private static final String[][] TEST1 = {
994N/A {BUG_ID + "-1" + FS + "pkg1" + FS + "package-summary.html",
994N/A "<div class=\"deprecatedContent\"><span class=\"strong\">Deprecated.</span>" + NL +
994N/A "<div class=\"block\"><i>This package is Deprecated.</i></div>"
994N/A },
994N/A {BUG_ID + "-1" + FS + "deprecated-list.html",
994N/A "<li><a href=\"#package\">Deprecated Packages</a></li>"
994N/A }
994N/A };
994N/A private static final String[][] TEST2 = NO_TEST;
994N/A private static final String[][] NEGATED_TEST1 = NO_TEST;
994N/A private static final String[][] NEGATED_TEST2 = {
994N/A {BUG_ID + "-2" + FS + "overview-summary.html", "pkg1"},
994N/A {BUG_ID + "-2" + FS + "allclasses-frame.html", "FooDepr"}
994N/A };
994N/A
994N/A /**
994N/A * The entry point of the test.
994N/A * @param args the array of command line arguments.
994N/A */
994N/A public static void main(String[] args) {
994N/A TestPackageDeprecation tester = new TestPackageDeprecation();
994N/A run(tester, ARGS1, TEST1, NEGATED_TEST1);
994N/A run(tester, ARGS2, TEST2, NEGATED_TEST2);
994N/A if ((new java.io.File(BUG_ID + "-2" + FS + "pkg1" + FS +
994N/A "package-summary.html")).exists()) {
994N/A throw new Error("Test Fails: packages summary should not be" +
994N/A "generated for deprecated package.");
994N/A } else {
994N/A System.out.println("Test passes: package-summary.html not found.");
994N/A }
994N/A if ((new java.io.File(BUG_ID + "-2" + FS + "FooDepr.html")).exists()) {
994N/A throw new Error("Test Fails: FooDepr should not be" +
994N/A "generated as it is deprecated.");
994N/A } else {
994N/A System.out.println("Test passes: FooDepr.html not found.");
994N/A }
994N/A tester.printSummary();
994N/A }
994N/A
994N/A /**
994N/A * {@inheritDoc}
994N/A */
994N/A public String getBugId() {
994N/A return BUG_ID;
994N/A }
994N/A
994N/A /**
994N/A * {@inheritDoc}
994N/A */
994N/A public String getBugName() {
994N/A return getClass().getName();
994N/A }
994N/A}