TestAnnotationTypes.java revision 2382:903e207a9fac
1/*
2 * Copyright (c) 2004, 2014, 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 */
23
24/*
25 * @test
26 * @bug      4973609 8015249 8025633 8026567
27 * @summary  Make sure that annotation types with 0 members does not have
28 *           extra HR tags.
29 * @author   jamieh
30 * @library  ../lib/
31 * @build    JavadocTester TestAnnotationTypes
32 * @run main TestAnnotationTypes
33 */
34
35public class TestAnnotationTypes extends JavadocTester {
36
37    //Javadoc arguments.
38    private static final String[] ARGS = new String[] {
39        "-d", OUTPUT_DIR, "-sourcepath", SRC_DIR, "pkg"
40    };
41
42    //Input for string search tests.
43    private static final String[][] TEST = {
44        { "pkg/AnnotationTypeField.html",
45            "<li>Summary:&nbsp;</li>\n" +
46            "<li><a href=\"#annotation.type." +
47            "field.summary\">Field</a>&nbsp;|&nbsp;</li>"},
48        { "pkg/AnnotationTypeField.html",
49            "<li>Detail:&nbsp;</li>\n" +
50            "<li><a href=\"#annotation.type." +
51            "field.detail\">Field</a>&nbsp;|&nbsp;</li>"},
52        { "pkg/AnnotationTypeField.html",
53            "<!-- =========== ANNOTATION TYPE FIELD SUMMARY =========== -->"},
54        { "pkg/AnnotationTypeField.html",
55            "<h3>Field Summary</h3>"},
56        { "pkg/AnnotationTypeField.html",
57            "<td class=\"colLast\"><code><span class=\"memberNameLink\"><a href=\"../" +
58            "pkg/AnnotationTypeField.html#DEFAULT_NAME\">DEFAULT_NAME</a></span>" +
59            "</code>&nbsp;</td>"},
60        { "pkg/AnnotationTypeField.html",
61            "<!-- ============ ANNOTATION TYPE FIELD DETAIL =========== -->"},
62        { "pkg/AnnotationTypeField.html",
63            "<h4>DEFAULT_NAME</h4>\n" +
64            "<pre>public static final&nbsp;java." +
65            "lang.String&nbsp;DEFAULT_NAME</pre>"},
66        { "pkg/AnnotationType.html",
67            "<li>Summary:&nbsp;</li>\n" +
68            "<li>Field&nbsp;|&nbsp;</li>"},
69        { "pkg/AnnotationType.html",
70            "<li>Detail:&nbsp;</li>\n" +
71            "<li>Field&nbsp;|&nbsp;</li>"},
72    };
73    private static final String[][] NEGATED_TEST = {
74        { "pkg/AnnotationType.html",
75            "<HR>\n\n" +
76            "<P>\n\n" +
77            "<P>" +
78            "<!-- ========= END OF CLASS DATA ========= -->" + "<HR>"}
79    };
80
81    /**
82     * The entry point of the test.
83     * @param args the array of command line arguments.
84     */
85    public static void main(String[] args) {
86        TestAnnotationTypes tester = new TestAnnotationTypes();
87        tester.run(ARGS, TEST, NEGATED_TEST);
88        tester.printSummary();
89    }
90}
91