use of com.mvp4g.rebind.exception.InvalidClassException in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testEventFiltersWrongClass.
@Test
public void testEventFiltersWrongClass() throws InvalidMvp4gConfigurationException {
EventBusElement eventBus = new EventBusElement(EventBusWithLookup.class.getName(), BaseEventBus.class.getName(), false);
configuration.setEventBus(eventBus);
EventFilterElement filter = new EventFilterElement();
filter.setClassName(Object.class.getName());
eventFilters.add(filter);
try {
configuration.validateEventFilters();
fail();
} catch (InvalidClassException e) {
assertTrue(e.getMessage().contains("This class must extend " + EventFilter.class.getCanonicalName()));
}
}
use of com.mvp4g.rebind.exception.InvalidClassException in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testWrongEventHandlerClass.
@Test
public void testWrongEventHandlerClass() throws InvalidMvp4gConfigurationException {
EventBusElement eventBus = new EventBusElement(EventBusWithLookup.class.getName(), BaseEventBus.class.getName(), false);
configuration.setEventBus(eventBus);
EventElement event = newEvent("event");
event.setHandlers(new String[] { "test" });
events.add(event);
EventHandlerElement handler = new EventHandlerElement();
handler.setClassName(Object.class.getCanonicalName());
handler.setName("test");
eventHandlers.add(handler);
try {
configuration.validateEventHandlers();
fail();
} catch (InvalidClassException e) {
}
handler.setMultiple(Boolean.TRUE.toString());
try {
configuration.validateEventHandlers();
fail();
} catch (InvalidClassException e) {
}
PresenterElement presenter = new PresenterElement();
Class<?> c = SimpleEventHandler01.class;
oracle.addClass(c);
presenter.setClassName(c.getCanonicalName());
presenter.setName("test");
presenters.add(presenter);
try {
configuration.validateEventHandlers();
fail();
} catch (InvalidClassException e) {
}
presenter.setMultiple(Boolean.TRUE.toString());
try {
configuration.validateEventHandlers();
fail();
} catch (InvalidClassException e) {
}
}
Aggregations