Search in sources :

Example 1 with TestablePanelBase

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

Example 2 with TestablePanelBase

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

the class PanelEventTest method theRecipientIsSetOnlyDuringDispatchAndThenRestored.

@Test
public void theRecipientIsSetOnlyDuringDispatchAndThenRestored() throws Exception {
    TestablePanelBase recipient = new TestablePanelBase();
    recipient.getEventHandler().add(TestableEvent.class, new EventAction() {

        public void invoke(Event event) {
            dispatchedRecipient = ((PanelEvent) event).getRecipient();
        }
    });
    event.dispatch(recipient);
    assertEquals(recipient, dispatchedRecipient);
    assertEquals(source, event.getRecipient());
}
Also used : MockEventAction(limelight.ui.model.inputs.MockEventAction) EventAction(limelight.events.EventAction) Event(limelight.events.Event) TestablePanelBase(limelight.ui.model.TestablePanelBase) Test(org.junit.Test)

Aggregations

TestablePanelBase (limelight.ui.model.TestablePanelBase)2 MockEventAction (limelight.ui.model.inputs.MockEventAction)2 Event (limelight.events.Event)1 EventAction (limelight.events.EventAction)1 TestableParentPanel (limelight.ui.model.TestableParentPanel)1 Before (org.junit.Before)1 Test (org.junit.Test)1