2 *******************************************************************************
3 * Copyright (C) 2001-2013, International Business Machines Corporation and
4 * others. All Rights Reserved.
5 *******************************************************************************
7 package com.ibm.icu.dev.test.lang;
9 import com.ibm.icu.dev.test.TestFmwk;
10 import com.ibm.icu.lang.UCharacterDirection;
13 * Testing UCharacterDirection
14 * @author Syn Wee Quek
17 public class UCharacterDirectionTest extends TestFmwk
19 // constructor -----------------------------------------------------------
22 * Private constructor to prevent initialization
24 public UCharacterDirectionTest()
28 // public methods --------------------------------------------------------
30 public static void main(String[] arg)
34 UCharacterDirectionTest test = new UCharacterDirectionTest();
44 * Gets the name of the argument category
45 * @returns category name
47 public void TestToString()
49 String name[] = {"Left-to-Right",
52 "European Number Separator",
53 "European Number Terminator",
55 "Common Number Separator",
56 "Paragraph Separator",
60 "Left-to-Right Embedding",
61 "Left-to-Right Override",
62 "Right-to-Left Arabic",
63 "Right-to-Left Embedding",
64 "Right-to-Left Override",
65 "Pop Directional Format",
68 "First Strong Isolate",
69 "Left-to-Right Isolate",
70 "Right-to-Left Isolate",
71 "Pop Directional Isolate",
74 for (int i = UCharacterDirection.LEFT_TO_RIGHT;
75 // Placed <= because we need to consider 'Unassigned'
76 // when it goes out of bounds of UCharacterDirection
77 i <= UCharacterDirection.CHAR_DIRECTION_COUNT; i++) {
78 if (!UCharacterDirection.toString(i).equals(name[i])) {
79 errln("Error toString for direction " + i + " expected " +