use of limelight.model.events.ProductionCreatedEvent 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)));
}
Aggregations