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