Search in sources :

Example 21 with EventAction

use of limelight.events.EventAction in project limelight by slagyr.

the class EventActionMulticasterTest method addingActionToNull.

@Test
public void addingActionToNull() throws Exception {
    EventAction action = EventActionMulticaster.add(null, action1);
    assertSame(action1, action);
}
Also used : EventAction(limelight.events.EventAction) Test(org.junit.Test)

Example 22 with EventAction

use of limelight.events.EventAction in project limelight by slagyr.

the class JavaProductionTest method illuminatingTheProductionWithAction.

@Test
public void illuminatingTheProductionWithAction() throws Exception {
    writeSamplePlayerTo(fs.outputStream("/testProduction/classes/SamplePlayer.class"));
    fs.createTextFile("/testProduction/production.xml", "<production classpath='classes' class='SamplePlayer'><onProductionCreated>sampleAction</onProductionCreated></production>");
    production.illuminate();
    final JavaPlayer player = (JavaPlayer) production.getPlayer();
    final List<EventAction> onCreatedActions = production.getEventHandler().getActions(ProductionCreatedEvent.class);
    assertEquals(1, onCreatedActions.size());
    new ProductionCreatedEvent().dispatch(production);
    assertEquals(1, player.getPlayerClass().getField("invocations").get(lastSamplePlayer(player)));
}
Also used : EventAction(limelight.events.EventAction) ProductionCreatedEvent(limelight.model.events.ProductionCreatedEvent) Test(org.junit.Test)

Aggregations

EventAction (limelight.events.EventAction)22 Test (org.junit.Test)18 Event (limelight.events.Event)4 SimplePropProxy (limelight.ui.SimplePropProxy)3 MouseClickedEvent (limelight.ui.events.panel.MouseClickedEvent)3 MouseEnteredEvent (limelight.ui.events.panel.MouseEnteredEvent)3 PanelEvent (limelight.ui.events.panel.PanelEvent)3 PropPanel (limelight.ui.model.PropPanel)3 ProductionCreatedEvent (limelight.model.events.ProductionCreatedEvent)1 TestablePanelBase (limelight.ui.model.TestablePanelBase)1 MockEventAction (limelight.ui.model.inputs.MockEventAction)1