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