langtools/test/com/sun/javadoc/testRelativeLinks/TestRelativeLinks.java
changeset 24072 e7549dcbc4af
parent 24071 b0845717434e
child 24399 af1a0220d0fa
equal deleted inserted replaced
24071:b0845717434e 24072:e7549dcbc4af
    33  * @run main TestRelativeLinks
    33  * @run main TestRelativeLinks
    34  */
    34  */
    35 
    35 
    36 public class TestRelativeLinks extends JavadocTester {
    36 public class TestRelativeLinks extends JavadocTester {
    37 
    37 
    38     //Test information.
       
    39     private static final String BUG_ID = "4460354-8014636";
       
    40 
       
    41     //Javadoc arguments.
    38     //Javadoc arguments.
    42     private static final String[] ARGS = new String[] {
    39     private static final String[] ARGS = new String[] {
    43         "-d", BUG_ID, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg2"
    40         "-d", OUTPUT_DIR, "-use", "-sourcepath", SRC_DIR, "pkg", "pkg2"
    44     };
    41     };
    45 
    42 
    46     //Input for string search tests.
    43     //Input for string search tests.
    47     private static final String[][] TEST = {
    44     private static final String[][] TEST = {
    48         //These relative paths should stay relative because they appear
    45         //These relative paths should stay relative because they appear
    49         //in the right places.
    46         //in the right places.
    50         {BUG_ID + "/pkg/C.html",
    47         { "pkg/C.html",
    51             "<a href=\"relative-class-link.html\">relative class link</a>"},
    48             "<a href=\"relative-class-link.html\">relative class link</a>"},
    52         {BUG_ID + "/pkg/C.html",
    49         { "pkg/C.html",
    53             "<a href=\"relative-field-link.html\">relative field link</a>"},
    50             "<a href=\"relative-field-link.html\">relative field link</a>"},
    54         {BUG_ID + "/pkg/C.html",
    51         { "pkg/C.html",
    55             "<a href=\"relative-method-link.html\">relative method link</a>"},
    52             "<a href=\"relative-method-link.html\">relative method link</a>"},
    56         {BUG_ID + "/pkg/package-summary.html",
    53         { "pkg/package-summary.html",
    57             "<a href=\"relative-package-link.html\">relative package link</a>"},
    54             "<a href=\"relative-package-link.html\">relative package link</a>"},
    58         {BUG_ID + "/pkg/C.html",
    55         { "pkg/C.html",
    59             " <a\n" +
    56             " <a\n" +
    60             " href=\"relative-multi-line-link.html\">relative-multi-line-link</a>."},
    57             " href=\"relative-multi-line-link.html\">relative-multi-line-link</a>."},
    61 
    58 
    62         //These relative paths should be redirected because they are in different
    59         //These relative paths should be redirected because they are in different
    63         //places.
    60         //places.
    64 
    61 
    65         //INDEX PAGE
    62         //INDEX PAGE
    66         {BUG_ID + "/index-all.html",
    63         { "index-all.html",
    67             "<a href=\"./pkg/relative-class-link.html\">relative class link</a>"},
    64             "<a href=\"./pkg/relative-class-link.html\">relative class link</a>"},
    68         {BUG_ID + "/index-all.html",
    65         { "index-all.html",
    69             "<a href=\"./pkg/relative-field-link.html\">relative field link</a>"},
    66             "<a href=\"./pkg/relative-field-link.html\">relative field link</a>"},
    70         {BUG_ID + "/index-all.html",
    67         { "index-all.html",
    71             "<a href=\"./pkg/relative-method-link.html\">relative method link</a>"},
    68             "<a href=\"./pkg/relative-method-link.html\">relative method link</a>"},
    72         {BUG_ID + "/index-all.html",
    69         { "index-all.html",
    73             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"},
    70             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"},
    74         {BUG_ID + "/index-all.html",
    71         { "index-all.html",
    75             " <a\n" +
    72             " <a\n" +
    76             " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."},
    73             " href=\"./pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."},
    77 
    74 
    78 
    75 
    79         //PACKAGE USE
    76         //PACKAGE USE
    80         {BUG_ID + "/pkg/package-use.html",
    77         { "pkg/package-use.html",
    81             "<a href=\"../pkg/relative-package-link.html\">relative package link</a>."},
    78             "<a href=\"../pkg/relative-package-link.html\">relative package link</a>."},
    82         {BUG_ID + "/pkg/package-use.html",
    79         { "pkg/package-use.html",
    83             "<a href=\"../pkg/relative-class-link.html\">relative class link</a>"},
    80             "<a href=\"../pkg/relative-class-link.html\">relative class link</a>"},
    84 
    81 
    85         //CLASS_USE
    82         //CLASS_USE
    86         {BUG_ID + "/pkg/class-use/C.html",
    83         { "pkg/class-use/C.html",
    87             "<a href=\"../../pkg/relative-field-link.html\">relative field link</a>"},
    84             "<a href=\"../../pkg/relative-field-link.html\">relative field link</a>"},
    88         {BUG_ID + "/pkg/class-use/C.html",
    85         { "pkg/class-use/C.html",
    89             "<a href=\"../../pkg/relative-method-link.html\">relative method link</a>"},
    86             "<a href=\"../../pkg/relative-method-link.html\">relative method link</a>"},
    90         {BUG_ID + "/pkg/class-use/C.html",
    87         { "pkg/class-use/C.html",
    91             "<a href=\"../../pkg/relative-package-link.html\">relative package link</a>"},
    88             "<a href=\"../../pkg/relative-package-link.html\">relative package link</a>"},
    92         {BUG_ID + "/pkg/class-use/C.html",
    89         { "pkg/class-use/C.html",
    93             " <a\n" +
    90             " <a\n" +
    94             " href=\"../../pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."},
    91             " href=\"../../pkg/relative-multi-line-link.html\">relative-multi-line-link</a>."},
    95 
    92 
    96         //PACKAGE OVERVIEW
    93         //PACKAGE OVERVIEW
    97         {BUG_ID + "/overview-summary.html",
    94         { "overview-summary.html",
    98             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"},
    95             "<a href=\"./pkg/relative-package-link.html\">relative package link</a>"},
    99     };
    96     };
   100 
    97 
   101     /**
    98     /**
   102      * The entry point of the test.
    99      * The entry point of the test.
   105     public static void main(String[] args) {
   102     public static void main(String[] args) {
   106         TestRelativeLinks tester = new TestRelativeLinks();
   103         TestRelativeLinks tester = new TestRelativeLinks();
   107         tester.run(ARGS, TEST, NO_TEST);
   104         tester.run(ARGS, TEST, NO_TEST);
   108         tester.printSummary();
   105         tester.printSummary();
   109     }
   106     }
   110 
       
   111     /**
       
   112      * {@inheritDoc}
       
   113      */
       
   114     public String getBugId() {
       
   115         return BUG_ID;
       
   116     }
       
   117 
       
   118     /**
       
   119      * {@inheritDoc}
       
   120      */
       
   121     public String getBugName() {
       
   122         return getClass().getName();
       
   123     }
       
   124 }
   107 }