bpatel@997: /* bpatel@997: * Copyright (c) 2011, 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 bpatel@997: * @bug 6553182 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@997: "" bpatel@997: }, bpatel@997: {BUG_ID + FS + "pkg1" + FS + "package-summary.html", bpatel@997: "" bpatel@997: } bpatel@997: }; bpatel@997: private static final String[][] NEGATED_TEST1 = { bpatel@997: {BUG_ID + FS + "pkg1" + FS + "C1.html", bpatel@997: "" bpatel@997: }, bpatel@997: {BUG_ID + FS + "pkg1" + FS + "package-summary.html", bpatel@997: "" bpatel@997: } bpatel@997: }; bpatel@997: private static final String[][] TEST2 = { bpatel@997: {BUG_ID + FS + "pkg2" + FS + "C2.html", bpatel@997: "" bpatel@997: }, bpatel@997: {BUG_ID + FS + "pkg2" + FS + "package-summary.html", bpatel@997: "" bpatel@997: } bpatel@997: }; bpatel@997: private static final String[][] NEGATED_TEST2 = { bpatel@997: {BUG_ID + FS + "pkg2" + FS + "C2.html", bpatel@997: "" bpatel@997: }, bpatel@997: {BUG_ID + FS + "pkg2" + FS + "package-summary.html", bpatel@997: "" bpatel@997: } bpatel@997: }; bpatel@997: private static final String[] ARGS1 = bpatel@997: new String[]{ bpatel@997: "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1" bpatel@997: }; bpatel@997: private static final String[] ARGS2 = bpatel@997: new String[]{ bpatel@997: "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "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: }