Kaynağa Gözat

add a few tests

rickard 1 yıl önce
ebeveyn
işleme
eb0fb5f1bb

+ 35 - 0
jme3-core/src/test/java/com/jme3/anim/AnimComposerTest.java

@@ -31,6 +31,11 @@
  */
 package com.jme3.anim;
 
+import com.jme3.anim.tween.action.Action;
+import com.jme3.anim.tween.action.ClipAction;
+import com.jme3.export.JmeExporter;
+import java.util.Set;
+import java.util.TreeSet;
 import org.junit.Assert;
 import org.junit.Test;
 
@@ -54,6 +59,36 @@ public class AnimComposerTest {
         Assert.assertNotNull(composer.getAnimClipsNames());
         Assert.assertEquals(0, composer.getAnimClipsNames().size());
     }
+    
+    @Test
+    public void testMakeLayer() {
+        AnimComposer composer = new AnimComposer();
+        
+        final String layerName = "TestLayer";
+
+        composer.makeLayer(layerName, null);
+        
+        final Set<String> layers = new TreeSet<>();
+        layers.add("Default");
+        layers.add(layerName);
+        
+        Assert.assertNotNull(composer.getLayer(layerName));
+        Assert.assertEquals(layers, composer.getLayerNames());
+    }
+    
+    @Test
+    public void testMakeAction() {
+        AnimComposer composer = new AnimComposer();
+        
+        final String animName = "TestClip";
+        
+        final AnimClip anim = new AnimClip(animName);
+        composer.addAnimClip(anim);
+        
+        final Action action = composer.makeAction(animName);
+        
+        Assert.assertNotNull(action);
+    }
 
     @Test(expected = UnsupportedOperationException.class)
     public void testGetAnimClipsIsNotModifiable() {