]> gitweb.fperrin.net Git - Dictionary.git/blob - jars/icu4j-4_2_1-src/src/com/ibm/icu/dev/test/lang/UCharacterDirectionTest.java
icu4jsrc
[Dictionary.git] / jars / icu4j-4_2_1-src / src / com / ibm / icu / dev / test / lang / UCharacterDirectionTest.java
1 /**\r
2  *******************************************************************************\r
3  * Copyright (C) 2001-2006, International Business Machines Corporation and    *\r
4  * others. All Rights Reserved.                                                *\r
5  *******************************************************************************\r
6  */\r
7 package com.ibm.icu.dev.test.lang;\r
8 \r
9 import com.ibm.icu.dev.test.TestFmwk;\r
10 import com.ibm.icu.lang.UCharacterDirection;\r
11 \r
12 /**\r
13 * Testing UCharacterDirection\r
14 * @author Syn Wee Quek\r
15 * @since July 22 2002\r
16 */\r
17 public class UCharacterDirectionTest extends TestFmwk\r
18 {    \r
19     // constructor -----------------------------------------------------------\r
20     \r
21     /**\r
22     * Private constructor to prevent initialisation\r
23     */\r
24     public UCharacterDirectionTest()\r
25     {\r
26     }\r
27     \r
28     // public methods --------------------------------------------------------\r
29       \r
30     public static void main(String[] arg)  \r
31     {\r
32         try\r
33         {\r
34             UCharacterDirectionTest test = new UCharacterDirectionTest();\r
35             test.run(arg);\r
36         }\r
37         catch (Exception e)\r
38         {\r
39             e.printStackTrace();\r
40         }\r
41     }\r
42     \r
43     /**\r
44     * Gets the name of the argument category\r
45     * @returns category name\r
46     */\r
47     public void TestToString()\r
48     {\r
49         String name[] = {"Left-to-Right",\r
50                          "Right-to-Left", \r
51                          "European Number",\r
52                          "European Number Separator",\r
53                          "European Number Terminator",\r
54                          "Arabic Number",\r
55                          "Common Number Separator",\r
56                          "Paragraph Separator",\r
57                          "Segment Separator",\r
58                          "Whitespace",\r
59                          "Other Neutrals",\r
60                          "Left-to-Right Embedding",\r
61                          "Left-to-Right Override",\r
62                          "Right-to-Left Arabic",\r
63                          "Right-to-Left Embedding",\r
64                          "Right-to-Left Override",\r
65                          "Pop Directional Format",\r
66                          "Non-Spacing Mark",\r
67                          "Boundary Neutral",\r
68                          "Unassigned"};\r
69         for (int i = UCharacterDirection.LEFT_TO_RIGHT; \r
70                  i < UCharacterDirection.CHAR_DIRECTION_COUNT; i ++) {\r
71              if (!UCharacterDirection.toString(i).equals(name[i])) {\r
72                 errln("Error toString for direction " + i + " expected " +\r
73                       name[i]);\r
74              }\r
75         }\r
76     }\r
77 }\r