use of com.mvp4g.rebind.config.element.HistoryElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testHistoryWhenParent.
@Test
public void testHistoryWhenParent() throws InvalidMvp4gConfigurationException {
historyConverters.add(new HistoryConverterElement());
configuration.setModule(oracle.addClass(Modules.ModuleWithParent01.class));
// configuration.setModule( oracle.addClass( Modules.ModuleWithParent01.class ) );
setParentEventBus(Modules.ModuleWithParent01.class, EventBusOk.class);
configuration.loadParentModule();
configuration.getHistory().setInitEvent("event");
try {
configuration.validateHistory();
fail();
} catch (InvalidMvp4gConfigurationException e) {
assertEquals("Module com.mvp4g.rebind.test_tools.Modules.ModuleWithParent01: History configuration (init, not found event and history parameter separator) should be set only for root module (only module with no parent)", e.getMessage());
}
HistoryElement history = new HistoryElement();
configuration.setHistory(history);
history.setNotFoundEvent("event");
try {
configuration.validateHistory();
fail();
} catch (InvalidMvp4gConfigurationException e) {
assertEquals("Module com.mvp4g.rebind.test_tools.Modules.ModuleWithParent01: History configuration (init, not found event and history parameter separator) should be set only for root module (only module with no parent)", e.getMessage());
}
history = new HistoryElement();
configuration.setHistory(history);
configuration.validateHistory();
assertNull(configuration.getHistory());
}
use of com.mvp4g.rebind.config.element.HistoryElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testSetterAndGetter.
@Test
public void testSetterAndGetter() {
StartElement start = new StartElement();
configuration.setStart(start);
assertSame(start, configuration.getStart());
HistoryElement history = new HistoryElement();
configuration.setHistory(history);
assertSame(history, configuration.getHistory());
EventBusElement eventBus = new EventBusElement(null, null, false);
configuration.setEventBus(eventBus);
assertSame(eventBus, configuration.getEventBus());
assertSame(oracle, configuration.getOracle());
}
use of com.mvp4g.rebind.config.element.HistoryElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testSetterGetter.
@Test
public void testSetterGetter() {
StartElement start = new StartElement();
configuration.setStart(start);
assertSame(start, configuration.getStart());
HistoryElement history = new HistoryElement();
configuration.setHistory(history);
assertSame(history, configuration.getHistory());
EventBusElement eventBus = new EventBusElement("", "", false);
configuration.setEventBus(eventBus);
assertSame(eventBus, configuration.getEventBus());
JClassType module = oracle.findType(Mvp4gModule.class.getCanonicalName());
configuration.setModule(module);
assertSame(module, configuration.getModule());
JClassType parentEventBus = oracle.addClass(EventBus.class);
configuration.setParentEventBus(parentEventBus);
assertSame(parentEventBus, configuration.getParentEventBus());
String historyName = "historyName";
configuration.setHistoryName("historyName");
assertSame(historyName, configuration.getHistoryName());
ChildModulesElement childConfig = new ChildModulesElement();
configuration.setLoadChildConfig(childConfig);
assertSame(childConfig, configuration.getLoadChildConfig());
DebugElement debug = new DebugElement();
configuration.setDebug(debug);
assertSame(debug, configuration.getDebug());
GinModuleElement gin = new GinModuleElement();
configuration.setGinModule(gin);
assertSame(gin, configuration.getGinModule());
EventFiltersElement filters = new EventFiltersElement();
configuration.setEventFilterConfiguration(filters);
assertSame(filters, configuration.getEventFilterConfiguration());
}
use of com.mvp4g.rebind.config.element.HistoryElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method setUp.
@Before
public void setUp() {
GeneratorContextStub context = new GeneratorContextStub();
builder = new UnitTestTreeLogger.Builder();
logger = builder.createLogger();
oracle = context.getTypeOracleStub();
// oracle.addClass( SimpleView01.class );
configuration = new Mvp4gConfiguration(logger, context);
presenters = configuration.getPresenters();
views = configuration.getViews();
events = configuration.getEvents();
services = configuration.getServices();
historyConverters = configuration.getHistoryConverters();
childModules = configuration.getChildModules();
eventHandlers = configuration.getEventHandlers();
eventFilters = configuration.getEventFilters();
configuration.setStart(new StartElement());
configuration.setHistory(new HistoryElement());
configuration.setModule(oracle.addClass(Mvp4gModule.class));
}
Aggregations