use of com.mvp4g.rebind.config.element.StartElement 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.StartElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testForwardEventRootModule.
@Test
public void testForwardEventRootModule() throws InvalidMvp4gConfigurationException {
StartElement start = configuration.getStart();
start.setForwardEventType("forward");
try {
configuration.validateEvents();
fail();
} catch (InvalidMvp4gConfigurationException ex) {
assertEquals("You can't define a forward event for RootModule since no event from parent can be forwarded to it.", ex.getMessage());
}
}
use of com.mvp4g.rebind.config.element.StartElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testStartEventWithParameter.
@Test
public void testStartEventWithParameter() throws InvalidMvp4gConfigurationException {
EventElement e = newEvent("start");
e.setEventObjectClass(new String[] { Object.class.getCanonicalName() });
events.add(e);
StartElement start = configuration.getStart();
start.setPresenter("startPresenter");
start.setEventType("start");
try {
configuration.validateStart();
fail();
} catch (InvalidMvp4gConfigurationException ex) {
assertEquals("Start: Start event start can't have any object associated with it.", ex.getMessage());
}
events.clear();
e = newEvent("start");
events.add(e);
configuration.validateStart();
}
use of com.mvp4g.rebind.config.element.StartElement 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.StartElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testForwardEventWithParameter.
@Test
public void testForwardEventWithParameter() throws InvalidMvp4gConfigurationException {
configuration.setModule(oracle.addClass(Modules.Module01.class));
EventElement e = newEvent("forward");
e.setEventObjectClass(new String[] { Object.class.getCanonicalName() });
events.add(e);
StartElement start = configuration.getStart();
start.setForwardEventType("forward");
try {
setEventBus();
JClassType parentEventBus = oracle.addClass(EventBus.class);
configuration.setParentEventBus(parentEventBus);
configuration.validateEvents();
fail();
} catch (InvalidMvp4gConfigurationException ex) {
assertEquals("Forward: Forward event forward can't have any object associated with it.", ex.getMessage());
}
}
Aggregations