15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8004893 8022738
27 * @summary Make sure that the lambda feature changes work fine in
28 * javadoc.
29 * @author bpatel
30 * @library ../lib/
31 * @build JavadocTester TestLambdaFeature
32 * @run main TestLambdaFeature
33 */
34
35 public class TestLambdaFeature extends JavadocTester {
36
37 //Test information.
38 private static final String BUG_ID = "8004893-8022738";
39
40 //Javadoc arguments.
41 private static final String[] ARGS = new String[] {
42 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "pkg1"
43 };
44
45 private static final String[] ARGS_1 = new String[] {
46 "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-source", "1.5", "pkg1"
47 };
48
49 //Input for string search tests.
50 private static final String[][] TEST = {
51 {BUG_ID + FS + "pkg" + FS + "A.html",
52 "<td class=\"colFirst\"><code>default void</code></td>"},
53 {BUG_ID + FS + "pkg" + FS + "A.html",
54 "<pre>default void defaultMethod()</pre>"},
55 {BUG_ID + FS + "pkg" + FS + "A.html",
56 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
57 "All Methods</span><span class=\"tabEnd\"> </span></span>" +
58 "<span id=\"t2\" class=\"tableTab\"><span>" +
59 "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
60 "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " +
61 "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
62 "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" +
63 "</span><span id=\"t5\" class=\"tableTab\"><span>" +
64 "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
65 "<span class=\"tabEnd\"> </span></span></caption>"},
66 {BUG_ID + FS + "pkg" + FS + "A.html",
67 "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL +
68 "<dd>This is a functional interface and can therefore be used as " +
69 "the assignment target for a lambda expression or method " +
70 "reference.</dd>" + NL + "</dl>"},
71 {BUG_ID + FS + "pkg1" + FS + "FuncInf.html",
72 "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL +
73 "<dd>This is a functional interface and can therefore be used as " +
74 "the assignment target for a lambda expression or method " +
75 "reference.</dd>" + NL + "</dl>"}
76 };
77 private static final String[][] NEGATED_TEST = {
78 {BUG_ID + FS + "pkg" + FS + "A.html",
79 "<td class=\"colFirst\"><code>default default void</code></td>"},
80 {BUG_ID + FS + "pkg" + FS + "A.html",
81 "<pre>default default void defaultMethod()</pre>"},
82 {BUG_ID + FS + "pkg" + FS + "B.html",
83 "<td class=\"colFirst\"><code>default void</code></td>"},
84 {BUG_ID + FS + "pkg" + FS + "B.html",
85 "<dl>" + NL + "<dt>Functional Interface:</dt>"}
|
15 * You should have received a copy of the GNU General Public License version
16 * 2 along with this work; if not, write to the Free Software Foundation,
17 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
18 *
19 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
20 * or visit www.oracle.com if you need additional information or have any
21 * questions.
22 */
23
24 /*
25 * @test
26 * @bug 8004893 8022738
27 * @summary Make sure that the lambda feature changes work fine in
28 * javadoc.
29 * @author bpatel
30 * @library ../lib/
31 * @build JavadocTester TestLambdaFeature
32 * @run main TestLambdaFeature
33 */
34
35 /*
36 * NOTE : This test should be elided when version 1.7 support is removed from the JDK
37 * or the negative part of the test showing 1.7's non-support should be
38 * removed [ 8022738 ]
39 */
40
41 public class TestLambdaFeature extends JavadocTester {
42
43 //Test information.
44 private static final String BUG_ID = "8004893-8022738";
45
46 //Javadoc arguments.
47 private static final String[] ARGS = new String[] {
48 "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg", "pkg1"
49 };
50
51 private static final String[] ARGS_1 = new String[] {
52 "-d", BUG_ID + "-2", "-sourcepath", SRC_DIR, "-source", "1.7", "pkg1"
53 };
54
55 //Input for string search tests.
56 private static final String[][] TEST = {
57 {BUG_ID + FS + "pkg" + FS + "A.html",
58 "<td class=\"colFirst\"><code>default void</code></td>"},
59 {BUG_ID + FS + "pkg" + FS + "A.html",
60 "<pre>default void defaultMethod()</pre>"},
61 {BUG_ID + FS + "pkg" + FS + "A.html",
62 "<caption><span id=\"t0\" class=\"activeTableTab\"><span>" +
63 "All Methods</span><span class=\"tabEnd\"> </span></span>" +
64 "<span id=\"t2\" class=\"tableTab\"><span>" +
65 "<a href=\"javascript:show(2);\">Instance Methods</a></span>" +
66 "<span class=\"tabEnd\"> </span></span><span id=\"t3\" " +
67 "class=\"tableTab\"><span><a href=\"javascript:show(4);\">" +
68 "Abstract Methods</a></span><span class=\"tabEnd\"> </span>" +
69 "</span><span id=\"t5\" class=\"tableTab\"><span>" +
70 "<a href=\"javascript:show(16);\">Default Methods</a></span>" +
71 "<span class=\"tabEnd\"> </span></span></caption>"},
72 {BUG_ID + FS + "pkg" + FS + "A.html",
73 "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL +
74 "<dd>This is a functional interface and can therefore be used as " +
75 "the assignment target for a lambda expression or method " +
76 "reference.</dd>" + NL + "</dl>"},
77 {BUG_ID + FS + "pkg1" + FS + "FuncInf.html",
78 "<dl>" + NL + "<dt>Functional Interface:</dt>" + NL +
79 "<dd>This is a functional interface and can therefore be used as " +
80 "the assignment target for a lambda expression or method " +
81 "reference.</dd>" + NL + "</dl>"}
82 };
83 private static final String[][] NEGATED_TEST = {
84 {BUG_ID + FS + "pkg" + FS + "A.html",
85 "<td class=\"colFirst\"><code>default default void</code></td>"},
86 {BUG_ID + FS + "pkg" + FS + "A.html",
87 "<pre>default default void defaultMethod()</pre>"},
88 {BUG_ID + FS + "pkg" + FS + "B.html",
89 "<td class=\"colFirst\"><code>default void</code></td>"},
90 {BUG_ID + FS + "pkg" + FS + "B.html",
91 "<dl>" + NL + "<dt>Functional Interface:</dt>"}
|