Path: blob/aarch64-shenandoah-jdk8u272-b10/jdk/test/java/text/Collator/ThaiTest.java
47182 views
/*1* Copyright (c) 1997, 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* @library /java/text/testlib26* @summary test Thai Collation27*/28/*29* Copyright (c) 2007, Oracle and/or its affiliates. All rights reserved.30*31* This software is the proprietary information of Oracle.32* Use is subject to license terms.33*34*/3536import java.util.Locale;37import java.text.Collator;38import java.text.RuleBasedCollator;3940public class ThaiTest extends CollatorTest {4142public static void main(String[] args) throws Exception {43new ThaiTest().run(args);44}4546/*47* Data for TestPrimary()48*/49private static final String[] primarySourceData = {50"\u0e01\u0e01",51"\u0e07\u0e42\u0e01\u0e49",52"\u0e10\u0e34\u0e19",53"\u0e16\u0e32\u0e21\u0e23\u0e23\u0e04\u0e40\u0e17\u0e28\u0e19\u0e32",54"\u0e23\u0e21\u0e18\u0e23\u0e23\u0e21\u0e4c\u0e1b\u0e23\u0e30\u0e01\u0e31\u0e19\u0e20\u0e31\u0e22",55"\u0e23\u0e23\u0e21\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2b\u0e21\u0e32\u0e22\u0e41\u0e25\u0e30\u0e22\u0e35\u0e48\u0e2b\u0e49\u0e2d\u0e01\u0e32\u0e23\u0e04\u0e49\u0e32\u0e02\u0e32\u0e22",56"\u0e23\u0e23\u0e25\u0e38\u0e19\u0e34\u0e15\u0e34\u0e20\u0e32\u0e27\u0e30",57"\u0e01\u0e25\u0e37\u0e2d\u0e41\u0e01\u0e07",58"\u0e21\u0e17\u0e34\u0e25\u0e41\u0e2d\u0e25\u0e01\u0e2d\u0e2e\u0e2d\u0e25\u0e4c",59"\u0e40\u0e2d\u0e35\u0e48\u0e22\u0e21\u0e2d\u0e48\u0e2d\u0e07",60"\u0e2a\u0e14\u0e32\u0e1b\u0e31\u0e15\u0e15\u0e34\u0e1c\u0e25",61"\u0e2d\u0e19\u0e01\u0e23\u0e23\u0e21\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c",62"\u0e21\u0e49\u0e40\u0e17\u0e49\u0e32\u0e22\u0e32\u0e22\u0e21\u0e48\u0e2d\u0e21",63"\u0e2a\u0e49\u0e25\u0e30\u0e21\u0e32\u0e19",64"\u0e2a\u0e49\u0e28\u0e36\u0e01",65"\u0e2a\u0e49\u0e2d\u0e31\u0e48\u0e27",66"\u0e2a\u0e49\u0e40\u0e14\u0e37\u0e2d\u0e19",67"\u0e2a\u0e49\u0e40\u0e25\u0e37\u0e48\u0e2d\u0e19",68"\u0e2a\u0e49\u0e41\u0e02\u0e27\u0e19",69"\u0e2a\u0e49\u0e41\u0e2b\u0e49\u0e07",70"\u0e2a\u0e49\u0e44\u0e01\u0e48",71"\u0e2b",72"\u0e2b\u0e0b\u0e2d\u0e07",73"\u0e2b\u0e19",74"\u0e2b\u0e1b\u0e25\u0e32\u0e23\u0e49\u0e32",75"\u0e2b\u0e21",76"\u0e2b\u0e21\u0e17\u0e2d\u0e07",77"\u0e2b\u0e21\u0e2a\u0e31\u0e1a\u0e1b\u0e30\u0e23\u0e14",78"\u0e2b\u0e21\u0e49",79"\u0e2b\u0e23\u0e13\u0e22\u0e4c",80"\u0e2b\u0e25",81"\u0e2b\u0e25\u0e19\u0e49\u0e33",82"\u0e2b\u0e25\u0e48",83"\u0e2b\u0e25\u0e48\u0e16\u0e19\u0e19",84"\u0e2b\u0e25\u0e48\u0e17\u0e27\u0e35\u0e1b",85"\u0e2b\u0e25\u0e48\u0e17\u0e32\u0e07",86"\u0e2b\u0e25\u0e48\u0e23\u0e27\u0e1a",87"\u0e2b\u0e49",88"\u0e2d",89"\u0e2d\u0e49",90"\u0e2e\u0e42\u0e25",91"\u0e2e\u0e44\u0e1f",92"\u0e2e\u0e49"93};9495private static final String[] primaryTargetData = {96"\u0e01\u0e01",97"\u0e07\u0e42\u0e01\u0e49",98"\u0e10\u0e34\u0e19",99"\u0e16\u0e32\u0e21\u0e23\u0e23\u0e04\u0e40\u0e17\u0e28\u0e19\u0e32",100"\u0e23\u0e21\u0e18\u0e23\u0e23\u0e21\u0e4c\u0e1b\u0e23\u0e30\u0e01\u0e31\u0e19\u0e20\u0e31\u0e22",101"\u0e23\u0e23\u0e21\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c\u0e40\u0e04\u0e23\u0e37\u0e48\u0e2d\u0e07\u0e2b\u0e21\u0e32\u0e22\u0e41\u0e25\u0e30\u0e22\u0e35\u0e48\u0e2b\u0e49\u0e2d\u0e01\u0e32\u0e23\u0e04\u0e49\u0e32\u0e02\u0e32\u0e22",102"\u0e23\u0e23\u0e25\u0e38\u0e19\u0e34\u0e15\u0e34\u0e20\u0e32\u0e27\u0e30",103"\u0e01\u0e25\u0e37\u0e2d\u0e41\u0e01\u0e07",104"\u0e21\u0e17\u0e34\u0e25\u0e41\u0e2d\u0e25\u0e01\u0e2d\u0e2e\u0e2d\u0e25\u0e4c",105"\u0e40\u0e2d\u0e35\u0e48\u0e22\u0e21\u0e2d\u0e48\u0e2d\u0e07",106"\u0e2a\u0e14\u0e32\u0e1b\u0e31\u0e15\u0e15\u0e34\u0e1c\u0e25",107"\u0e2d\u0e19\u0e01\u0e23\u0e23\u0e21\u0e2a\u0e34\u0e17\u0e18\u0e34\u0e4c",108"\u0e21\u0e49\u0e40\u0e17\u0e49\u0e32\u0e22\u0e32\u0e22\u0e21\u0e48\u0e2d\u0e21",109"\u0e2a\u0e49\u0e25\u0e30\u0e21\u0e32\u0e19",110"\u0e2a\u0e49\u0e28\u0e36\u0e01",111"\u0e2a\u0e49\u0e2d\u0e31\u0e48\u0e27",112"\u0e2a\u0e49\u0e40\u0e14\u0e37\u0e2d\u0e19",113"\u0e2a\u0e49\u0e40\u0e25\u0e37\u0e48\u0e2d\u0e19",114"\u0e2a\u0e49\u0e41\u0e02\u0e27\u0e19",115"\u0e2a\u0e49\u0e41\u0e2b\u0e49\u0e07",116"\u0e2a\u0e49\u0e44\u0e01\u0e48",117"\u0e2b",118"\u0e2b\u0e0b\u0e2d\u0e07",119"\u0e2b\u0e19",120"\u0e2b\u0e1b\u0e25\u0e32\u0e23\u0e49\u0e32",121"\u0e2b\u0e21",122"\u0e2b\u0e21\u0e17\u0e2d\u0e07",123"\u0e2b\u0e21\u0e2a\u0e31\u0e1a\u0e1b\u0e30\u0e23\u0e14",124"\u0e2b\u0e21\u0e49",125"\u0e2b\u0e23\u0e13\u0e22\u0e4c",126"\u0e2b\u0e25",127"\u0e2b\u0e25\u0e19\u0e49\u0e33",128"\u0e2b\u0e25\u0e48",129"\u0e2b\u0e25\u0e48\u0e16\u0e19\u0e19",130"\u0e2b\u0e25\u0e48\u0e17\u0e27\u0e35\u0e1b",131"\u0e2b\u0e25\u0e48\u0e17\u0e32\u0e07",132"\u0e2b\u0e25\u0e48\u0e23\u0e27\u0e1a",133"\u0e2b\u0e49",134"\u0e2d",135"\u0e2d\u0e49",136"\u0e2e\u0e42\u0e25",137"\u0e2e\u0e44\u0e1f",138"\u0e2e\u0e49"139};140141private static final int[] primaryResults = {1420, 0, 0, 0, 0, 0, 0, 0, 0, 0,1430, 0, 0, 0, 0, 0, 0, 0, 0, 0,1440, 0, 0, 0, 0, 0, 0, 0, 0, 0,1450, 0, 0, 0, 0, 0, 0, 0, 0, 0,1460, 0, 0147};148149public void TestPrimary() {150doTest(myCollation, Collator.PRIMARY,151primarySourceData, primaryTargetData, primaryResults);152}153154private final Collator myCollation = Collator.getInstance(new Locale("th"));155}156157158