langtools/test/jdk/javadoc/doclet/testUseOption/TestUseOption.java
changeset 36705 890c250d8da8
parent 35426 374342e56a56
child 36709 f9f252088afa
equal deleted inserted replaced
36503:4a95f4b1bd8b 36705:890c250d8da8
     1 /*
     1 /*
     2  * Copyright (c) 2002, 2015, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2002, 2016, 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 4496290 4985072 7006178 7068595 8016328 8050031 8048351 8081854
    26  * @bug 4496290 4985072 7006178 7068595 8016328 8050031 8048351 8081854 8071982
    27  * @summary A simple test to ensure class-use files are correct.
    27  * @summary A simple test to ensure class-use files are correct.
    28  * @author jamieh
    28  * @author jamieh
    29  * @library ../lib
    29  * @library ../lib
    30  * @modules jdk.javadoc
    30  * @modules jdk.javadoc
    31  * @build JavadocTester
    31  * @build JavadocTester
   119         );
   119         );
   120         checkOutput("pkg1/class-use/UsedInterface.html", true,
   120         checkOutput("pkg1/class-use/UsedInterface.html", true,
   121             "<a href=\"../../pkg1/C10.html#withTypeParametersOfType-java.lang.Class-\">" +
   121             "<a href=\"../../pkg1/C10.html#withTypeParametersOfType-java.lang.Class-\">" +
   122             "withTypeParametersOfType</a>"
   122             "withTypeParametersOfType</a>"
   123         );
   123         );
       
   124         checkOutput("pkg1/class-use/UsedInterface.html", true,
       
   125             "Subinterfaces of <a href=\"../../pkg1/UsedInterface.html\" title=\"interface in pkg1\">"
       
   126             + "UsedInterface</a> in <a href=\"../../pkg1/package-summary.html\">pkg1",
       
   127             "<td class=\"colFirst\"><code>interface&nbsp;</code></td>\n<td class=\"colLast\">"
       
   128             + "<code><span class=\"memberNameLink\"><a href=\"../../pkg1/SubInterface.html\" "
       
   129             + "title=\"interface in pkg1\">SubInterface</a>&lt;T&gt;</span></code>&nbsp;</td>"
       
   130         );
       
   131         checkOutput("pkg1/class-use/UsedThrowable.html", true,
       
   132             "Methods in <a href=\"../../pkg1/package-summary.html\">pkg1</a> that throw "
       
   133             + "<a href=\"../../pkg1/UsedThrowable.html\" title=\"class in pkg1\">UsedThrowable</a>",
       
   134             "<td class=\"colFirst\"><code>void</code></td>\n<td class=\"colLast\"><span class="
       
   135             + "\"typeNameLabel\">C1.</span><code><span class=\"memberNameLink\">"
       
   136             + "<a href=\"../../pkg1/C1.html#methodInC1ThrowsThrowable--\">methodInC1ThrowsThrowable"
       
   137             + "</a></span>()</code>&nbsp;</td>"
       
   138         );
   124     }
   139     }
   125 
   140 
   126     @Test
   141     @Test
   127     void test2() {
   142     void test2() {
   128         javadoc("-d", "out-2",
   143         javadoc("-d", "out-2",
   129                 "-sourcepath", testSrc,
   144                 "-sourcepath", testSrc,
   130                 "-use",
   145                 "-use",
   131                 testSrc("C.java"), testSrc("UsedInC.java"));
   146                 testSrc("C.java"), testSrc("UsedInC.java"), "pkg3");
   132         checkExit(Exit.OK);
   147         checkExit(Exit.OK);
   133 
   148 
   134         checkOutput("class-use/UsedInC.html", true,
   149         checkOutput("class-use/UsedInC.html", true,
   135                 "Uses of <a href=\"../UsedInC.html\" title=\"class in &lt;Unnamed&gt;\">"
   150                 "Uses of <a href=\"../UsedInC.html\" title=\"class in &lt;Unnamed&gt;\">"
   136                 + "UsedInC</a> in <a href=\"../package-summary.html\">&lt;Unnamed&gt;</a>"
   151                 + "UsedInC</a> in <a href=\"../package-summary.html\">&lt;Unnamed&gt;</a>"
   138         checkOutput("class-use/UsedInC.html", true,
   153         checkOutput("class-use/UsedInC.html", true,
   139                 "<li class=\"blockList\"><a name=\"unnamed.package\">"
   154                 "<li class=\"blockList\"><a name=\"unnamed.package\">"
   140         );
   155         );
   141         checkOutput("package-use.html", true,
   156         checkOutput("package-use.html", true,
   142                 "<td class=\"colOne\">"
   157                 "<td class=\"colOne\">"
   143                 + "<a href=\"class-use/UsedInC.html#unnamed.package\">UsedInC</a>&nbsp;</td>"
   158                 + "<a href=\"class-use/UsedInC.html#unnamed.package\">UsedInC</a>&nbsp;</td>",
       
   159                 "<td class=\"colFirst\"><a href=\"#-Unnamed-\">&lt;Unnamed&gt;</a></td>\n"
       
   160                 + "<td class=\"colLast\">&nbsp;</td>"
   144         );
   161         );
   145     }
   162     }
   146 
   163 
   147     @Test
   164     @Test
   148     void test3() {
   165     void test3() {