langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java
changeset 22005 4270ada5dcd1
parent 9608 385a828ba236
child 22160 fe9f4b305bcf
equal deleted inserted replaced
22004:203318f0799d 22005:4270ada5dcd1
     1 /*
     1 /*
     2  * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
     4  *
     4  *
     5  * This code is free software; you can redistribute it and/or modify it
     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
     6  * under the terms of the GNU General Public License version 2 only, as
     7  * published by the Free Software Foundation.
     7  * published by the Free Software Foundation.
    21  * questions.
    21  * questions.
    22  */
    22  */
    23 
    23 
    24 /*
    24 /*
    25  * @test
    25  * @test
    26  * @bug 6553182
    26  * @bug 6553182 8025416
    27  * @summary This test verifies the -Xdocrootparent option.
    27  * @summary This test verifies the -Xdocrootparent option.
    28  * @author Bhavesh Patel
    28  * @author Bhavesh Patel
    29  * @library ../lib/
    29  * @library ../lib/
    30  * @build JavadocTester TestDocRootLink
    30  * @build JavadocTester TestDocRootLink
    31  * @run main TestDocRootLink
    31  * @run main TestDocRootLink
    33 public class TestDocRootLink extends JavadocTester {
    33 public class TestDocRootLink extends JavadocTester {
    34 
    34 
    35     private static final String BUG_ID = "6553182";
    35     private static final String BUG_ID = "6553182";
    36     private static final String[][] TEST1 = {
    36     private static final String[][] TEST1 = {
    37         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    37         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    38             "<a href=\"../../technotes/guides/index.html\">"
    38             "Refer <a href=\"../../technotes/guides/index.html\">Here</a>"
       
    39         },
       
    40         {BUG_ID + FS + "pkg1" + FS + "C1.html",
       
    41             "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced" + NL +
       
    42             " with an absolute link."
       
    43         },
       
    44         {BUG_ID + FS + "pkg1" + FS + "C1.html",
       
    45             "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL +
       
    46             " <a href=\"../pkg2/C2.html\">Link 2</a>."
    39         },
    47         },
    40         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    48         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    41             "<a href=\"../../technotes/guides/index.html\">"
    49             "<a href=\"../../technotes/guides/index.html\">" + NL +
       
    50             "            Test document 1</a>"
       
    51         },
       
    52         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
       
    53             "<a href=\"../pkg2/C2.html\">" + NL +
       
    54             "            Another Test document 1</a>"
       
    55         },
       
    56         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
       
    57             "<a href=\"../technotes/guides/index.html\">" + NL +
       
    58             "            Another Test document 2.</a>"
    42         }
    59         }
    43     };
    60     };
    44     private static final String[][] NEGATED_TEST1 = {
    61     private static final String[][] NEGATED_TEST1 = {
    45         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    62         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    46             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    63             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    47         },
    64         },
       
    65         {BUG_ID + FS + "pkg1" + FS + "C1.html",
       
    66             "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
       
    67         },
    48         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    68         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    49             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    69             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
       
    70         },
       
    71         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
       
    72             "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
    50         }
    73         }
    51     };
    74     };
    52     private static final String[][] TEST2 = {
    75     private static final String[][] TEST2 = {
    53         {BUG_ID + FS + "pkg2" + FS + "C2.html",
    76         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    54             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    77             "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>"
    55         },
    78         },
    56         {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
    79         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    57             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">"
    80             "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced" + NL +
       
    81             " with an absolute link."
       
    82         },
       
    83         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
       
    84             "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL +
       
    85             " <a href=\"../pkg1/C1.html\">Link 2</a>."
       
    86         },
       
    87         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
       
    88             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + NL +
       
    89             "            Test document 1</a>"
       
    90         },
       
    91         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
       
    92             "<a href=\"../pkg1/C1.html\">" + NL + "            Another Test document 1</a>"
       
    93         },
       
    94         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
       
    95             "<a href=\"../technotes/guides/index.html\">" + NL + "            Another Test document 2.</a>"
    58         }
    96         }
    59     };
    97     };
    60     private static final String[][] NEGATED_TEST2 = {
    98     private static final String[][] NEGATED_TEST2 = {
    61         {BUG_ID + FS + "pkg2" + FS + "C2.html",
    99         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    62             "<a href=\"../../technotes/guides/index.html\">"
   100             "<a href=\"../../technotes/guides/index.html\">"
    63         },
   101         },
    64         {BUG_ID + FS + "pkg2" + FS + "package-summary.html",
   102         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
       
   103             "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
       
   104         },
       
   105         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
    65             "<a href=\"../../technotes/guides/index.html\">"
   106             "<a href=\"../../technotes/guides/index.html\">"
       
   107         },
       
   108         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
       
   109             "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
    66         }
   110         }
    67     };
   111     };
    68     private static final String[] ARGS1 =
   112     private static final String[] ARGS1 =
    69             new String[]{
   113             new String[]{
    70         "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"
   114         "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
    71     };
   115     };
    72     private static final String[] ARGS2 =
   116     private static final String[] ARGS2 =
    73             new String[]{
   117             new String[]{
    74         "-d", BUG_ID, "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg2"
   118         "-d", BUG_ID + "-1", "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg1", "pkg2"
    75     };
   119     };
    76 
   120 
    77     /**
   121     /**
    78      * The entry point of the test.
   122      * The entry point of the test.
    79      * @param args the array of command line arguments.
   123      * @param args the array of command line arguments.