test/langtools/jdk/javadoc/doclet/testExternalOverridenMethod/TestExternalOverridenMethod.java
changeset 49139 771616d26ca1
parent 48295 c79d31ba84b9
child 51861 f7d40158eb2f
equal deleted inserted replaced
49138:67912cbf784a 49139:771616d26ca1
     1 /*
     1 /*
     2  * Copyright (c) 2003, 2016, Oracle and/or its affiliates. All rights reserved.
     2  * Copyright (c) 2003, 2018, 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 4857717 8025633 8026567 8164407
    26  * @bug 4857717 8025633 8026567 8164407 8182765
    27  * @summary Test to make sure that externally overriden and implemented methods
    27  * @summary Test to make sure that externally overriden and implemented methods
    28  * are documented properly.  The method should still include "implements" or
    28  * are documented properly.  The method should still include "implements" or
    29  * "overrides" documentation even though the method is external.
    29  * "overrides" documentation even though the method is external.
    30  * @author jamieh
    30  * @author jamieh
    31  * @library ../lib
    31  * @library ../lib
    32  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    32  * @modules jdk.javadoc/jdk.javadoc.internal.tool
    33  * @build JavadocTester TestExternalOverridenMethod
    33  * @build JavadocTester TestExternalOverridenMethod
    34  * @run main TestExternalOverridenMethod
    34  * @run main TestExternalOverridenMethod
    35  */
    35  */
       
    36 public class TestExternalOverridenMethod extends JavadocTester {
    36 
    37 
    37 public class TestExternalOverridenMethod extends JavadocTester {
    38     static final String uri = "http://java.sun.com/j2se/1.4.1/docs/api";
    38 
    39 
    39     public static void main(String... args) throws Exception {
    40     public static void main(String... args) throws Exception {
    40         TestExternalOverridenMethod tester = new TestExternalOverridenMethod();
    41         TestExternalOverridenMethod tester = new TestExternalOverridenMethod();
    41         tester.runTests();
    42         tester.runTests();
    42     }
    43     }
    43 
    44 
    44     @Test
    45     @Test
    45     void test() {
    46     void test() {
    46         String uri = "http://java.sun.com/j2se/1.4.1/docs/api";
       
    47         javadoc("-d", "out",
    47         javadoc("-d", "out",
       
    48                 "-sourcepath", testSrc,
       
    49                 "-linkoffline", uri, testSrc,
       
    50                 "pkg");
       
    51         checkExit(Exit.OK);
       
    52 
       
    53         checkOutput("pkg/XReader.html", true,
       
    54                 "<dt><span class=\"overrideSpecifyLabel\">Overrides:</span></dt>\n"
       
    55                 + "<dd><code><a href=\"" + uri + "/java/io/FilterReader.html?is-external=true#read()\" "
       
    56                 + "title=\"class or interface in java.io\" class=\"externalLink\">read</a></code>&nbsp;in class&nbsp;<code>"
       
    57                 + "<a href=\"" + uri + "/java/io/FilterReader.html?is-external=true\" "
       
    58                 + "title=\"class or interface in java.io\" class=\"externalLink\">FilterReader</a></code></dd>",
       
    59                 "<dt><span class=\"overrideSpecifyLabel\">Specified by:</span></dt>\n"
       
    60                 + "<dd><code><a href=\"" + uri + "/java/io/DataInput.html?is-external=true#readInt()\" "
       
    61                 + "title=\"class or interface in java.io\" class=\"externalLink\">readInt</a></code>&nbsp;in interface&nbsp;<code>"
       
    62                 + "<a href=\"" + uri + "/java/io/DataInput.html?is-external=true\" "
       
    63                 + "title=\"class or interface in java.io\" class=\"externalLink\">DataInput</a></code></dd>"
       
    64         );
       
    65     }
       
    66 
       
    67     @Test
       
    68     void test_html4() {
       
    69         javadoc("-d", "out-html4",
       
    70                 "-html4",
    48                 "-sourcepath", testSrc,
    71                 "-sourcepath", testSrc,
    49                 "-linkoffline", uri, testSrc,
    72                 "-linkoffline", uri, testSrc,
    50                 "pkg");
    73                 "pkg");
    51         checkExit(Exit.OK);
    74         checkExit(Exit.OK);
    52 
    75