use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testHistoryConverterWithNoHistory.
@Test(expected = InvalidMvp4gConfigurationException.class)
public void testHistoryConverterWithNoHistory() throws InvalidMvp4gConfigurationException {
historyConverters.add(new HistoryConverterElement());
configuration.validateHistory();
}
use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testInjectedServiceValidationSucceeds.
@Test
public void testInjectedServiceValidationSucceeds() throws UnknownConfigurationElementException {
services.add(newService("testService"));
PresenterElement presenter = newPresenter(SimplePresenter01.class, "testPresenter");
presenter.getInjectedServices().add(new InjectedElement("testService", "setTestService"));
presenters.add(presenter);
HistoryConverterElement historyConverter = newHistoryConverter(SimpleHistoryConverter01.class, "testHistoryConverter");
historyConverter.getInjectedServices().add(new InjectedElement("testService", "setTestService"));
historyConverters.add(historyConverter);
configuration.validateServices();
}
use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testHistoryName.
@Test
public void testHistoryName() throws InvalidMvp4gConfigurationException {
historyConverters.add(new HistoryConverterElement());
configuration.setModule(oracle.addClass(Modules.ModuleWithParentNoName.class));
setParentEventBus(Modules.ModuleWithParentNoName.class, EventBusOk.class);
configuration.loadParentModule();
assertNull(configuration.getHistoryName());
try {
configuration.validateHistory();
fail();
} catch (InvalidMvp4gConfigurationException e) {
assertTrue(e.getMessage().contains("Child module that defines history converter must have a"));
}
configuration.setModule(oracle.addClass(Modules.ModuleWithParent01.class));
setParentEventBus(Modules.ModuleWithParent01.class, EventBusOk.class);
configuration.loadParentModule();
assertEquals("moduleWithParent01", configuration.getHistoryName());
configuration.validateHistory();
}
use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testInjectedServiceValidationFailsForHistoryConverter.
@Test(expected = UnknownConfigurationElementException.class)
public void testInjectedServiceValidationFailsForHistoryConverter() 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"));
HistoryConverterElement historyConverter = newHistoryConverter(SimpleHistoryConverter02.class, "testHistoryConverter");
historyConverter.getInjectedServices().add(new InjectedElement("badService", "setBadService"));
historyConverters.add(historyConverter);
configuration.validateServices();
}
use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testHistoryOk.
@Test
public void testHistoryOk() throws InvalidMvp4gConfigurationException {
configuration.getHistory().setInitEvent("init");
historyConverters.add(new HistoryConverterElement());
configuration.validateHistory();
}
Aggregations