Search in sources :

Example 1 with MockEventAction

use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.

the class ProductionTest method setUp.

@Before
public void setUp() throws Exception {
    production = new FakeProduction("/foo/bar");
    studio = new MockStudio();
    Context.instance().studio = studio;
    action = new MockEventAction();
}
Also used : MockEventAction(limelight.ui.model.inputs.MockEventAction) Before(org.junit.Before)

Example 2 with MockEventAction

use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.

the class ProductionTest method closeProduction.

@Test
public void closeProduction() throws Exception {
    production.open();
    MockEventAction closingAction = new MockEventAction();
    MockEventAction closedAction = new MockEventAction();
    production.getEventHandler().add(ProductionClosingEvent.class, closingAction);
    production.getEventHandler().add(ProductionClosedEvent.class, closedAction);
    production.close();
    production.getClosingThread().join();
    assertEquals(true, closingAction.invoked);
    assertEquals(false, production.getTheater().isOpen());
    assertEquals(true, closedAction.invoked);
}
Also used : MockEventAction(limelight.ui.model.inputs.MockEventAction) Test(org.junit.Test)

Example 3 with MockEventAction

use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.

the class StageTest method closing.

@Test
public void closing() throws Exception {
    MockEventAction closingAction = new MockEventAction();
    MockEventAction closedAction = new MockEventAction();
    stage.getEventHandler().add(StageClosingEvent.class, closingAction);
    stage.getEventHandler().add(StageClosedEvent.class, closedAction);
    stage.close();
    assertEquals(true, closingAction.invoked);
    assertEquals(false, stage.isVisible());
    assertEquals(false, stage.isOpen());
    assertEquals(true, closedAction.invoked);
}
Also used : MockEventAction(limelight.ui.model.inputs.MockEventAction) Test(org.junit.Test)

Example 4 with MockEventAction

use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.

the class StageMouseListenerTest method setUp.

@Before
public void setUp() throws Exception {
    component = new java.awt.Panel();
    FakeScene root = new FakeScene();
    listener = new StageMouseListener(root);
    parent = new MockParentPanel();
    child = new MockPanel();
    root.add(parent);
    parent.add(child);
    Scene scene = new FakeScene();
    scene.add(parent);
    scene.setStage(new MockStage());
    parent.setSize(1000, 1000);
    child.setLocation(250, 250);
    child.setSize(500, 500);
    parentAction = new MockEventAction();
    childAction = new MockEventAction();
}
Also used : MockPanel(limelight.ui.MockPanel) MockEventAction(limelight.ui.model.inputs.MockEventAction) java.awt(java.awt) Before(org.junit.Before)

Example 5 with MockEventAction

use of limelight.ui.model.inputs.MockEventAction in project limelight by slagyr.

the class PanelEventHandlerTest method setUp.

@Before
public void setUp() throws Exception {
    action = new MockEventAction();
    parent = new TestableParentPanel();
    panel = new TestablePanelBase();
    parent.add(panel);
}
Also used : TestableParentPanel(limelight.ui.model.TestableParentPanel) TestablePanelBase(limelight.ui.model.TestablePanelBase) MockEventAction(limelight.ui.model.inputs.MockEventAction) Before(org.junit.Before)

Aggregations

MockEventAction (limelight.ui.model.inputs.MockEventAction)15 Test (org.junit.Test)8 Before (org.junit.Before)7 MockPanel (limelight.ui.MockPanel)5 java.awt (java.awt)1 FakeProduction (limelight.model.FakeProduction)1 MockStudio (limelight.model.api.MockStudio)1 TestablePanelBase (limelight.ui.model.TestablePanelBase)1 TestableParentPanel (limelight.ui.model.TestableParentPanel)1 TestableInputPanel (limelight.ui.model.inputs.TestableInputPanel)1