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