01: /**
02: *******************************************************************************
03: * Copyright (C) 2001-2006, International Business Machines Corporation and *
04: * others. All Rights Reserved. *
05: *******************************************************************************
06: */package com.ibm.icu.dev.test.lang;
07:
08: import com.ibm.icu.dev.test.TestFmwk;
09: import com.ibm.icu.lang.UCharacterDirection;
10:
11: /**
12: * Testing UCharacterDirection
13: * @author Syn Wee Quek
14: * @since July 22 2002
15: */
16: public class UCharacterDirectionTest extends TestFmwk {
17: // constructor -----------------------------------------------------------
18:
19: /**
20: * Private constructor to prevent initialisation
21: */
22: public UCharacterDirectionTest() {
23: }
24:
25: // public methods --------------------------------------------------------
26:
27: public static void main(String[] arg) {
28: try {
29: UCharacterDirectionTest test = new UCharacterDirectionTest();
30: test.run(arg);
31: } catch (Exception e) {
32: e.printStackTrace();
33: }
34: }
35:
36: /**
37: * Gets the name of the argument category
38: * @returns category name
39: */
40: public void TestToString() {
41: String name[] = { "Left-to-Right", "Right-to-Left",
42: "European Number", "European Number Separator",
43: "European Number Terminator", "Arabic Number",
44: "Common Number Separator", "Paragraph Separator",
45: "Segment Separator", "Whitespace", "Other Neutrals",
46: "Left-to-Right Embedding", "Left-to-Right Override",
47: "Right-to-Left Arabic", "Right-to-Left Embedding",
48: "Right-to-Left Override", "Pop Directional Format",
49: "Non-Spacing Mark", "Boundary Neutral", "Unassigned" };
50: for (int i = UCharacterDirection.LEFT_TO_RIGHT; i < UCharacterDirection.CHAR_DIRECTION_COUNT; i++) {
51: if (!UCharacterDirection.toString(i).equals(name[i])) {
52: errln("Error toString for direction " + i
53: + " expected " + name[i]);
54: }
55: }
56: }
57: }
|