4 package jp.sourceforge.mikutoga.pmd;
6 import java.util.Locale;
7 import org.junit.After;
8 import org.junit.AfterClass;
9 import org.junit.Before;
10 import org.junit.BeforeClass;
11 import org.junit.Test;
12 import static org.junit.Assert.*;
17 public class RigidShapeTypeTest {
19 public RigidShapeTypeTest() {
23 public static void setUpClass() {
27 public static void tearDownClass() {
35 public void tearDown() {
39 * Test of values method, of class RigidShapeType.
42 public void testValues() {
43 System.out.println("values");
45 RigidShapeType[] array = RigidShapeType.values();
47 assertEquals(3, array.length);
49 assertEquals(RigidShapeType.SPHERE, array[0]);
50 assertEquals(RigidShapeType.BOX, array[1]);
51 assertEquals(RigidShapeType.CAPSULE, array[2]);
57 * Test of decode method, of class RigidShapeType.
60 public void testDecode() {
61 System.out.println("decode");
63 assertEquals(RigidShapeType.SPHERE, RigidShapeType.decode((byte)0x00));
64 assertEquals(RigidShapeType.BOX, RigidShapeType.decode((byte)0x01));
65 assertEquals(RigidShapeType.CAPSULE, RigidShapeType.decode((byte)0x02));
67 assertNull(RigidShapeType.decode((byte)0x03));
73 * Test of encode method, of class RigidShapeType.
76 public void testEncode() {
77 System.out.println("encode");
79 assertEquals(0x00, RigidShapeType.SPHERE.encode());
80 assertEquals(0x01, RigidShapeType.BOX.encode());
81 assertEquals(0x02, RigidShapeType.CAPSULE.encode());
87 * Test of getGuiName method, of class RigidShapeType.
90 public void testGetGuiName_0args() {
91 System.out.println("getGuiName");
93 Locale locale = Locale.getDefault();
95 for(RigidShapeType type : RigidShapeType.values()){
96 assertEquals(type.getGuiName(locale), type.getGuiName());
103 * Test of getGuiName method, of class RigidShapeType.
106 public void testGetGuiName_Locale() {
107 System.out.println("getGuiName");
111 locale = Locale.JAPANESE;
112 assertEquals("球", RigidShapeType.SPHERE.getGuiName(locale));
113 assertEquals("箱", RigidShapeType.BOX.getGuiName(locale));
114 assertEquals("カプセル", RigidShapeType.CAPSULE.getGuiName(locale));
116 locale = Locale.JAPAN;
117 assertEquals("球", RigidShapeType.SPHERE.getGuiName(locale));
119 locale = Locale.ITALY;
120 assertEquals("sphere", RigidShapeType.SPHERE.getGuiName(locale));
121 assertEquals("box", RigidShapeType.BOX.getGuiName(locale));
122 assertEquals("capsule", RigidShapeType.CAPSULE.getGuiName(locale));
124 locale = Locale.ENGLISH;
125 assertEquals("sphere", RigidShapeType.SPHERE.getGuiName(locale));
128 assertEquals("sphere", RigidShapeType.SPHERE.getGuiName(locale));