@@ -0,0 +1,1862 @@
+/*%0A * This file is part of COMPASS. It is subject to the license terms in%0A * the LICENSE file found in the top-level directory of this distribution.%0A * (Also available at http://www.apache.org/licenses/LICENSE-2.0.txt)%0A * You may not use this file except in compliance with the License.%0A */%0Apackage de.dfki.asr.compass.model;%0A%0Aimport org.testng.annotations.Test;%0Aimport static org.testng.Assert.*;%0A%0Apublic class SceneNodeTest %7B%0A%0A%09@Test%0A%09public void sceneNodeSetParentShouldSetParent() %7B%0A%09%09SceneNode childNode = new SceneNode();%0A%09%09SceneNode parentNode = new SceneNode();%0A%0A%09%09childNode.setParent(parentNode);%0A%0A%09%09assertEquals(childNode.getParent(), parentNode);%0A%09%7D%0A%0A%09@Test%0A%09public void sceneNodeSetParentShouldReparent() %7B%0A%09%09SceneNode childNode = new SceneNode();%0A%09%09SceneNode oldParent = new SceneNode();%0A%09%09SceneNode newParent = new SceneNode();%0A%0A%09%09childNode.setParent(oldParent);%0A%09%09childNode.setParent(newParent);%0A%0A%09%09assertEquals(childNode.getParent(), newParent);%0A%09%09assertNotEquals(childNode.getParent(), oldParent);%0A%09%7D%0A%0A%09@Test%0A%09public void sceneNodeSetParentShouldAppendNewChild() %7B%0A%09%09SceneNode childNode = new SceneNode();%0A%09%09SceneNode parentNode = new SceneNode();%0A%0A%09%09childNode.setParent(parentNode);%0A%09%09assertTrue(childNode.isChildOf(parentNode));%0A%09%7D%0A%0A%09@Test%0A%09public void sceneNodeSetParentShouldRemoveOldChild() %7B%0A%09%09SceneNode childNode = new SceneNode();%0A%09%09SceneNode oldParent = new SceneNode();%0A%09%09SceneNode newParent = new SceneNode();%0A%0A%09%09childNode.setParent(oldParent);%0A%09%09childNode.setParent(newParent);%0A%0A%09%09assertFalse(childNode.isChildOf(oldParent));%0A%09%7D%0A%0A%09@Test%0A%09public void sceneNodeSetSameParentShouldDoNothing() %7B%0A%09%09SceneNode childNode = new SceneNode();%0A%09%09SceneNode parentNode = new SceneNode();%0A%0A%09%09childNode.setParent(parentNode);%0A%09%09SceneNode nodeBeforeSet = childNode;%0A%09%09childNode.setParent(parentNode);%0A%0A%09%09assertEquals(nodeBeforeSet, childNode);%0A%09%7D%0A%7D%0A

Test for SceneNode setParent