test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java

Wed, 18 Sep 2013 22:47:06 -0700

author
bpatel
date
Wed, 18 Sep 2013 22:47:06 -0700
changeset 2036
8df12c315ea3
parent 997
dbc4ced9d171
child 2212
4cb9de4dd420
permissions
-rw-r--r--

8024096: some javadoc tests may contain false positive results
Reviewed-by: jjg

     1 /*
     2  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     8  *
     9  * This code is distributed in the hope that it will be useful, but WITHOUT
    10  * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
    11  * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
    12  * version 2 for more details (a copy is included in the LICENSE file that
    13  * accompanied this code).
    14  *
    15  * You should have received a copy of the GNU General Public License version
    16  * 2 along with this work; if not, write to the Free Software Foundation,
    17  * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
    18  *
    19  * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
    20  * or visit www.oracle.com if you need additional information or have any
    21  * questions.
    22  */
    24 /*
    25  * @test
    26  * @bug 6553182
    27  * @summary This test verifies the -Xdocrootparent option.
    28  * @author Bhavesh Patel
    29  * @library ../lib/
    30  * @build JavadocTester TestDocRootLink
    31  * @run main TestDocRootLink
    32  */
    33 public class TestDocRootLink extends JavadocTester {
    35     private static final String BUG_ID = "6553182";
    36     private static final String[][] TEST1 = {
    37         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    38             "<a href=\"../../technotes/guides/index.html\">"
    39         },
    40         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    41             "<a href=\"../../technotes/guides/index.html\">"
    42         }
    43     };
    44     private static final String[][] NEGATED_TEST1 = {
    45         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    46             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    47         },
    48         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    49             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    50         }
    51     };
    52     private static final String[][] TEST2 = {
    53         {BUG_ID + FS + "pkg2" + FS + "C2.html",
    54             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    55         },
    56         {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
    57             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    58         }
    59     };
    60     private static final String[][] NEGATED_TEST2 = {
    61         {BUG_ID + FS + "pkg2" + FS + "C2.html",
    62             "<a href=\"../../technotes/guides/index.html\">"
    63         },
    64         {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
    65             "<a href=\"../../technotes/guides/index.html\">"
    66         }
    67     };
    68     private static final String[] ARGS1 =
    69             new String[]{
    70         "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
    71     };
    72     private static final String[] ARGS2 =
    73             new String[]{
    74         "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2"
    75     };
    77     /**
    78      * The entry point of the test.
    79      * @param args the array of command line arguments.
    80      */
    81     public static void main(String[] args) {
    82         TestDocRootLink tester = new TestDocRootLink();
    83         run(tester, ARGS1, TEST1, NEGATED_TEST1);
    84         run(tester, ARGS2, TEST2, NEGATED_TEST2);
    85         tester.printSummary();
    86     }
    88     /**
    89      * {@inheritDoc}
    90      */
    91     public String getBugId() {
    92         return BUG_ID;
    93     }
    95     /**
    96      * {@inheritDoc}
    97      */
    98     public String getBugName() {
    99         return getClass().getName();
   100     }
   101 }

mercurial