2 *******************************************************************************
\r
3 * Copyright (C) 2001-2009, International Business Machines Corporation and *
\r
4 * others. All Rights Reserved. *
\r
5 *******************************************************************************
\r
7 package com.ibm.icu.dev.test.lang;
\r
9 import com.ibm.icu.dev.test.TestFmwk;
\r
10 import com.ibm.icu.lang.UCharacterDirection;
\r
13 * Testing UCharacterDirection
\r
14 * @author Syn Wee Quek
\r
15 * @since July 22 2002
\r
17 public class UCharacterDirectionTest extends TestFmwk
\r
19 // constructor -----------------------------------------------------------
\r
22 * Private constructor to prevent initialization
\r
24 public UCharacterDirectionTest()
\r
28 // public methods --------------------------------------------------------
\r
30 public static void main(String[] arg)
\r
34 UCharacterDirectionTest test = new UCharacterDirectionTest();
\r
39 e.printStackTrace();
\r
44 * Gets the name of the argument category
\r
45 * @returns category name
\r
47 public void TestToString()
\r
49 String name[] = {"Left-to-Right",
\r
52 "European Number Separator",
\r
53 "European Number Terminator",
\r
55 "Common Number Separator",
\r
56 "Paragraph Separator",
\r
57 "Segment Separator",
\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
70 for (int i = UCharacterDirection.LEFT_TO_RIGHT;
\r
71 // Placed <= because we need to consider 'Unassigned'
\r
72 // when it goes out of bounds of UCharacterDirection
\r
73 i <= UCharacterDirection.CHAR_DIRECTION_COUNT; i++) {
\r
74 if (!UCharacterDirection.toString(i).equals(name[i])) {
\r
75 errln("Error toString for direction " + i + " expected " +
\r