langtools/test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java
author goetz
Thu, 20 Jun 2013 16:30:44 -0700
changeset 22807 1cf02ef734e2
parent 16319 e586bfeb39c5
child 19912 4b1a79163f9c
permissions -rw-r--r--
8016586: PPC64 (part 3): basic changes for PPC64 Summary: added #includes needed for ppc64 port. Renamed _MODEL_ppc to _MODEL_ppc_32 and renamed corresponding old _ppc files to _ppc_32. Reviewed-by: dholmes, kvn
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
/*
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
     2
 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
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
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    26
 * @bug      8004893
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/
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    31
 * @build    JavadocTester TestLambdaFeature
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    32
 * @run main TestLambdaFeature
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    33
 */
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
public class TestLambdaFeature extends JavadocTester {
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    36
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    37
    //Test information.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    38
    private static final String BUG_ID = "8004893";
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    39
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    40
    //Javadoc arguments.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    41
    private static final String[] ARGS = new String[] {
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    42
        "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    43
    };
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    44
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    45
    //Input for string search tests.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    46
    private static final String[][] TEST = {
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    47
        {BUG_ID + FS + "pkg" + FS + "A.html",
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    48
            "<td class=\"colFirst\"><code>default void</code></td>"},
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    49
        {BUG_ID + FS + "pkg" + FS + "A.html",
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    50
            "<pre>default&nbsp;void&nbsp;defaultMethod()</pre>"},
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    51
        {BUG_ID + FS + "pkg" + FS + "A.html",
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    52
            "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    53
            "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    54
            "<span id=\"t2\" class=\"tableTab\"><span>" +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    55
            "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    56
            "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" " +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    57
            "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    58
            "Abstract Methods</a></span><span class=\"tabEnd\">&nbsp;</span>" +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    59
            "</span><span id=\"t5\" class=\"tableTab\"><span>" +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    60
            "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    61
            "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    62
        {BUG_ID + FS + "pkg" + FS + "A.html",
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    63
            "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    64
            "<dd>This is a functional interface and can therefore be used as " +
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    65
            "the assignment target for a lambda expression or method " +
16319
e586bfeb39c5 7112427: The doclet needs to be able to generate JavaFX documentation.
jjg
parents: 14965
diff changeset
    66
            "reference.</dd>" + NL + "</dl>"}
14965
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    67
    };
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    68
    private static final String[][] NEGATED_TEST = {
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    69
        {BUG_ID + FS + "pkg" + FS + "A.html",
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    70
            "<td class=\"colFirst\"><code>default default void</code></td>"},
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    71
        {BUG_ID + FS + "pkg" + FS + "A.html",
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    72
            "<pre>default&nbsp;default&nbsp;void&nbsp;defaultMethod()</pre>"},
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    73
        {BUG_ID + FS + "pkg" + FS + "B.html",
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    74
            "<td class=\"colFirst\"><code>default void</code></td>"},
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    75
        {BUG_ID + FS + "pkg" + FS + "B.html",
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    76
            "<dl>" + NL + "<dt>Functional Interface:</dt>"}
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    77
    };
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    78
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    79
    /**
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    80
     * The entry point of the test.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    81
     * @param args the array of command line arguments.
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    82
     */
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    83
    public static void main(String[] args) {
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    84
        TestLambdaFeature tester = new TestLambdaFeature();
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    85
        run(tester, ARGS, TEST, NEGATED_TEST);
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    86
        tester.printSummary();
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    87
    }
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    88
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    89
    /**
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    90
     * {@inheritDoc}
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    91
     */
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    92
    public String getBugId() {
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    93
        return BUG_ID;
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    94
    }
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    95
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    96
    /**
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    97
     * {@inheritDoc}
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    98
     */
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
    99
    public String getBugName() {
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
   100
        return getClass().getName();
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
   101
    }
bb1eb01b8c41 8004893: the javadoc/doclet needs to be updated to accommodate lambda changes
bpatel
parents:
diff changeset
   102
}