Tue, 28 Dec 2010 15:54:52 -0800
6962318: Update copyright year
Reviewed-by: xdono
bpatel@191 | 1 | /* |
ohair@798 | 2 | * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved. |
bpatel@191 | 3 | * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. |
bpatel@191 | 4 | * |
bpatel@191 | 5 | * This code is free software; you can redistribute it and/or modify it |
bpatel@191 | 6 | * under the terms of the GNU General Public License version 2 only, as |
ohair@554 | 7 | * published by the Free Software Foundation. Oracle designates this |
bpatel@191 | 8 | * particular file as subject to the "Classpath" exception as provided |
ohair@554 | 9 | * by Oracle in the LICENSE file that accompanied this code. |
bpatel@191 | 10 | * |
bpatel@191 | 11 | * This code is distributed in the hope that it will be useful, but WITHOUT |
bpatel@191 | 12 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or |
bpatel@191 | 13 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License |
bpatel@191 | 14 | * version 2 for more details (a copy is included in the LICENSE file that |
bpatel@191 | 15 | * accompanied this code). |
bpatel@191 | 16 | * |
bpatel@191 | 17 | * You should have received a copy of the GNU General Public License version |
bpatel@191 | 18 | * 2 along with this work; if not, write to the Free Software Foundation, |
bpatel@191 | 19 | * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA. |
bpatel@191 | 20 | * |
ohair@554 | 21 | * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA |
ohair@554 | 22 | * or visit www.oracle.com if you need additional information or have any |
ohair@554 | 23 | * questions. |
bpatel@191 | 24 | */ |
bpatel@191 | 25 | |
bpatel@191 | 26 | /* |
bpatel@191 | 27 | * @test |
bpatel@191 | 28 | * @bug 6786682 |
bpatel@191 | 29 | * @summary This test verifies the use of lang attribute by <HTML>. |
bpatel@191 | 30 | * @author Bhavesh Patel |
bpatel@191 | 31 | * @library ../lib/ |
bpatel@191 | 32 | * @build JavadocTester |
bpatel@191 | 33 | * @build TestHtmlTag |
bpatel@191 | 34 | * @run main TestHtmlTag |
bpatel@191 | 35 | */ |
bpatel@191 | 36 | |
bpatel@191 | 37 | import java.util.Locale; |
bpatel@191 | 38 | |
bpatel@191 | 39 | public class TestHtmlTag extends JavadocTester { |
bpatel@191 | 40 | |
bpatel@191 | 41 | private static final String BUG_ID = "6786682"; |
bpatel@191 | 42 | private static final String[][] TEST1 = { |
bpatel@766 | 43 | {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}, |
bpatel@766 | 44 | {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}}; |
bpatel@191 | 45 | private static final String[][] NEGATED_TEST1 = { |
bpatel@766 | 46 | {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}}; |
bpatel@191 | 47 | private static final String[][] TEST2 = { |
bpatel@766 | 48 | {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html lang=\"ja\">"}, |
bpatel@766 | 49 | {BUG_ID + FS + "pkg2" + FS + "package-summary.html", "<html lang=\"ja\">"}}; |
bpatel@191 | 50 | private static final String[][] NEGATED_TEST2 = { |
bpatel@766 | 51 | {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html>"}}; |
bpatel@191 | 52 | private static final String[][] TEST3 = { |
bpatel@766 | 53 | {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"en\">"}, |
bpatel@766 | 54 | {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"en\">"}}; |
bpatel@191 | 55 | private static final String[][] NEGATED_TEST3 = { |
bpatel@766 | 56 | {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}}; |
bpatel@191 | 57 | |
bpatel@191 | 58 | private static final String[] ARGS1 = |
bpatel@191 | 59 | new String[] { |
bpatel@191 | 60 | "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; |
bpatel@191 | 61 | private static final String[] ARGS2 = |
bpatel@191 | 62 | new String[] { |
bpatel@191 | 63 | "-locale", "ja", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg2"}; |
bpatel@191 | 64 | private static final String[] ARGS3 = |
bpatel@191 | 65 | new String[] { |
bpatel@191 | 66 | "-locale", "en_US", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"}; |
bpatel@191 | 67 | |
bpatel@191 | 68 | /** |
bpatel@191 | 69 | * The entry point of the test. |
bpatel@191 | 70 | * @param args the array of command line arguments. |
bpatel@191 | 71 | */ |
bpatel@191 | 72 | public static void main(String[] args) { |
bpatel@191 | 73 | TestHtmlTag tester = new TestHtmlTag(); |
bpatel@191 | 74 | run(tester, ARGS1, TEST1, NEGATED_TEST1); |
bpatel@191 | 75 | run(tester, ARGS2, TEST2, NEGATED_TEST2); |
bpatel@191 | 76 | run(tester, ARGS3, TEST3, NEGATED_TEST3); |
bpatel@191 | 77 | tester.printSummary(); |
bpatel@191 | 78 | } |
bpatel@191 | 79 | |
bpatel@191 | 80 | /** |
bpatel@191 | 81 | * {@inheritDoc} |
bpatel@191 | 82 | */ |
bpatel@191 | 83 | public String getBugId() { |
bpatel@191 | 84 | return BUG_ID; |
bpatel@191 | 85 | } |
bpatel@191 | 86 | |
bpatel@191 | 87 | /** |
bpatel@191 | 88 | * {@inheritDoc} |
bpatel@191 | 89 | */ |
bpatel@191 | 90 | public String getBugName() { |
bpatel@191 | 91 | return getClass().getName(); |
bpatel@191 | 92 | } |
bpatel@191 | 93 | } |