01: /*
02: *******************************************************************************
03: * Copyright (C) 2002-2005, International Business Machines Corporation and *
04: * others. All Rights Reserved. *
05: *******************************************************************************
06: */
07:
08: /**
09: * Port From: ICU4C v2.1 : Collate/CollationTurkishTest
10: * Source File: $ICU4CRoot/source/test/intltest/trcoll.cpp
11: **/package com.ibm.icu.dev.test.collator;
12:
13: import com.ibm.icu.dev.test.*;
14: import com.ibm.icu.text.*;
15: import java.util.Locale;
16:
17: public class CollationChineseTest extends TestFmwk {
18: public static void main(String[] args) throws Exception {
19: new CollationChineseTest().run(args);
20: }
21:
22: public CollationChineseTest() {
23: }
24:
25: public void TestPinYin() {
26: String seq[] = { "\u963f", "\u554a", "\u54ce", "\u6371",
27: "\u7231", "\u9f98", "\u4e5c", "\u8baa", "\u4e42",
28: "\u53c8" };
29: RuleBasedCollator collator = null;
30: try {
31: collator = (RuleBasedCollator) Collator
32: .getInstance(new Locale("zh", "", "PINYIN"));
33: } catch (Exception e) {
34: warnln("ERROR: in creation of collator of zh__PINYIN locale");
35: return;
36: }
37: for (int i = 0; i < seq.length - 1; i++) {
38: CollationTest
39: .doTest(this , collator, seq[i], seq[i + 1], -1);
40: }
41: }
42: }
|