]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-52_1/main/tests/core/src/com/ibm/icu/dev/test/lang/UCharacterCategoryTest.java
Clean up imports.
[Dictionary.git] / jars / icu4j-52_1 / main / tests / core / src / com / ibm / icu / dev / test / lang / UCharacterCategoryTest.java
1 /**
2 *******************************************************************************
3 * Copyright (C) 1996-2006, International Business Machines Corporation and    *
4 * others. All Rights Reserved.                                                *
5 *******************************************************************************
6 */
7 package com.ibm.icu.dev.test.lang;
8 import com.ibm.icu.dev.test.TestFmwk;
9 import com.ibm.icu.lang.UCharacterCategory;
10
11 /**
12 * Testing UCharacterCategory
13 * @author Syn Wee Quek
14 * @since April 02 2002
15 */
16 public class UCharacterCategoryTest extends TestFmwk
17 {
18     // constructor -----------------------------------------------------------
19     
20     /**
21     * Private constructor to prevent initialisation
22     */
23     public UCharacterCategoryTest()
24     {
25     }
26     
27       // public methods --------------------------------------------------------
28       
29     public static void main(String[] arg)  
30     {
31         try
32         {
33               UCharacterCategoryTest test = new UCharacterCategoryTest();
34               test.run(arg);
35         }
36         catch (Exception e)
37         {
38               e.printStackTrace();
39         }
40     }
41     
42     /**
43     * Gets the name of the argument category
44     * @returns category name
45     */
46     public void TestToString()
47     {
48           String name[] = {"Unassigned",
49                            "Letter, Uppercase",
50                            "Letter, Lowercase",
51                            "Letter, Titlecase",
52                            "Letter, Modifier",
53                            "Letter, Other",
54                            "Mark, Non-Spacing",
55                            "Mark, Enclosing",
56                            "Mark, Spacing Combining",
57                            "Number, Decimal Digit",
58                            "Number, Letter",
59                            "Number, Other",
60                            "Separator, Space",
61                            "Separator, Line",
62                            "Separator, Paragraph",
63                            "Other, Control",
64                            "Other, Format",
65                            "Other, Private Use",
66                            "Other, Surrogate",
67                            "Punctuation, Dash",
68                            "Punctuation, Open",
69                            "Punctuation, Close",
70                            "Punctuation, Connector",
71                            "Punctuation, Other",
72                            "Symbol, Math",
73                            "Symbol, Currency",
74                            "Symbol, Modifier",
75                            "Symbol, Other", 
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 " +
82                        name[i]);
83              }
84         }
85     }
86 }