4 package jp.sfjp.mikutoga.typical;
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 TypicalBoneTest {
19 public TypicalBoneTest() {
23 public static void setUpClass() {
27 public static void tearDownClass() {
35 public void tearDown() {
39 * Test of findWithPrimary method, of class TypicalBone.
42 public void testFindWithPrimary() {
43 System.out.println("findWithPrimary");
46 result = TypicalBone.findWithPrimary("頭");
48 assertEquals("頭", result.getTopPrimaryName());
49 assertEquals("head", result.getTopGlobalName());
50 assertEquals(1, result.getPrimaryNameList().size());
51 assertEquals("頭", result.getPrimaryNameList().get(0));
52 assertEquals(1, result.getGlobalNameList().size());
53 assertEquals("head", result.getGlobalNameList().get(0));
59 * Test of findWithGlobal method, of class TypicalBone.
62 public void testFindWithGlobal() {
63 System.out.println("findWithGlobal");
67 result = TypicalBone.findWithGlobal("head");
68 assertNotNull(result);
71 result2 = TypicalBone.findWithPrimary("頭");
73 assertSame(result, result2);
79 * Test of primary2global method, of class TypicalBone.
82 public void testPrimary2global() {
83 System.out.println("primary2global");
87 result = TypicalBone.primary2global("頭");
88 assertEquals("head", result);
93 result1 = TypicalBone.primary2global("ボーン15");
94 result2 = TypicalBone.primary2global("ボーン15");
95 assertSame(result1, result2);
97 result = TypicalBone.primary2global("XXX");
104 * Test of global2primary method, of class TypicalBone.
107 public void testGlobal2primary() {
108 System.out.println("global2primary");
112 result = TypicalBone.global2primary("head");
113 assertEquals("頭", result);
115 result = TypicalBone.global2primary("head");
116 assertEquals("頭", result);
118 result = TypicalBone.global2primary("XXX");
125 * Test of getTypicalBoneList method, of class TypicalBone.
128 public void testGetBoneList() {
129 System.out.println("getBoneList");
131 List<TypicalBone> boneList;
133 boneList = TypicalBone.getTypicalBoneList();
135 assertNotNull(boneList);
136 assertEquals(77, boneList.size());
138 TypicalBone bone1st = boneList.get(0);
139 TypicalBone boneLast = boneList.get(77-1);
141 assertEquals("センター", bone1st.getTopPrimaryName());
142 assertEquals("ボーン15", boneLast.getTopPrimaryName());
144 assertEquals("center", bone1st.getTopGlobalName());
145 assertEquals("bone15", boneLast.getTopGlobalName());
151 * Test of isRoot method, of class TypicalBone.
154 public void testIsRoot() {
155 System.out.println("isRoot");
159 bone = TypicalBone.findWithPrimary("センター");
160 assertTrue(bone.isRoot());
162 bone = TypicalBone.findWithPrimary("頭");
163 assertFalse(bone.isRoot());
165 bone = TypicalBone.findWithPrimary("右足IK");
166 assertTrue(bone.isRoot());
168 bone = TypicalBone.findWithPrimary("左足IK");
169 assertTrue(bone.isRoot());
171 bone = TypicalBone.findWithPrimary("ボーン01");
172 assertTrue(bone.isRoot());