Search in sources :

Example 26 with FakeScene

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

the class JavaPlayerTest method setUp.

@Before
public void setUp() throws Exception {
    FakeFileSystem fs = FakeFileSystem.installed();
    JavaProductionTest.writeSamplePlayerTo(fs.outputStream("/testProduction/classes/SamplePlayer.class"));
    samplePlayerClass = new PlayerClassLoader("/testProduction/classes").loadClass("SamplePlayer");
    prop = new PropPanel(new FakePropProxy());
    new FakeScene().add(prop);
}
Also used : FakeFileSystem(limelight.io.FakeFileSystem) PropPanel(limelight.ui.model.PropPanel) FakeScene(limelight.ui.model.FakeScene) FakePropProxy(limelight.model.api.FakePropProxy) Before(org.junit.Before)

Example 27 with FakeScene

use of limelight.ui.model.FakeScene 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 28 with FakeScene

use of limelight.ui.model.FakeScene 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 29 with FakeScene

use of limelight.ui.model.FakeScene 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

FakeScene (limelight.ui.model.FakeScene)29 FakePropProxy (limelight.model.api.FakePropProxy)17 PropPanel (limelight.ui.model.PropPanel)17 Before (org.junit.Before)15 MockStage (limelight.ui.model.MockStage)11 Test (org.junit.Test)11 CastEvent (limelight.ui.events.panel.CastEvent)7 Scene (limelight.ui.model.Scene)7 MockGraphics (limelight.ui.MockGraphics)2 RadioButtonGroup (limelight.ui.RadioButtonGroup)2 FakeFileSystem (limelight.io.FakeFileSystem)1 FakeProduction (limelight.model.FakeProduction)1 RichStyle (limelight.styles.RichStyle)1 StageActivatedEvent (limelight.ui.events.stage.StageActivatedEvent)1 MockDrawable (limelight.ui.model.MockDrawable)1 TextBoxPanel (limelight.ui.model.inputs.TextBoxPanel)1 Opts (limelight.util.Opts)1