langtools/test/com/sun/javadoc/testDocRootLink/TestDocRootLink.java
changeset 23971 f5ff1f5a8dee
parent 22160 fe9f4b305bcf
child 24065 fc4022e50129
equal deleted inserted replaced
23970:76f4acb11952 23971:f5ff1f5a8dee
     1 /*
     1 /*
     2  * Copyright (c) 2011, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2011, 2014, 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.
    32  */
    32  */
    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 + "/pkg1/C1.html",
    38             "Refer <a href=\"../../technotes/guides/index.html\">Here</a>"
    38             "Refer <a href=\"../../technotes/guides/index.html\">Here</a>"
    39         },
    39         },
    40         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    40         {BUG_ID + "/pkg1/C1.html",
    41             "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced" + NL +
    41             "This <a href=\"../pkg2/C2.html\">Here</a> should not be replaced\n" +
    42             " with an absolute link."
    42             " with an absolute link."
    43         },
    43         },
    44         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    44         {BUG_ID + "/pkg1/C1.html",
    45             "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL +
    45             "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" +
    46             " <a href=\"../pkg2/C2.html\">Link 2</a>."
    46             " <a href=\"../pkg2/C2.html\">Link 2</a>."
    47         },
    47         },
    48         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    48         {BUG_ID + "/pkg1/package-summary.html",
    49             "<a href=\"../../technotes/guides/index.html\">" + NL +
    49             "<a href=\"../../technotes/guides/index.html\">\n" +
    50             "            Test document 1</a>"
    50             "            Test document 1</a>"
    51         },
    51         },
    52         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    52         {BUG_ID + "/pkg1/package-summary.html",
    53             "<a href=\"../pkg2/C2.html\">" + NL +
    53             "<a href=\"../pkg2/C2.html\">\n" +
    54             "            Another Test document 1</a>"
    54             "            Another Test document 1</a>"
    55         },
    55         },
    56         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    56         {BUG_ID + "/pkg1/package-summary.html",
    57             "<a href=\"../technotes/guides/index.html\">" + NL +
    57             "<a href=\"../technotes/guides/index.html\">\n" +
    58             "            Another Test document 2.</a>"
    58             "            Another Test document 2.</a>"
    59         }
    59         }
    60     };
    60     };
    61     private static final String[][] NEGATED_TEST1 = {
    61     private static final String[][] NEGATED_TEST1 = {
    62         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    62         {BUG_ID + "/pkg1/C1.html",
    63             "<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\">"
    64         },
    64         },
    65         {BUG_ID + FS + "pkg1" + FS + "C1.html",
    65         {BUG_ID + "/pkg1/C1.html",
    66             "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
    66             "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
    67         },
    67         },
    68         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    68         {BUG_ID + "/pkg1/package-summary.html",
    69             "<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         },
    70         },
    71         {BUG_ID + FS + "pkg1" + FS + "package-summary.html",
    71         {BUG_ID + "/pkg1/package-summary.html",
    72             "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
    72             "<a href=\"http://download.oracle.com/javase/7/docs/pkg2/C2.html\">"
    73         }
    73         }
    74     };
    74     };
    75     private static final String[][] TEST2 = {
    75     private static final String[][] TEST2 = {
    76         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    76         {BUG_ID + "-1/pkg2/C2.html",
    77             "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>"
    77             "Refer <a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">Here</a>"
    78         },
    78         },
    79         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    79         {BUG_ID + "-1/pkg2/C2.html",
    80             "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced" + NL +
    80             "This <a href=\"../pkg1/C1.html\">Here</a> should not be replaced\n" +
    81             " with an absolute link."
    81             " with an absolute link."
    82         },
    82         },
    83         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
    83         {BUG_ID + "-1/pkg2/C2.html",
    84             "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and" + NL +
    84             "Testing <a href=\"../technotes/guides/index.html\">Link 1</a> and\n" +
    85             " <a href=\"../pkg1/C1.html\">Link 2</a>."
    85             " <a href=\"../pkg1/C1.html\">Link 2</a>."
    86         },
    86         },
    87         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
    87         {BUG_ID + "-1/pkg2/package-summary.html",
    88             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">" + NL +
    88             "<a href=\"http://download.oracle.com/javase/7/docs/technotes/guides/index.html\">\n" +
    89             "            Test document 1</a>"
    89             "            Test document 1</a>"
    90         },
    90         },
    91         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
    91         {BUG_ID + "-1/pkg2/package-summary.html",
    92             "<a href=\"../pkg1/C1.html\">" + NL + "            Another Test document 1</a>"
    92             "<a href=\"../pkg1/C1.html\">\n" +
       
    93             "            Another Test document 1</a>"
    93         },
    94         },
    94         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
    95         {BUG_ID + "-1/pkg2/package-summary.html",
    95             "<a href=\"../technotes/guides/index.html\">" + NL + "            Another Test document 2.</a>"
    96             "<a href=\"../technotes/guides/index.html\">\n" +
       
    97             "            Another Test document 2.</a>"
    96         }
    98         }
    97     };
    99     };
    98     private static final String[][] NEGATED_TEST2 = {
   100     private static final String[][] NEGATED_TEST2 = {
    99         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
   101         {BUG_ID + "-1/pkg2/C2.html",
   100             "<a href=\"../../technotes/guides/index.html\">"
   102             "<a href=\"../../technotes/guides/index.html\">"
   101         },
   103         },
   102         {BUG_ID + "-1" + FS + "pkg2" + FS + "C2.html",
   104         {BUG_ID + "-1/pkg2/C2.html",
   103             "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
   105             "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
   104         },
   106         },
   105         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
   107         {BUG_ID + "-1/pkg2/package-summary.html",
   106             "<a href=\"../../technotes/guides/index.html\">"
   108             "<a href=\"../../technotes/guides/index.html\">"
   107         },
   109         },
   108         {BUG_ID + "-1" + FS + "pkg2" + FS + "package-summary.html",
   110         {BUG_ID + "-1/pkg2/package-summary.html",
   109             "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
   111             "<a href=\"http://download.oracle.com/javase/7/docs/pkg1/C1.html\">"
   110         }
   112         }
   111     };
   113     };
   112     private static final String[] ARGS1 =
   114     private static final String[] ARGS1 =
   113             new String[]{
   115             new String[]{
   114         "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
   116         "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1", "pkg2"
   115     };
   117     };
   116     private static final String[] ARGS2 =
   118     private static final String[] ARGS2 =
   117             new String[]{
   119             new String[]{
   118         "-d", BUG_ID + "-1", "-Xdocrootparent", "http://download.oracle.com/javase/7/docs", "-sourcepath", SRC_DIR, "pkg1", "pkg2"
   120         "-d", BUG_ID + "-1", "-Xdocrootparent",
       
   121         "http://download.oracle.com/javase/7/docs", "-sourcepath",
       
   122         SRC_DIR, "pkg1", "pkg2"
   119     };
   123     };
   120 
   124 
   121     /**
   125     /**
   122      * The entry point of the test.
   126      * The entry point of the test.
   123      * @param args the array of command line arguments.
   127      * @param args the array of command line arguments.