langtools/test/com/sun/javadoc/testHtmlTag/TestHtmlTag.java
author jjg
Fri, 25 Apr 2014 13:08:41 -0700
changeset 24217 25b12d4d4192
parent 24072 e7549dcbc4af
child 24399 af1a0220d0fa
permissions -rw-r--r--
8040904: Ensure javadoc tests do not overwrite results within tests Reviewed-by: ksrini
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
     1
/*
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 7681
diff changeset
     2
 * Copyright (c) 2009, 2014, Oracle and/or its affiliates. All rights reserved.
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
     3
 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
     4
 *
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
     5
 * This code is free software; you can redistribute it and/or modify it
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
     6
 * under the terms of the GNU General Public License version 2 only, as
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1863
diff changeset
     7
 * published by the Free Software Foundation.  Oracle designates this
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
     8
 * particular file as subject to the "Classpath" exception as provided
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1863
diff changeset
     9
 * by Oracle in the LICENSE file that accompanied this code.
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    10
 *
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    11
 * This code is distributed in the hope that it will be useful, but WITHOUT
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    12
 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    13
 * FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General Public License
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    14
 * version 2 for more details (a copy is included in the LICENSE file that
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    15
 * accompanied this code).
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    16
 *
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    17
 * You should have received a copy of the GNU General Public License version
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    18
 * 2 along with this work; if not, write to the Free Software Foundation,
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    19
 * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    20
 *
5520
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1863
diff changeset
    21
 * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1863
diff changeset
    22
 * or visit www.oracle.com if you need additional information or have any
86e4b9a9da40 6943119: Rebrand source copyright notices
ohair
parents: 1863
diff changeset
    23
 * questions.
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    24
 */
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    25
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    26
/*
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    27
 * @test
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    28
 * @bug 6786682
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    29
 * @summary This test verifies the use of lang attribute by <HTML>.
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    30
 * @author Bhavesh Patel
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    31
 * @library ../lib/
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    32
 * @build JavadocTester
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    33
 * @build TestHtmlTag
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    34
 * @run main TestHtmlTag
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    35
 */
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    36
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    37
import java.util.Locale;
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    38
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    39
public class TestHtmlTag extends JavadocTester {
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    40
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    41
    private static final String[][] TEST1 = {
24072
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    42
        { "pkg1/C1.html",
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 7681
diff changeset
    43
            "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"},
24072
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    44
        { "pkg1/package-summary.html",
23971
f5ff1f5a8dee 8031649: Clean up javadoc tests
jjg
parents: 7681
diff changeset
    45
            "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    46
    private static final String[][] NEGATED_TEST1 = {
24072
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    47
        { "pkg1/C1.html", "<html>"}};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    48
    private static final String[][] TEST2 = {
24072
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    49
        { "pkg2/C2.html", "<html lang=\"ja\">"},
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    50
        { "pkg2/package-summary.html", "<html lang=\"ja\">"}};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    51
    private static final String[][] NEGATED_TEST2 = {
24072
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    52
        { "pkg2/C2.html", "<html>"}};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    53
    private static final String[][] TEST3 = {
24072
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    54
        { "pkg1/C1.html", "<html lang=\"en\">"},
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    55
        { "pkg1/package-summary.html", "<html lang=\"en\">"}};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    56
    private static final String[][] NEGATED_TEST3 = {
24072
e7549dcbc4af 8040903: Clean up use of BUG_ID in javadoc tests
jjg
parents: 24065
diff changeset
    57
        { "pkg1/C1.html", "<html>"}};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    58
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    59
    private static final String[] ARGS1 =
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    60
        new String[] {
24217
25b12d4d4192 8040904: Ensure javadoc tests do not overwrite results within tests
jjg
parents: 24072
diff changeset
    61
            "-d", OUTPUT_DIR + "-1", "-sourcepath", SRC_DIR, "pkg1"};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    62
    private static final String[] ARGS2 =
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    63
        new String[] {
24217
25b12d4d4192 8040904: Ensure javadoc tests do not overwrite results within tests
jjg
parents: 24072
diff changeset
    64
            "-locale", "ja", "-d", OUTPUT_DIR + "-2", "-sourcepath", SRC_DIR, "pkg2"};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    65
    private static final String[] ARGS3 =
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    66
        new String[] {
24217
25b12d4d4192 8040904: Ensure javadoc tests do not overwrite results within tests
jjg
parents: 24072
diff changeset
    67
            "-locale", "en_US", "-d", OUTPUT_DIR + "-3", "-sourcepath", SRC_DIR, "pkg1"};
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    68
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    69
    /**
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    70
     * The entry point of the test.
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    71
     * @param args the array of command line arguments.
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    72
     */
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    73
    public static void main(String[] args) {
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    74
        TestHtmlTag tester = new TestHtmlTag();
24065
fc4022e50129 8041150: Avoid silly use of static methods in JavadocTester
jjg
parents: 23971
diff changeset
    75
        tester.run(ARGS1, TEST1, NEGATED_TEST1);
fc4022e50129 8041150: Avoid silly use of static methods in JavadocTester
jjg
parents: 23971
diff changeset
    76
        tester.run(ARGS2, TEST2, NEGATED_TEST2);
fc4022e50129 8041150: Avoid silly use of static methods in JavadocTester
jjg
parents: 23971
diff changeset
    77
        tester.run(ARGS3, TEST3, NEGATED_TEST3);
1863
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    78
        tester.printSummary();
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    79
    }
e5de9abc0eb1 6786682: Javadoc HTML WCAG 2.0 accessibility issues in standard doclet - HTML tag should have lang attribute
bpatel
parents:
diff changeset
    80
}