test/langtools/jdk/javadoc/doclet/testLambdaFeature/TestLambdaFeature.java
author bpatel
Wed, 27 Sep 2017 16:47:07 -0700
changeset 47284 355349babaf4
parent 47216 71c04702a3d5
child 51127 c2e676c2cf7b
permissions -rw-r--r--
8186332: Fix method signature in method summary table Reviewed-by: jjg, ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     1
/*
44297
e03f5fb3714b 8175200: Long method signatures disturb Method Summary table
bpatel
parents: 36526
diff changeset
     2
 * Copyright (c) 2012, 2017, Oracle and/or its affiliates. All rights reserved.
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     4
 *
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     7
 * published by the Free Software Foundation.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     8
 *
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     9
 * This code is distributed in the hope that it will be useful, but WITHOUT
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    10
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    11
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    12
 * version 2 for more details (a copy is included in the LICENSE file that
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    13
 * accompanied this code).
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    14
 *
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    15
 * You should have received a copy of the GNU General Public License version
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    16
 * 2 along with this work; if not, write to the Free Software Foundation,
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    17
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    18
 *
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    19
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    20
 * or visit www.oracle.com if you need additional information or have any
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    21
 * questions.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    22
 */
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    23
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    24
/*
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    25
 * @test
47284
355349babaf4 8186332: Fix method signature in method summary table
bpatel
parents: 47216
diff changeset
    26
 * @bug      8004893 8022738 8029143 8175200 8186332
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    27
 * @summary  Make sure that the lambda feature changes work fine in
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    28
 *           javadoc.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    29
 * @author   bpatel
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    30
 * @library  ../lib/
36526
3b41f1c69604 8142968: Module System implementation
alanb
parents: 35426
diff changeset
    31
 * @modules jdk.javadoc/jdk.javadoc.internal.tool
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    32
 * @build    JavadocTester TestLambdaFeature
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    33
 * @run main TestLambdaFeature
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    34
 */
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    35
23139
612191246a7d 8031670: Remove unneeded -source options in javadoc tests
darcy
parents: 19912
diff changeset
    36
/*
612191246a7d 8031670: Remove unneeded -source options in javadoc tests
darcy
parents: 19912
diff changeset
    37
 * NOTE : This test should be elided when version 1.7 support is removed from the JDK
612191246a7d 8031670: Remove unneeded -source options in javadoc tests
darcy
parents: 19912
diff changeset
    38
 *              or the negative part of the test showing 1.7's non-support should be
612191246a7d 8031670: Remove unneeded -source options in javadoc tests
darcy
parents: 19912
diff changeset
    39
 *              removed [ 8022738 ]
612191246a7d 8031670: Remove unneeded -source options in javadoc tests
darcy
parents: 19912
diff changeset
    40
 */
612191246a7d 8031670: Remove unneeded -source options in javadoc tests
darcy
parents: 19912
diff changeset
    41
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    42
public class TestLambdaFeature extends JavadocTester {
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
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
    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
    45
        TestLambdaFeature tester = new TestLambdaFeature();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    46
        tester.runTests();
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    47
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    48
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    49
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    50
    void testDefault() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    51
        javadoc("-d", "out-default",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    52
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    53
                "pkg", "pkg1");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    54
        checkExit(Exit.OK);
19912
4b1a79163f9c 8022738: doclet should only generate functional interface text if source >= 8
bpatel
parents: 16319
diff changeset
    55
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    56
        checkOutput("pkg/A.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    57
                "<td class=\"colFirst\"><code>default void</code></td>",
47284
355349babaf4 8186332: Fix method signature in method summary table
bpatel
parents: 47216
diff changeset
    58
                "<pre>default&nbsp;void&nbsp;defaultMethod()</pre>",
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    59
                "<caption><span id=\"t0\" class=\"activeTableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    60
                + "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    61
                + "<span id=\"t2\" class=\"tableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    62
                + "<a href=\"javascript:show(2);\">Instance Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    63
                + "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    64
                + "class=\"tableTab\"><span><a href=\"javascript:show(4);\">"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    65
                + "Abstract Methods</a></span><span class=\"tabEnd\">&nbsp;</span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    66
                + "</span><span id=\"t5\" class=\"tableTab\"><span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    67
                + "<a href=\"javascript:show(16);\">Default Methods</a></span>"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    68
                + "<span class=\"tabEnd\">&nbsp;</span></span></caption>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    69
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    70
                + "<dt>Functional Interface:</dt>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    71
                + "<dd>This is a functional interface and can therefore be used as "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    72
                + "the assignment target for a lambda expression or method "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    73
                + "reference.</dd>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    74
                + "</dl>");
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    75
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    76
        checkOutput("pkg1/FuncInf.html", true,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    77
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    78
                + "<dt>Functional Interface:</dt>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    79
                + "<dd>This is a functional interface and can therefore be used as "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    80
                + "the assignment target for a lambda expression or method "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    81
                + "reference.</dd>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    82
                + "</dl>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    83
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    84
        checkOutput("pkg/A.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    85
                "<td class=\"colFirst\"><code>default default void</code></td>",
47284
355349babaf4 8186332: Fix method signature in method summary table
bpatel
parents: 47216
diff changeset
    86
                "<pre>default&nbsp;default&nbsp;void&nbsp;defaultMethod()</pre>");
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    87
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    88
        checkOutput("pkg/B.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    89
                "<td class=\"colFirst\"><code>default void</code></td>",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    90
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    91
                + "<dt>Functional Interface:</dt>");
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    92
24399
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    93
        checkOutput("pkg1/NotAFuncInf.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    94
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    95
                + "<dt>Functional Interface:</dt>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    96
                + "<dd>This is a functional interface and can therefore be used as "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    97
                + "the assignment target for a lambda expression or method "
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    98
                + "reference.</dd>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
    99
                + "</dl>");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   100
    }
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   101
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   102
    @Test
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   103
    void testSource7() {
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   104
        javadoc("-d", "out-7",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   105
                "-sourcepath", testSrc,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   106
                "-source", "1.7",
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   107
                "pkg1");
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   108
        checkExit(Exit.OK);
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   109
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   110
        checkOutput("pkg1/FuncInf.html", false,
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   111
                "<dl>\n"
af1a0220d0fa 8038730: Clean up the way JavadocTester is invoked, and checks for errors.
jjg
parents: 24072
diff changeset
   112
                + "<dt>Functional Interface:</dt>");
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
   113
    }
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
   114
}