Search in sources :

Example 1 with NavigationEventCommand

use of com.mvp4g.client.history.NavigationEventCommand in project mvp4g by mvp4g.

the class BaseEventBusTest method setUp.

@Before
public void setUp() {
    bus = new BaseEventBus() {

        @SuppressWarnings("unchecked")
        @Override
        protected <T extends EventHandlerInterface<?>> T createHandler(Class<T> handlerClass) {
            return (T) ((SimplePresenter01.class.equals(handlerClass)) ? new SimplePresenter01() : null);
        }

        public void setApplicationHistoryStored(boolean historyStored) {
        }

        public void setNavigationConfirmation(NavigationConfirmationInterface navigationConfirmation) {
        }

        public void confirmNavigation(NavigationEventCommand event) {
        }
    };
    module = new Mvp4gModuleStub(bus);
    filter = new EventFilterStub();
}
Also used : NavigationEventCommand(com.mvp4g.client.history.NavigationEventCommand) EventFilterStub(com.mvp4g.client.test_tools.EventFilterStub) NavigationConfirmationInterface(com.mvp4g.client.history.NavigationConfirmationInterface) Mvp4gModuleStub(com.mvp4g.client.test_tools.Mvp4gModuleStub) SimplePresenter01(com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01) Before(org.junit.Before)

Example 2 with NavigationEventCommand

use of com.mvp4g.client.history.NavigationEventCommand in project mvp4g by mvp4g.

the class PresenterTest method testSetter.

@Test
public void testSetter() {
    String view = "View";
    BaseEventBus bus = new BaseEventBus() {

        @Override
        protected <T extends EventHandlerInterface<?>> T createHandler(Class<T> handlerClass) {
            return null;
        }

        public void setApplicationHistoryStored(boolean historyStored) {
        }

        public void setNavigationConfirmation(NavigationConfirmationInterface navigationConfirmation) {
        }

        public void confirmNavigation(NavigationEventCommand event) {
        }
    };
    presenter.setEventBus(bus);
    presenter.setView(view);
    assertSame(presenter.getView(), view);
    assertSame(presenter.getEventBus(), bus);
}
Also used : NavigationEventCommand(com.mvp4g.client.history.NavigationEventCommand) BaseEventBus(com.mvp4g.client.event.BaseEventBus) EventHandlerInterface(com.mvp4g.client.event.EventHandlerInterface) NavigationConfirmationInterface(com.mvp4g.client.history.NavigationConfirmationInterface) Test(org.junit.Test)

Aggregations

NavigationConfirmationInterface (com.mvp4g.client.history.NavigationConfirmationInterface)2 NavigationEventCommand (com.mvp4g.client.history.NavigationEventCommand)2 BaseEventBus (com.mvp4g.client.event.BaseEventBus)1 EventHandlerInterface (com.mvp4g.client.event.EventHandlerInterface)1 EventFilterStub (com.mvp4g.client.test_tools.EventFilterStub)1 Mvp4gModuleStub (com.mvp4g.client.test_tools.Mvp4gModuleStub)1 SimplePresenter01 (com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01)1 Before (org.junit.Before)1 Test (org.junit.Test)1