Search in sources :

Example 16 with MockStage

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());
}
Also used : MockStage(limelight.ui.model.MockStage) StageActivatedEvent(limelight.ui.events.stage.StageActivatedEvent) Test(org.junit.Test)

Example 17 with MockStage

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"));
}
Also used : MockStage(limelight.ui.model.MockStage) Test(org.junit.Test)

Example 18 with MockStage

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());
}
Also used : Opts(limelight.util.Opts) MockStage(limelight.ui.model.MockStage) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Example 19 with MockStage

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"));
}
Also used : MockStage(limelight.ui.model.MockStage) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Example 20 with MockStage

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);
}
Also used : MockStage(limelight.ui.model.MockStage) StageActivatedEvent(limelight.ui.events.stage.StageActivatedEvent) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Aggregations

MockStage (limelight.ui.model.MockStage)21 Test (org.junit.Test)16 FakeScene (limelight.ui.model.FakeScene)11 Scene (limelight.ui.model.Scene)5 FakePropProxy (limelight.model.api.FakePropProxy)3 StageActivatedEvent (limelight.ui.events.stage.StageActivatedEvent)3 StageDeactivatedEvent (limelight.ui.events.stage.StageDeactivatedEvent)3 PropPanel (limelight.ui.model.PropPanel)3 Before (org.junit.Before)3 MockGraphics (limelight.ui.MockGraphics)2 LimelightException (limelight.LimelightException)1 RichStyle (limelight.styles.RichStyle)1 StageClosedEvent (limelight.ui.events.stage.StageClosedEvent)1 MockDrawable (limelight.ui.model.MockDrawable)1 TextBoxPanel (limelight.ui.model.inputs.TextBoxPanel)1 Opts (limelight.util.Opts)1