Path: blob/aarch64-shenandoah-jdk8u272-b10/langtools/test/com/sun/javadoc/testCharset/TestCharset.java
48568 views
/*1* Copyright (c) 2013, Oracle and/or its affiliates. All rights reserved.2* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.3*4* This code is free software; you can redistribute it and/or modify it5* under the terms of the GNU General Public License version 2 only, as6* published by the Free Software Foundation.7*8* This code is distributed in the hope that it will be useful, but WITHOUT9* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or10* FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License11* version 2 for more details (a copy is included in the LICENSE file that12* accompanied this code).13*14* You should have received a copy of the GNU General Public License version15* 2 along with this work; if not, write to the Free Software Foundation,16* Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA.17*18* Please contact Oracle, 500 Oracle Parkway, Redwood Shores, CA 94065 USA19* or visit www.oracle.com if you need additional information or have any20* questions.21*/2223/*24* @test25* @bug 705217026* @summary Run a test on -charset to make sure the charset gets generated as a27* part of the meta tag.28* @author Bhavesh Patel29* @library ../lib/30* @build JavadocTester TestCharset31* @run main TestCharset32*/3334public class TestCharset extends JavadocTester {3536//Test information.37private static final String BUG_ID = "7052170";3839//Javadoc arguments.40private static final String[] ARGS = new String[] {41"-d", BUG_ID, "-charset", "UTF-8", "-sourcepath", SRC_DIR, "pkg"42};4344private static final String[][] TEST = {45{BUG_ID + FS + "index.html",46"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"},47{BUG_ID + FS + "pkg" + FS + "Foo.html",48"<meta http-equiv=\"Content-Type\" content=\"text/html; charset=UTF-8\">"}49};5051private static final String[][] NEGATED_TEST = {52{BUG_ID + FS + "index.html",53"<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"},54{BUG_ID + FS + "pkg" + FS + "Foo.html",55"<meta http-equiv=\"Content-Type\" content=\"text/html\" charset=\"UTF-8\">"}56};5758/**59* The entry point of the test.60* @param args the array of command line arguments.61*/62public static void main(String[] args) {63TestCharset tester = new TestCharset();64run(tester, ARGS, TEST, NEGATED_TEST);65tester.printSummary();66}6768/**69* {@inheritDoc}70*/71public String getBugId() {72return BUG_ID;73}7475/**76* {@inheritDoc}77*/78public String getBugName() {79return getClass().getName();80}81}828384