996N/A/*
996N/A * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
996N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
996N/A *
996N/A * This code is free software; you can redistribute it and/or modify it
996N/A * under the terms of the GNU General Public License version 2 only, as
996N/A * published by the Free Software Foundation.
996N/A *
996N/A * This code is distributed in the hope that it will be useful, but WITHOUT
996N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
996N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
996N/A * version 2 for more details (a copy is included in the LICENSE file that
996N/A * accompanied this code).
996N/A *
996N/A * You should have received a copy of the GNU General Public License version
996N/A * 2 along with this work; if not, write to the Free Software Foundation,
996N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
996N/A *
996N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
996N/A * or visit www.oracle.com if you need additional information or have any
996N/A * questions.
996N/A */
996N/A
996N/A/*
996N/A * @test
996N/A * @bug 6553182
996N/A * @summary This test verifies the -Xdocrootparent option.
996N/A * @author Bhavesh Patel
996N/A * @library ../lib/
996N/A * @build JavadocTester TestDocRootLink
996N/A * @run main TestDocRootLink
996N/A */
996N/Apublic class TestDocRootLink extends JavadocTester {
996N/A
996N/A private static final String BUG_ID = "6553182";
996N/A private static final String[][] TEST1 = {
996N/A {BUG_ID + FS + "pkg1" + FS + "C1.html",
996N/A "<a href=\"../../technotes/guides/index.html\">"
996N/A },
996N/A {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
996N/A "<a href=\"../../technotes/guides/index.html\">"
996N/A }
996N/A };
996N/A private static final String[][] NEGATED_TEST1 = {
996N/A {BUG_ID + FS + "pkg1" + FS + "C1.html",
996N/A "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
996N/A },
996N/A {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
996N/A "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
996N/A }
996N/A };
996N/A private static final String[][] TEST2 = {
996N/A {BUG_ID + FS + "pkg2" + FS + "C2.html",
996N/A "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
996N/A },
996N/A {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
996N/A "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
996N/A }
996N/A };
996N/A private static final String[][] NEGATED_TEST2 = {
996N/A {BUG_ID + FS + "pkg2" + FS + "C2.html",
996N/A "<a href=\"../../technotes/guides/index.html\">"
996N/A },
996N/A {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
996N/A "<a href=\"../../technotes/guides/index.html\">"
996N/A }
996N/A };
996N/A private static final String[] ARGS1 =
996N/A new String[]{
996N/A "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
996N/A };
996N/A private static final String[] ARGS2 =
996N/A new String[]{
996N/A "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2"
996N/A };
996N/A
996N/A /**
996N/A * The entry point of the test.
996N/A * @param args the array of command line arguments.
996N/A */
996N/A public static void main(String[] args) {
996N/A TestDocRootLink tester = new TestDocRootLink();
996N/A run(tester, ARGS1, TEST1, NEGATED_TEST1);
996N/A run(tester, ARGS2, TEST2, NEGATED_TEST2);
996N/A tester.printSummary();
996N/A }
996N/A
996N/A /**
996N/A * {@inheritDoc}
996N/A */
996N/A public String getBugId() {
996N/A return BUG_ID;
996N/A }
996N/A
996N/A /**
996N/A * {@inheritDoc}
996N/A */
996N/A public String getBugName() {
996N/A return getClass().getName();
996N/A }
996N/A}