Search in sources :

Example 1 with MockStage

use of limelight.ui.model.MockStage in project limelight by slagyr.

the class ProductionTest method defaultScenesCanBeDisabled.

@Test
public void defaultScenesCanBeDisabled() throws Exception {
    MockStage stage = new MockStage();
    production.getTheater().add(stage);
    stage.setDefaultSceneName("defaultScene");
    production.stubbedScene = new FakeScene();
    production.open(Util.toMap("open-default-scenes", false));
    assertEquals(false, stage.isOpen());
    assertEquals(null, stage.getScene());
}
Also used : MockStage(limelight.ui.model.MockStage) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Example 2 with MockStage

use of limelight.ui.model.MockStage in project limelight by slagyr.

the class ProductionTest method openSceneLoadsStylesExtendingProductionStyles.

@Test
public void openSceneLoadsStylesExtendingProductionStyles() throws Exception {
    production.loadProduction();
    production.getTheater().add(new MockStage("mock"));
    production.getStyles().put("newStyle", new RichStyle());
    Scene scene = new FakeScene();
    production.stubbedScene = scene;
    production.openScene("scenePath", "mock", Util.toMap());
    assertEquals(HashMap.class, scene.getStyles().getClass());
    assertEquals(true, scene.getStyles().containsKey("limelight_builtin_curtains"));
    assertEquals(true, scene.getStyles().containsKey("newStyle"));
}
Also used : RichStyle(limelight.styles.RichStyle) 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 3 with MockStage

use of limelight.ui.model.MockStage in project limelight by slagyr.

the class ProductionTest method openSceneWithNoActiveStage.

@Test
public void openSceneWithNoActiveStage() throws Exception {
    production.loadProduction();
    final MockStage stage = (MockStage) production.getTheater().getDefaultStage();
    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) FakeScene(limelight.ui.model.FakeScene) Scene(limelight.ui.model.Scene) FakeScene(limelight.ui.model.FakeScene) Test(org.junit.Test)

Example 4 with MockStage

use of limelight.ui.model.MockStage in project limelight by slagyr.

the class ProductionTest method openSceneWithStage.

@Test
public void openSceneWithStage() throws Exception {
    production.loadProduction();
    MockStage stage = new MockStage("mock");
    production.getTheater().add(stage);
    Scene scene = new FakeScene();
    production.stubbedScene = scene;
    production.openScene("scenePath", "mock", Util.toMap());
    assertEquals("scenePath", production.loadedScenePath);
    assertEquals(scene, stage.getScene());
    assertEquals(true, stage.opened);
}
Also used : 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 5 with MockStage

use of limelight.ui.model.MockStage in project limelight by slagyr.

the class TheaterTest method setUp.

@Before
public void setUp() throws Exception {
    production = new FakeProduction();
    theater = new Theater(production);
    defaultStage = new MockStage("default");
}
Also used : MockStage(limelight.ui.model.MockStage) Before(org.junit.Before)

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