langtools/test/com/sun/javadoc/testLinkOption/TestLinkOption.java
changeset 23971 f5ff1f5a8dee
parent 21478 fa4c7cda1b41
child 23974 d53628eda3d1
equal deleted inserted replaced
23970:76f4acb11952 23971:f5ff1f5a8dee
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2013, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 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.
    42         "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/",
    42         "-linkoffline", "http://java.sun.com/j2se/1.4/docs/api/",
    43         SRC_DIR, "-package", "pkg", "java.lang"
    43         SRC_DIR, "-package", "pkg", "java.lang"
    44     };
    44     };
    45 
    45 
    46     private static final String[][] TEST1 = {
    46     private static final String[][] TEST1 = {
    47         {BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
    47         {BUG_ID + "-1/pkg/C.html",
    48             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true\" " +
    48             "<a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/String.html?is-external=true\" " +
    49             "title=\"class or interface in java.lang\"><code>Link to String Class</code></a>"
    49             "title=\"class or interface in java.lang\"><code>Link to String Class</code></a>"
    50         },
    50         },
    51         //Make sure the parameters are indented properly when the -link option is used.
    51         //Make sure the parameters are indented properly when the -link option is used.
    52         {BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
    52         {BUG_ID + "-1/pkg/C.html",
    53                                 "(int&nbsp;p1," + NL +
    53             "(int&nbsp;p1,\n" +
    54                                 "      int&nbsp;p2," + NL +
    54             "      int&nbsp;p2,\n" +
    55                                 "      int&nbsp;p3)"
    55             "      int&nbsp;p3)"
    56         },
    56         },
    57         {BUG_ID + "-1" + FS + "pkg" + FS + "C.html",
    57         {BUG_ID + "-1/pkg/C.html",
    58                                 "(int&nbsp;p1," + NL +
    58             "(int&nbsp;p1,\n" +
    59                                 "      int&nbsp;p2," + NL +
    59             "      int&nbsp;p2,\n" +
    60                                 "      <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">" +
    60             "      <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" title=\"class or interface in java.lang\">" +
    61                                 "Object</a>&nbsp;p3)"
    61             "Object</a>&nbsp;p3)"
    62         },
    62         },
    63         {BUG_ID + "-1" + FS + "java" + FS + "lang" + FS + "StringBuilderChild.html",
    63         {BUG_ID + "-1/java/lang/StringBuilderChild.html",
    64                 "<pre>public abstract class <span class=\"typeNameLabel\">StringBuilderChild</span>" + NL +
    64             "<pre>public abstract class <span class=\"typeNameLabel\">StringBuilderChild</span>\n" +
    65                 "extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
    65                 "extends <a href=\"http://java.sun.com/j2se/1.4/docs/api/java/lang/Object.html?is-external=true\" " +
    66                 "title=\"class or interface in java.lang\">Object</a></pre>"
    66             "title=\"class or interface in java.lang\">Object</a></pre>"
    67         },
    67         },
    68 
    68 
    69     };
    69     };
    70     private static final String[][] NEGATED_TEST1 = NO_TEST;
    70     private static final String[][] NEGATED_TEST1 = NO_TEST;
    71 
    71 
    72     //Generate the documentation using -linkoffline and a relative path as the first parameter.
    72     //Generate the documentation using -linkoffline and a relative path as the first parameter.
    73     //We will try linking to the docs generated in test 1 with a relative path.
    73     //We will try linking to the docs generated in test 1 with a relative path.
    74     private static final String[] ARGS2 = new String[] {
    74     private static final String[] ARGS2 = new String[] {
    75         "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR,
    75         "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR,
    76         "-linkoffline", "../" + BUG_ID + "-1", BUG_ID + "-1", "-package", "pkg2"
    76         "-linkoffline", "../" + BUG_ID + "-1",
       
    77         BUG_ID + "-1", "-package", "pkg2"
    77     };
    78     };
    78 
    79 
    79     private static final String[][] TEST2 = {
    80     private static final String[][] TEST2 = {
    80         {BUG_ID + "-2" + FS + "pkg2" + FS + "C2.html",
    81         {BUG_ID + "-2/pkg2/C2.html",
    81             "This is a link to <a href=\"../../" + BUG_ID + "-1/pkg/C.html?is-external=true\" " +
    82             "This is a link to <a href=\"../../" + BUG_ID +
       
    83             "-1/pkg/C.html?is-external=true\" " +
    82             "title=\"class or interface in pkg\"><code>Class C</code></a>."
    84             "title=\"class or interface in pkg\"><code>Class C</code></a>."
    83         }
    85         }
    84     };
    86     };
    85     private static final String[][] NEGATED_TEST2 = NO_TEST;
    87     private static final String[][] NEGATED_TEST2 = NO_TEST;
    86 
    88