use of com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01 in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testEventHistoryConverterFails.
@Test(expected = UnknownConfigurationElementException.class)
public void testEventHistoryConverterFails() throws InvalidMvp4gConfigurationException {
events.add(newEvent("badHistoryConverter"));
services.add(newService("badHistoryConverter"));
presenters.add(newPresenter(SimplePresenter01.class, "badHistoryConverter"));
views.add(newView(SimpleView02.class, "badHistoryConverter"));
EventElement event = newEvent("testEvent");
event.setHistory("badView");
events.add(event);
setEventBus();
configuration.validateHistoryConverters();
}
use of com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01 in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testPresenterViewValidationFails.
@Test(expected = UnknownConfigurationElementException.class)
public void testPresenterViewValidationFails() throws UnknownConfigurationElementException, InvalidTypeException, InvalidClassException, NotFoundClassException {
events.add(newEvent("badView"));
services.add(newService("badView"));
presenters.add(newPresenter(SimplePresenter01.class, "badView"));
historyConverters.add(newHistoryConverter(SimpleHistoryConverter01.class, "badView"));
PresenterElement presenter = newPresenter(SimplePresenter02.class, "testPresenter");
presenter.setView("badView");
presenters.add(presenter);
configuration.validateViews();
}
use of com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01 in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testInjectedServiceValidationFailsForPresenter.
@Test(expected = UnknownConfigurationElementException.class)
public void testInjectedServiceValidationFailsForPresenter() throws UnknownConfigurationElementException, InvalidTypeException, InvalidClassException, NotFoundClassException {
events.add(newEvent("badService"));
views.add(newView(SimpleView02.class, "badService"));
presenters.add(newPresenter(SimplePresenter01.class, "badService"));
historyConverters.add(newHistoryConverter(SimpleHistoryConverter01.class, "badService"));
PresenterElement presenter = newPresenter(SimplePresenter02.class, "testPresenter");
presenter.getInjectedServices().add(new InjectedElement("badService", "setBadService"));
presenters.add(presenter);
configuration.validateServices();
}
use of com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01 in project mvp4g by mvp4g.
the class BaseEventBusTest method testDefaultAddHandler.
@Test
public void testDefaultAddHandler() {
List<SimplePresenter01> list = bus.getHandlers(SimplePresenter01.class);
SimplePresenter01 p = bus.addHandler(SimplePresenter01.class);
list = bus.getHandlers(SimplePresenter01.class);
assertTrue(list.size() == 1);
assertEquals(list.get(0), p);
assertTrue(p.isBindCalled());
p = bus.addHandler(SimplePresenter01.class, true);
list = bus.getHandlers(SimplePresenter01.class);
assertTrue(list.size() == 2);
assertEquals(list.get(1), p);
assertTrue(p.isBindCalled());
p = bus.addHandler(SimplePresenter01.class, false);
list = bus.getHandlers(SimplePresenter01.class);
assertTrue(list.size() == 3);
assertEquals(list.get(2), p);
assertFalse(p.isBindCalled());
}
use of com.mvp4g.rebind.test_tools.annotation.presenters.SimplePresenter01 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();
}
Aggregations