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 RigidBehaviorTypeTest {
19 public RigidBehaviorTypeTest() {
23 public static void setUpClass() {
27 public static void tearDownClass() {
35 public void tearDown() {
39 * Test of values method, of class RigidBehaviorType.
42 public void testValues() {
43 System.out.println("values");
45 RigidBehaviorType[] array = RigidBehaviorType.values();
47 assertEquals(3, array.length);
49 assertEquals(RigidBehaviorType.FOLLOWBONE, array[0]);
50 assertEquals(RigidBehaviorType.ONLYDYNAMICS, array[1]);
51 assertEquals(RigidBehaviorType.BONEDDYNAMICS, array[2]);
57 * Test of decode method, of class RigidBehaviorType.
60 public void testDecode() {
61 System.out.println("decode");
63 assertEquals(RigidBehaviorType.FOLLOWBONE, RigidBehaviorType.decode((byte)0x00));
64 assertEquals(RigidBehaviorType.ONLYDYNAMICS, RigidBehaviorType.decode((byte)0x01));
65 assertEquals(RigidBehaviorType.BONEDDYNAMICS, RigidBehaviorType.decode((byte)0x02));
67 assertNull(RigidBehaviorType.decode((byte)0x03));
73 * Test of encode method, of class RigidBehaviorType.
76 public void testEncode() {
77 System.out.println("encode");
79 assertEquals(0x00, RigidBehaviorType.FOLLOWBONE.encode());
80 assertEquals(0x01, RigidBehaviorType.ONLYDYNAMICS.encode());
81 assertEquals(0x02, RigidBehaviorType.BONEDDYNAMICS.encode());
87 * Test of getGuiName method, of class RigidBehaviorType.
90 public void testGetGuiName_0args() {
91 System.out.println("getGuiName");
93 Locale locale = Locale.getDefault();
95 for(RigidBehaviorType type : RigidBehaviorType.values()){
96 assertEquals(type.getGuiName(locale), type.getGuiName());
103 * Test of getGuiName method, of class RigidBehaviorType.
106 public void testGetGuiName_Locale() {
107 System.out.println("getGuiName");
111 locale = Locale.JAPANESE;
112 assertEquals("ボーン追従", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
113 assertEquals("物理演算", RigidBehaviorType.ONLYDYNAMICS.getGuiName(locale));
114 assertEquals("ボーン位置合わせ", RigidBehaviorType.BONEDDYNAMICS.getGuiName(locale));
116 locale = Locale.JAPAN;
117 assertEquals("ボーン追従", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
119 locale = Locale.ITALY;
120 assertEquals("static(to bone)", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
121 assertEquals("dynamic", RigidBehaviorType.ONLYDYNAMICS.getGuiName(locale));
122 assertEquals("bone matching", RigidBehaviorType.BONEDDYNAMICS.getGuiName(locale));
124 locale = Locale.ENGLISH;
125 assertEquals("static(to bone)", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));
128 assertEquals("static(to bone)", RigidBehaviorType.FOLLOWBONE.getGuiName(locale));