use of limelight.model.api.Player in project limelight by slagyr.
the class JavaPlayerTest method playerCanAddEvents.
@Test
public void playerCanAddEvents() throws Exception {
final Document doc = Xml.stringToDoc("<player class='SamplePlayer'><onMouseClicked>sampleAction</onMouseClicked></player>");
final Player player = new JavaPlayer("foo", "/testProduction/aScene/players/foo.xml", samplePlayerClass, doc.getDocumentElement(), "limelight.ui.events.panel.");
Object playerObj = player.cast(prop);
assertEquals("SamplePlayer", playerObj.getClass().getName());
assertEquals(1, prop.getEventHandler().getActions(MouseClickedEvent.class).size());
new MouseClickedEvent(0, null, 1).dispatch(prop);
assertEquals(1, samplePlayerClass.getField("invocations").get(lastSamplePlayer()));
}
Aggregations