2 *******************************************************************************
3 * Copyright (C) 1996-2006, International Business Machines Corporation and *
4 * others. All Rights Reserved. *
5 *******************************************************************************
7 package com.ibm.icu.dev.test.lang;
8 import com.ibm.icu.dev.test.TestFmwk;
9 import com.ibm.icu.lang.UCharacterCategory;
12 * Testing UCharacterCategory
13 * @author Syn Wee Quek
14 * @since April 02 2002
16 public class UCharacterCategoryTest extends TestFmwk
18 // constructor -----------------------------------------------------------
21 * Private constructor to prevent initialisation
23 public UCharacterCategoryTest()
27 // public methods --------------------------------------------------------
29 public static void main(String[] arg)
33 UCharacterCategoryTest test = new UCharacterCategoryTest();
43 * Gets the name of the argument category
44 * @returns category name
46 public void TestToString()
48 String name[] = {"Unassigned",
56 "Mark, Spacing Combining",
57 "Number, Decimal Digit",
62 "Separator, Paragraph",
70 "Punctuation, Connector",
76 "Punctuation, Initial quote",
77 "Punctuation, Final quote"};
78 for (int i = UCharacterCategory.UNASSIGNED;
79 i < UCharacterCategory.CHAR_CATEGORY_COUNT; i ++) {
80 if (!UCharacterCategory.toString(i).equals(name[i])) {
81 errln("Error toString for category " + i + " expected " +