示例#1
0
  @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());
  }
示例#2
0
  @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());
  }
示例#3
0
 @Test(expected = NullPointerException.class)
 public void testSetNullRoot() {
   Scene scene = new Scene(new Group());
   scene.setRoot(null);
 }