1 // 2016 and later: Unicode, Inc. and others. 2 // License & terms of use: http://www.unicode.org/copyright.html#License 3 /* 4 ******************************************************************************* 5 * Copyright (C) 2002-2010, International Business Machines Corporation and * 6 * others. All Rights Reserved. * 7 ******************************************************************************* 8 */ 9 10 /** 11 * Port From: ICU4C v2.1 : Collate/CollationTurkishTest 12 * Source File: $ICU4CRoot/source/test/intltest/trcoll.cpp 13 **/ 14 15 package com.ibm.icu.dev.test.collator; 16 17 import java.util.Locale; 18 19 import org.junit.Test; 20 import org.junit.runner.RunWith; 21 import org.junit.runners.JUnit4; 22 23 import com.ibm.icu.dev.test.TestFmwk; 24 import com.ibm.icu.text.Collator; 25 import com.ibm.icu.text.RuleBasedCollator; 26 27 @RunWith(JUnit4.class) 28 public class CollationChineseTest extends TestFmwk{ 29 public CollationChineseTest() 30 { 31 } 32 33 @Test 34 public void TestPinYin() 35 { 36 String seq[] 37 = {"\u963f", "\u554a", "\u54ce", "\u6371", "\u7231", "\u9f98", 38 "\u4e5c", "\u8baa", "\u4e42", "\u53c8"}; 39 RuleBasedCollator collator = null; 40 try { 41 collator = (RuleBasedCollator)Collator.getInstance( 42 new Locale("zh", "", "PINYIN")); 43 } catch (Exception e) { 44 warnln("ERROR: in creation of collator of zh__PINYIN locale"); 45 return; 46 } 47 for (int i = 0; i < seq.length - 1; i ++) { 48 CollationTest.doTest(this, collator, seq[i], seq[i + 1], -1); 49 } 50 } 51 } 52