test/langtools/jdk/javadoc/doclet/testPackageDeprecation/TestPackageDeprecation.java
author pmuthuswamy
Wed, 16 Jan 2019 11:15:25 +0530
changeset 53343 07c09e65ca0f
parent 53097 2e82ca64b25d
child 54350 4f9772f4403d
permissions -rw-r--r--
8202626: javadoc generates broken links to <Unnamed> Reviewed-by: jjg
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
     1
/*
53343
07c09e65ca0f 8202626: javadoc generates broken links to <Unnamed>
pmuthuswamy
parents: 53097
diff changeset
     2
 * Copyright (c) 2011, 2019, Oracle and/or its affiliates. All rights reserved.
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
     4
 *
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
     8
 *
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    13
 * accompanied this code).
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    14
 *
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    18
 *
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    21
 * questions.
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    22
 */
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    23
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    24
/*
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    25
 * @test
53343
07c09e65ca0f 8202626: javadoc generates broken links to <Unnamed>
pmuthuswamy
parents: 53097
diff changeset
    26
 * @bug      6492694 8026567 8048351 8162363 8183511 8169819 8074407 8196202 8202626
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    27
 * @summary  Test package deprecation.
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    28
 * @author   bpatel
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 50293
diff changeset
    29
 * @library  ../../lib/
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    30
 * @modules jdk.javadoc/jdk.javadoc.internal.tool
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 50293
diff changeset
    31
 * @build    javadoc.tester.* TestPackageDeprecation
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    32
 * @run main TestPackageDeprecation
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    33
 */
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    34
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 50293
diff changeset
    35
import javadoc.tester.JavadocTester;
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 50293
diff changeset
    36
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    37
public class TestPackageDeprecation extends JavadocTester {
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    38
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    39
    public static void main(String... args) throws Exception {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    40
        TestPackageDeprecation tester = new TestPackageDeprecation();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    41
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    42
    }
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    43
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    44
    @Test
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 50293
diff changeset
    45
    public void testDefault() {
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
        javadoc("-d", "out-default",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    47
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    48
                "-use",
50293
edfb87b2520e 8196202: Javadoc should not generate frames by default
jjg
parents: 50118
diff changeset
    49
                "--frames",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    50
                "pkg", "pkg1", testSrc("C2.java"), testSrc("FooDepr.java"));
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    51
        checkExit(Exit.OK);
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    52
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    53
        checkOutput("pkg1/package-summary.html", true,
47300
a905ce398074 8074407: javadoc: using <pre> after @deprecated tag causes warnings
bpatel
parents: 47299
diff changeset
    54
                "<div class=\"deprecationBlock\"><span class=\"deprecatedLabel\">Deprecated.</span>\n"
a905ce398074 8074407: javadoc: using <pre> after @deprecated tag causes warnings
bpatel
parents: 47299
diff changeset
    55
                + "<div class=\"deprecationComment\">This package is Deprecated.</div>"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    56
        );
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    58
        checkOutput("deprecated-list.html", true,
47299
56419ec66d4e 8169819: minor cleanup for deprecated page
bpatel
parents: 47272
diff changeset
    59
            "<li><a href=\"#package\">Packages</a></li>"
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    60
        );
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    61
    }
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    62
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    63
    @Test
53097
2e82ca64b25d 8215516: Move JavadocTester to a named package
jjg
parents: 50293
diff changeset
    64
    public void testNoDeprecated() {
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    65
        javadoc("-d", "out-nodepr",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    66
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    67
                "-use",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    68
                "-nodeprecated",
50293
edfb87b2520e 8196202: Javadoc should not generate frames by default
jjg
parents: 50118
diff changeset
    69
                "--frames",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    70
                "pkg", "pkg1", testSrc("C2.java"), testSrc("FooDepr.java"));
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    71
        checkExit(Exit.OK);
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    72
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    73
        checkOutput("overview-summary.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    74
                "pkg1");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    75
        checkOutput("allclasses-frame.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    76
                "FooDepr");
26900
dccc7a72526d 8048351: tidy errors for attribute href, name for langtools javadoc tests needs investigation
bpatel
parents: 24399
diff changeset
    77
        checkOutput("class-use/C2.ModalExclusionType.html", true,
41157
b235a429089a 8162363: Tables in javadoc documentation missing row headers
bpatel
parents: 36526
diff changeset
    78
                "<th class=\"colFirst\" scope=\"row\"><a href=\"#unnamed.package\">&lt;Unnamed&gt;</a></th>");
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    79
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    80
        checkFiles(false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    81
                "pkg1/package-summary.html",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    82
                "FooDepr.html");
9606
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    83
    }
e5a619cb5dd3 6492694: @deprecated tag doesn't work in package-info files.
bpatel
parents:
diff changeset
    84
}