use of com.mvp4g.rebind.exception.UnknownConfigurationElementException in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testUnknownLoadConfigEvent.
@Test
public void testUnknownLoadConfigEvent() throws InvalidMvp4gConfigurationException {
ChildModulesElement childModules = new ChildModulesElement();
configuration.setHistory(null);
configuration.setLoadChildConfig(childModules);
childModules.setBeforeEvent("unknown");
try {
configuration.validateEvents();
fail();
} catch (UnknownConfigurationElementException e) {
// nothing to test
}
childModules = new ChildModulesElement();
configuration.setLoadChildConfig(childModules);
childModules.setAfterEvent("unknown");
try {
configuration.validateEvents();
fail();
} catch (UnknownConfigurationElementException e) {
// nothing to test
}
childModules = new ChildModulesElement();
configuration.setLoadChildConfig(childModules);
childModules.setErrorEvent("unknown");
try {
configuration.validateEvents();
fail();
} catch (UnknownConfigurationElementException e) {
// nothing to test
}
}
use of com.mvp4g.rebind.exception.UnknownConfigurationElementException in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testUnknownActivateDeactivate.
@Test
public void testUnknownActivateDeactivate() throws InvalidMvp4gConfigurationException {
EventBusElement eventBus = new EventBusElement(EventBusWithLookup.class.getName(), BaseEventBus.class.getName(), false);
configuration.setEventBus(eventBus);
EventElement event1 = newEvent("event1");
event1.setActivate(new String[] { "activate" });
events.add(event1);
try {
configuration.validateEventHandlers();
fail();
} catch (UnknownConfigurationElementException e) {
assertTrue(e.getMessage().contains("Encountered a reference to unknown element 'activate'"));
}
events.clear();
EventElement event2 = newEvent("event2");
event2.setDeactivate(new String[] { "deactivate" });
events.add(event2);
try {
configuration.validateEventHandlers();
fail();
} catch (UnknownConfigurationElementException e) {
assertTrue(e.getMessage().contains("Encountered a reference to unknown element 'deactivate'"));
}
}
Aggregations