Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/text/Collator/VietnameseTest.java
47182 views
/*1* Copyright (c) 2003, 2016, 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 4932968 501521526* @library /java/text/testlib27* @summary test Vietnamese Collation28*/2930/*31*******************************************************************************32* (C) Copyright IBM Corp. 1996-2003 - All Rights Reserved *33* *34* The original version of this source code and documentation is copyrighted *35* and owned by IBM, These materials are provided under terms of a License *36* Agreement between IBM and Sun. This technology is protected by multiple *37* US and International patents. This notice and attribution to IBM may not *38* to removed. *39*******************************************************************************40*/4142import java.util.Locale;43import java.text.Collator;4445// Quick dummy program for printing out test results46public class VietnameseTest extends CollatorTest {4748public static void main(String[] args) throws Exception {49new VietnameseTest().run(args);50}5152private final static String testPS[] = {53"a",54"a",55"\u00c2",56"Cz",57"d",58"e",59"e",60"\u1ec7",61"gz",62"i",63"kz",64"nz",65"nh",66"o",67"o",68"\u01a0",69"pz",70"tz",71"tr",72"u",73"u",74"y"75};7677private final static String testPT[] = {78"\u00e0",79"\u0102",80"\u0102",81"Ch",82"\u0110",83"\u0111",84"\u1eb9",85"\u1eb9",86"gi",87"\u0128",88"kh",89"ng",90"ng",91"\u00f2",92"\u00f4",93"\u00f4",94"ph",95"th",96"th",97"\u1ee5",98"\u01b0",99"\u1ef4"100};101102private final static int testPR[] = {1030,104-1,1051,1061,107-1,1081,1090,1101,1111,1120,1131,1141,1151,1160,117-1,1181,1191,1201,1211,1220,123-1,1240125};126127private final static String testT[] = {128"a",129"A",130"\u00e0",131"\u00c0",132"\u1ea3",133"\u1ea2",134"\u00e3",135"\u00c3",136"\u00e1",137"\u00c1",138"\u1ea1",139"\u1ea0",140"\u0103",141"\u0102",142"\u1eb1",143"\u1eb0",144"\u1eb3",145"\u1eb2",146"\u1eb5",147"\u1eb4",148"\u1eaf",149"\u1eae",150"\u1eb7",151"\u1eb6",152"\u00e2",153"\u00c2",154"\u1ea7",155"\u1ea6",156"\u1ea9",157"\u1ea8",158"\u1eab",159"\u1eaa",160"\u1ea5",161"\u1ea4",162"\u1ead",163"\u1eac",164"b",165"B",166"c",167"C",168"ch",169"Ch",170"CH",171"d",172"D",173"\u0111",174"\u0110",175"e",176"E",177"\u00e8",178"\u00c8",179"\u1ebb",180"\u1eba",181"\u1ebd",182"\u1ebc",183"\u00e9",184"\u00c9",185"\u1eb9",186"\u1eb8",187"\u00ea",188"\u00ca",189"\u1ec1",190"\u1ec0",191"\u1ec3",192"\u1ec2",193"\u1ec5",194"\u1ec4",195"\u1ebf",196"\u1ebe",197"\u1ec7",198"\u1ec6",199"f",200"F",201"g",202"G",203"gi",204"Gi",205"GI",206"gz",207"h",208"H",209"i",210"I",211"\u00ec",212"\u00cc",213"\u1ec9",214"\u1ec8",215"\u0129",216"\u0128",217"\u00ed",218"\u00cd",219"\u1ecb",220"\u1eca",221"j",222"J",223"k",224"K",225"kh",226"Kh",227"KH",228"kz",229"l",230"L",231"m",232"M",233"n",234"N",235"ng",236"Ng",237"NG",238"ngz",239"nh",240"Nh",241"NH",242"nz",243"o",244"O",245"\u00f2",246"\u00d2",247"\u1ecf",248"\u1ece",249"\u00f5",250"\u00d5",251"\u00f3",252"\u00d3",253"\u1ecd",254"\u1ecc",255"\u00f4",256"\u00d4",257"\u1ed3",258"\u1ed2",259"\u1ed5",260"\u1ed4",261"\u1ed7",262"\u1ed6",263"\u1ed1",264"\u1ed0",265"\u1ed9",266"\u1ed8",267"\u01a1",268"\u01a0",269"\u1edd",270"\u1edc",271"\u1edf",272"\u1ede",273"\u1ee1",274"\u1ee0",275"\u1edb",276"\u1eda",277"\u1ee3",278"\u1ee2",279"p",280"P",281"ph",282"Ph",283"PH",284"pz",285"q",286"Q",287"r",288"R",289"s",290"S",291"t",292"T",293"th",294"Th",295"TH",296"thz",297"tr",298"Tr",299"TR",300"tz",301"u",302"U",303"\u00f9",304"\u00d9",305"\u1ee7",306"\u1ee6",307"\u0169",308"\u0168",309"\u00fa",310"\u00da",311"\u1ee5",312"\u1ee4",313"\u01b0",314"\u01af",315"\u1eeb",316"\u1eea",317"\u1eed",318"\u1eec",319"\u1eef",320"\u1eee",321"\u1ee9",322"\u1ee8",323"\u1ef1",324"\u1ef0",325"v",326"V",327"w",328"W",329"x",330"X",331"y",332"Y",333"\u1ef3",334"\u1ef2",335"\u1ef7",336"\u1ef6",337"\u1ef9",338"\u1ef8",339"\u00fd",340"\u00dd",341"\u1ef5",342"\u1ef4",343"z",344"Z"345};346347public void TestPrimary() {348doTest(myCollation, Collator.PRIMARY, testPS, testPT, testPR);349}350351public void TestTertiary() {352int testLength = testT.length;353354myCollation.setStrength(Collator.TERTIARY);355for (int i = 0; i < testLength - 1; i++) {356for (int j = i+1; j < testLength; j++) {357doTest(myCollation, testT[i], testT[j], -1);358}359}360}361362private final Collator myCollation = Collator.getInstance(new Locale("vi", "VN"));363}364365366