Thu, 15 Jul 2010 16:31:02 +0100
6967002: JDK7 b99 javac compilation error (java.lang.AssertionError)
Summary: bug in JavacParser related to parsing of type annotations in varargs position
Reviewed-by: jjg
Contributed-by: mahmood@notnoop.com
1 /*
2 * Copyright (c) 2003, 2004, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation.
8 *
9 * This code is distributed in the hope that it will be useful, but WITHOUT
10 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
12 * version 2 for more details (a copy is included in the LICENSE file that
13 * accompanied this code).
14 *
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 */
24 /*
25 * @test
26 * @bug 4934778 4777599
27 * @summary Make sure that the -help option works properly. Make sure
28 * the help link appears in the documentation.
29 * @author jamieh
30 * @library ../lib/
31 * @build JavadocTester
32 * @build TestHelpOption
33 * @run main TestHelpOption
34 */
36 public class TestHelpOption extends JavadocTester {
38 //Test information.
39 private static final String BUG_ID = "4934778-4777599";
41 //Javadoc arguments.
42 private static final String[] ARGS = new String[] {
43 "-d", BUG_ID, "-sourcepath", SRC_DIR, "-help",
44 SRC_DIR + FS + "TestHelpOption.java"
45 };
47 private static final String[] ARGS2 = new String[] {
48 "-d", BUG_ID, "-sourcepath", SRC_DIR,
49 SRC_DIR + FS + "TestHelpOption.java"
50 };
52 private static final String[][] TEST = {
53 {STANDARD_OUTPUT, "-d "},
54 {STANDARD_OUTPUT, "-use "},
55 {STANDARD_OUTPUT, "-version "},
56 {STANDARD_OUTPUT, "-author "},
57 {STANDARD_OUTPUT, "-docfilessubdirs "},
58 {STANDARD_OUTPUT, "-splitindex "},
59 {STANDARD_OUTPUT, "-windowtitle "},
60 {STANDARD_OUTPUT, "-doctitle "},
61 {STANDARD_OUTPUT, "-header "},
62 {STANDARD_OUTPUT, "-footer "},
63 {STANDARD_OUTPUT, "-bottom "},
64 {STANDARD_OUTPUT, "-link "},
65 {STANDARD_OUTPUT, "-linkoffline "},
66 {STANDARD_OUTPUT, "-excludedocfilessubdir "},
67 {STANDARD_OUTPUT, "-group "},
68 {STANDARD_OUTPUT, "-nocomment "},
69 {STANDARD_OUTPUT, "-nodeprecated "},
70 {STANDARD_OUTPUT, "-noqualifier "},
71 {STANDARD_OUTPUT, "-nosince "},
72 {STANDARD_OUTPUT, "-notimestamp "},
73 {STANDARD_OUTPUT, "-nodeprecatedlist "},
74 {STANDARD_OUTPUT, "-notree "},
75 {STANDARD_OUTPUT, "-noindex "},
76 {STANDARD_OUTPUT, "-nohelp "},
77 {STANDARD_OUTPUT, "-nonavbar "},
78 {STANDARD_OUTPUT, "-serialwarn "},
79 {STANDARD_OUTPUT, "-tag "},
80 {STANDARD_OUTPUT, "-taglet "},
81 {STANDARD_OUTPUT, "-tagletpath "},
82 {STANDARD_OUTPUT, "-charset "},
83 {STANDARD_OUTPUT, "-helpfile "},
84 {STANDARD_OUTPUT, "-linksource "},
85 {STANDARD_OUTPUT, "-sourcetab "},
86 {STANDARD_OUTPUT, "-keywords "},
87 {STANDARD_OUTPUT, "-stylesheetfile "},
88 {STANDARD_OUTPUT, "-docencoding "},
89 };
90 private static final String[][] NEGATED_TEST = NO_TEST;
92 private static final String[][] TEST2 = {
93 {BUG_ID + FS + "TestHelpOption.html",
94 "<A HREF=\"help-doc.html\"><FONT CLASS=\"NavBarFont1\">" +
95 "<STRONG>Help</STRONG></FONT></A>"
96 },
97 };
98 private static final String[][] NEGATED_TEST2 = NO_TEST;
100 //The help option should not crash the doclet.
101 private static final int EXPECTED_EXIT_CODE = 0;
103 /**
104 * The entry point of the test.
105 * @param args the array of command line arguments.
106 */
107 public static void main(String[] args) {
108 TestHelpOption tester = new TestHelpOption();
109 int actualExitCode = run(tester, ARGS, TEST, NEGATED_TEST);
110 tester.checkExitCode(EXPECTED_EXIT_CODE, actualExitCode);
111 run(tester, ARGS2, TEST2, NEGATED_TEST2);
112 tester.printSummary();
113 }
115 /**
116 * {@inheritDoc}
117 */
118 public String getBugId() {
119 return BUG_ID;
120 }
122 /**
123 * {@inheritDoc}
124 */
125 public String getBugName() {
126 return getClass().getName();
127 }
128 }