190N/A/*
797N/A * Copyright (c) 2009, 2010, Oracle and/or its affiliates. All rights reserved.
190N/A * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
190N/A *
190N/A * This code is free software; you can redistribute it and/or modify it
190N/A * under the terms of the GNU General Public License version 2 only, as
553N/A * published by the Free Software Foundation. Oracle designates this
190N/A * particular file as subject to the "Classpath" exception as provided
553N/A * by Oracle in the LICENSE file that accompanied this code.
190N/A *
190N/A * This code is distributed in the hope that it will be useful, but WITHOUT
190N/A * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
190N/A * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
190N/A * version 2 for more details (a copy is included in the LICENSE file that
190N/A * accompanied this code).
190N/A *
190N/A * You should have received a copy of the GNU General Public License version
190N/A * 2 along with this work; if not, write to the Free Software Foundation,
190N/A * Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.
190N/A *
553N/A * Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA
553N/A * or visit www.oracle.com if you need additional information or have any
553N/A * questions.
190N/A */
190N/A
190N/A/*
190N/A * @test
190N/A * @bug 6786682
190N/A * @summary This test verifies the use of lang attribute by <HTML>.
190N/A * @author Bhavesh Patel
190N/A * @library ../lib/
190N/A * @build JavadocTester
190N/A * @build TestHtmlTag
190N/A * @run main TestHtmlTag
190N/A */
190N/A
190N/Aimport java.util.Locale;
190N/A
190N/Apublic class TestHtmlTag extends JavadocTester {
190N/A
190N/A private static final String BUG_ID = "6786682";
190N/A private static final String[][] TEST1 = {
765N/A {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"},
765N/A {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"" + Locale.getDefault().getLanguage() + "\">"}};
190N/A private static final String[][] NEGATED_TEST1 = {
765N/A {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}};
190N/A private static final String[][] TEST2 = {
765N/A {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html lang=\"ja\">"},
765N/A {BUG_ID + FS + "pkg2" + FS + "package-summary.html", "<html lang=\"ja\">"}};
190N/A private static final String[][] NEGATED_TEST2 = {
765N/A {BUG_ID + FS + "pkg2" + FS + "C2.html", "<html>"}};
190N/A private static final String[][] TEST3 = {
765N/A {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html lang=\"en\">"},
765N/A {BUG_ID + FS + "pkg1" + FS + "package-summary.html", "<html lang=\"en\">"}};
190N/A private static final String[][] NEGATED_TEST3 = {
765N/A {BUG_ID + FS + "pkg1" + FS + "C1.html", "<html>"}};
190N/A
190N/A private static final String[] ARGS1 =
190N/A new String[] {
190N/A "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
190N/A private static final String[] ARGS2 =
190N/A new String[] {
190N/A "-locale", "ja", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg2"};
190N/A private static final String[] ARGS3 =
190N/A new String[] {
190N/A "-locale", "en_US", "-d", BUG_ID, "-sourcepath", SRC_DIR, "pkg1"};
190N/A
190N/A /**
190N/A * The entry point of the test.
190N/A * @param args the array of command line arguments.
190N/A */
190N/A public static void main(String[] args) {
190N/A TestHtmlTag tester = new TestHtmlTag();
190N/A run(tester, ARGS1, TEST1, NEGATED_TEST1);
190N/A run(tester, ARGS2, TEST2, NEGATED_TEST2);
190N/A run(tester, ARGS3, TEST3, NEGATED_TEST3);
190N/A tester.printSummary();
190N/A }
190N/A
190N/A /**
190N/A * {@inheritDoc}
190N/A */
190N/A public String getBugId() {
190N/A return BUG_ID;
190N/A }
190N/A
190N/A /**
190N/A * {@inheritDoc}
190N/A */
190N/A public String getBugName() {
190N/A return getClass().getName();
190N/A }
190N/A}