@Test public void testRootInitializedInConstructor() { Group g = new Group(); Scene scene = new Scene(g); assertEquals(g, scene.getRoot()); assertEquals(scene, g.getScene()); }
@Test public void testRootUpdatedWhenAddedToScene() { Scene scene = new Scene(new Group()); Group g = new Group(); scene.setRoot(g); assertEquals(g, scene.getRoot()); assertEquals(scene, g.getScene()); }
@Test public void testRootUpdatedWhenChangedInScene() { Group g = new Group(); Scene scene = new Scene(g); Group g2 = new Group(); scene.setRoot(g2); assertNull(g.getScene()); assertEquals(g2, scene.getRoot()); assertEquals(scene, g2.getScene()); }