use of limelight.ui.model.MockStage in project limelight by slagyr.
the class TheaterTest method activeStage.
@Test
public void activeStage() throws Exception {
MockStage stage2 = new MockStage("two");
theater.add(defaultStage);
theater.add(stage2);
assertEquals(null, theater.getActiveStage());
new StageActivatedEvent().dispatch(stage2);
assertEquals(stage2, theater.getActiveStage());
new StageActivatedEvent().dispatch(defaultStage);
assertEquals(defaultStage, theater.getActiveStage());
}
use of limelight.ui.model.MockStage in project limelight by slagyr.
the class TheaterTest method getStageByName.
@Test
public void getStageByName() throws Exception {
MockStage stage2 = new MockStage("two");
MockStage stage3 = new MockStage("three");
theater.add(defaultStage);
theater.add(stage2);
theater.add(stage3);
assertEquals(defaultStage, theater.get("default"));
assertEquals(stage2, theater.get("two"));
assertEquals(stage3, theater.get("three"));
}
use of limelight.ui.model.MockStage in project limelight by slagyr.
the class ProductionTest method openDefaultScenes.
@Test
public void openDefaultScenes() throws Exception {
production.getEventHandler().add(ProductionOpenedEvent.class, action);
MockStage stage = new MockStage();
production.getTheater().add(stage);
stage.setDefaultSceneName("defaultScene");
Scene scene = new FakeScene();
production.stubbedScene = scene;
production.open(new Opts());
assertEquals(true, action.invoked);
assertEquals(true, stage.isOpen());
assertEquals(scene, stage.getScene());
}
use of limelight.ui.model.MockStage in project limelight by slagyr.
the class ProductionTest method openSceneUpdatesOptionsWithNameAndPath.
@Test
public void openSceneUpdatesOptionsWithNameAndPath() throws Exception {
production.loadProduction();
production.getTheater().add(new MockStage("mock"));
production.stubbedScene = new FakeScene();
final Map<String, Object> options = Util.toMap();
production.openScene("scenePath/sceneName", "mock", options);
assertNotSame(options, production.loadedSceneOptions);
assertEquals("sceneName", production.loadedSceneOptions.get("name"));
assertEquals("scenePath/sceneName", production.loadedSceneOptions.get("path"));
}
use of limelight.ui.model.MockStage in project limelight by slagyr.
the class ProductionTest method openSceneWithActiveStage.
@Test
public void openSceneWithActiveStage() throws Exception {
production.loadProduction();
MockStage stage = new MockStage("active");
production.getTheater().add(stage);
new StageActivatedEvent().dispatch(stage);
Scene scene = new FakeScene();
production.stubbedScene = scene;
production.openScene("scenePath", Util.toMap());
assertEquals("scenePath", production.loadedScenePath);
assertEquals(scene, stage.getScene());
assertEquals(true, stage.opened);
}
Aggregations