test/langtools/jdk/javadoc/doclet/testLinkOption/TestLinkOption.java
changeset 53391 a99bd2570660
parent 53097 2e82ca64b25d
child 53558 fc5a68ff2c0b
equal deleted inserted replaced
53390:46db9786cd67 53391:a99bd2570660
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2018, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2019, 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.
   113                 + "extends <a href=\"" + url + "java/lang/Object.html?is-external=true\" "
   113                 + "extends <a href=\"" + url + "java/lang/Object.html?is-external=true\" "
   114                 + "title=\"class or interface in java.lang\" class=\"externalLink\">Object</a></pre>"
   114                 + "title=\"class or interface in java.lang\" class=\"externalLink\">Object</a></pre>"
   115         );
   115         );
   116 
   116 
   117         String out1_html4 = "out1-html4";
   117         String out1_html4 = "out1-html4";
       
   118         setAutomaticCheckLinks(false); // The example code has toy/bad links
   118         javadoc("-d", out1_html4,
   119         javadoc("-d", out1_html4,
   119                 "-source", "8",
   120                 "-source", "8",
   120                 "-html4",
   121                 "-html4",
   121                 "-classpath", mylib,
   122                 "-classpath", mylib,
   122                 "-sourcepath", testSrc,
   123                 "-sourcepath", testSrc,
   131                 + " title=\"class or interface in java.lang\" class=\"externalLink\"><code><tt>getSystemClassLoader()</tt>"
   132                 + " title=\"class or interface in java.lang\" class=\"externalLink\"><code><tt>getSystemClassLoader()</tt>"
   132                 + "</code></a> as the parent class loader.</div>",
   133                 + "</code></a> as the parent class loader.</div>",
   133                 "<div class=\"block\">is equivalent to invoking <code>"
   134                 "<div class=\"block\">is equivalent to invoking <code>"
   134                 + "<a href=\"#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
   135                 + "<a href=\"#createTempFile-java.lang.String-java.lang.String-java.io.File-\">"
   135                 + "<code>createTempFile(prefix,&nbsp;suffix,&nbsp;null)</code></a></code>.</div>");
   136                 + "<code>createTempFile(prefix,&nbsp;suffix,&nbsp;null)</code></a></code>.</div>");
       
   137 
       
   138         setAutomaticCheckLinks(true); // re-enable checks
   136 
   139 
   137         // Generate the documentation using -linkoffline and a relative path as the first parameter.
   140         // Generate the documentation using -linkoffline and a relative path as the first parameter.
   138         // We will try linking to the docs generated in test 1 with a relative path.
   141         // We will try linking to the docs generated in test 1 with a relative path.
   139         String out2 = "out2";
   142         String out2 = "out2";
   140         javadoc("-d", out2,
   143         javadoc("-d", out2,
   180                 + "title=\"class or interface in mylib.lang\" class=\"externalLink\">"
   183                 + "title=\"class or interface in mylib.lang\" class=\"externalLink\">"
   181                 + "<code>link to mylib.lang.StringBuilderChild</code></a>.</div>\n"
   184                 + "<code>link to mylib.lang.StringBuilderChild</code></a>.</div>\n"
   182         );
   185         );
   183 
   186 
   184         // check multiple linkoffline options
   187         // check multiple linkoffline options
       
   188         setAutomaticCheckLinks(false); // The example code has toy/bad links
   185         javadoc("-d", "out6",
   189         javadoc("-d", "out6",
   186                 "-sourcepath", testSrc,
   190                 "-sourcepath", testSrc,
   187                 "-linkoffline", "../copy/out1", "out1",
   191                 "-linkoffline", "../copy/out1", "out1",
   188                 "-linkoffline", "../copy/out2", "out2",
   192                 "-linkoffline", "../copy/out2", "out2",
   189                 "pkg3");
   193                 "pkg3");
   198                         + " <br>\n"
   202                         + " <br>\n"
   199                         + " <a href=\"../../copy/out1/mylib/lang/StringBuilderChild.html?is-external=true\" "
   203                         + " <a href=\"../../copy/out1/mylib/lang/StringBuilderChild.html?is-external=true\" "
   200                         + "title=\"class or interface in mylib.lang\" class=\"externalLink\">"
   204                         + "title=\"class or interface in mylib.lang\" class=\"externalLink\">"
   201                         + "<code>link to mylib.lang.StringBuilderChild</code></a>.</div>\n"
   205                         + "<code>link to mylib.lang.StringBuilderChild</code></a>.</div>\n"
   202         );
   206         );
       
   207 
       
   208         setAutomaticCheckLinks(true); // re-enable checks
   203     }
   209     }
   204 
   210 
   205     /*
   211     /*
   206      * Create the documentation using the -link option, vary the behavior with
   212      * Create the documentation using the -link option, vary the behavior with
   207      * both trailing and no trailing slash. We are only interested in ensuring
   213      * both trailing and no trailing slash. We are only interested in ensuring