test/com/sun/javadoc/testLambdaFeature/TestLambdaFeature.java

Sun, 24 Feb 2013 11:36:58 -0800

author
jjg
date
Sun, 24 Feb 2013 11:36:58 -0800
changeset 1606
ccbe7ffdd867
parent 1468
690c41cdab55
child 1998
b25e387481dc
permissions
-rw-r--r--

7112427: The doclet needs to be able to generate JavaFX documentation.
Reviewed-by: jjg
Contributed-by: jan.valenta@oracle.com

bpatel@1468 1 /*
bpatel@1468 2 * Copyright (c) 2012, Oracle and/or its affiliates. All rights reserved.
bpatel@1468 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
bpatel@1468 4 *
bpatel@1468 5 * This code is free software; you can redistribute it and/or modify it
bpatel@1468 6 * under the terms of the GNU General Public License version 2 only, as
bpatel@1468 7 * published by the Free Software Foundation.
bpatel@1468 8 *
bpatel@1468 9 * This code is distributed in the hope that it will be useful, but WITHOUT
bpatel@1468 10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
bpatel@1468 11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
bpatel@1468 12 * version 2 for more details (a copy is included in the LICENSE file that
bpatel@1468 13 * accompanied this code).
bpatel@1468 14 *
bpatel@1468 15 * You should have received a copy of the GNU General Public License version
bpatel@1468 16 * 2 along with this work; if not, write to the Free Software Foundation,
bpatel@1468 17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
bpatel@1468 18 *
bpatel@1468 19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
bpatel@1468 20 * or visit www.oracle.com if you need additional information or have any
bpatel@1468 21 * questions.
bpatel@1468 22 */
bpatel@1468 23
bpatel@1468 24 /*
bpatel@1468 25 * @test
bpatel@1468 26 * @bug 8004893
bpatel@1468 27 * @summary Make sure that the lambda feature changes work fine in
bpatel@1468 28 * javadoc.
bpatel@1468 29 * @author bpatel
bpatel@1468 30 * @library ../lib/
bpatel@1468 31 * @build JavadocTester TestLambdaFeature
bpatel@1468 32 * @run main TestLambdaFeature
bpatel@1468 33 */
bpatel@1468 34
bpatel@1468 35 public class TestLambdaFeature extends JavadocTester {
bpatel@1468 36
bpatel@1468 37 //Test information.
bpatel@1468 38 private static final String BUG_ID = "8004893";
bpatel@1468 39
bpatel@1468 40 //Javadoc arguments.
bpatel@1468 41 private static final String[] ARGS = new String[] {
bpatel@1468 42 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg"
bpatel@1468 43 };
bpatel@1468 44
bpatel@1468 45 //Input for string search tests.
bpatel@1468 46 private static final String[][] TEST = {
bpatel@1468 47 {BUG_ID + FS + "pkg" + FS + "A.html",
bpatel@1468 48 "<td class=\"colFirst\"><code>default void</code></td>"},
bpatel@1468 49 {BUG_ID + FS + "pkg" + FS + "A.html",
bpatel@1468 50 "<pre>default&nbsp;void&nbsp;defaultMethod()</pre>"},
bpatel@1468 51 {BUG_ID + FS + "pkg" + FS + "A.html",
bpatel@1468 52 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
bpatel@1468 53 "All Methods</span><span class=\"tabEnd\">&nbsp;</span></span>" +
bpatel@1468 54 "<span id=\"t2\" class=\"tableTab\"><span>" +
bpatel@1468 55 "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
bpatel@1468 56 "<span class=\"tabEnd\">&nbsp;</span></span><span id=\"t3\" " +
bpatel@1468 57 "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
bpatel@1468 58 "Abstract Methods</a></span><span class=\"tabEnd\">&nbsp;</span>" +
bpatel@1468 59 "</span><span id=\"t5\" class=\"tableTab\"><span>" +
bpatel@1468 60 "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
bpatel@1468 61 "<span class=\"tabEnd\">&nbsp;</span></span></caption>"},
bpatel@1468 62 {BUG_ID + FS + "pkg" + FS + "A.html",
bpatel@1468 63 "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL +
bpatel@1468 64 "<dd>This is a functional interface and can therefore be used as " +
bpatel@1468 65 "the assignment target for a lambda expression or method " +
jjg@1606 66 "reference.</dd>" + NL + "</dl>"}
bpatel@1468 67 };
bpatel@1468 68 private static final String[][] NEGATED_TEST = {
bpatel@1468 69 {BUG_ID + FS + "pkg" + FS + "A.html",
bpatel@1468 70 "<td class=\"colFirst\"><code>default default void</code></td>"},
bpatel@1468 71 {BUG_ID + FS + "pkg" + FS + "A.html",
bpatel@1468 72 "<pre>default&nbsp;default&nbsp;void&nbsp;defaultMethod()</pre>"},
bpatel@1468 73 {BUG_ID + FS + "pkg" + FS + "B.html",
bpatel@1468 74 "<td class=\"colFirst\"><code>default void</code></td>"},
bpatel@1468 75 {BUG_ID + FS + "pkg" + FS + "B.html",
bpatel@1468 76 "<dl>" + NL + "<dt>Functional Interface:</dt>"}
bpatel@1468 77 };
bpatel@1468 78
bpatel@1468 79 /**
bpatel@1468 80 * The entry point of the test.
bpatel@1468 81 * @param args the array of command line arguments.
bpatel@1468 82 */
bpatel@1468 83 public static void main(String[] args) {
bpatel@1468 84 TestLambdaFeature tester = new TestLambdaFeature();
bpatel@1468 85 run(tester, ARGS, TEST, NEGATED_TEST);
bpatel@1468 86 tester.printSummary();
bpatel@1468 87 }
bpatel@1468 88
bpatel@1468 89 /**
bpatel@1468 90 * {@inheritDoc}
bpatel@1468 91 */
bpatel@1468 92 public String getBugId() {
bpatel@1468 93 return BUG_ID;
bpatel@1468 94 }
bpatel@1468 95
bpatel@1468 96 /**
bpatel@1468 97 * {@inheritDoc}
bpatel@1468 98 */
bpatel@1468 99 public String getBugName() {
bpatel@1468 100 return getClass().getName();
bpatel@1468 101 }
bpatel@1468 102 }

mercurial