use of com.mvp4g.rebind.config.element.EventFilterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testEventFiltersWrongEventBus.
@Test
public void testEventFiltersWrongEventBus() throws InvalidMvp4gConfigurationException {
EventBusElement eventBus = new EventBusElement(EventBus.class.getName(), BaseEventBus.class.getName(), false);
configuration.setEventBus(eventBus);
EventFilterElement filter = new EventFilterElement();
oracle.addClass(EventFilters.EventFilter3.class);
filter.setClassName(EventFilters.EventFilter3.class.getCanonicalName());
eventFilters.add(filter);
try {
configuration.validateEventFilters();
fail();
} catch (InvalidTypeException e) {
assertTrue(e.getMessage().contains("Can not convert " + EventBus.class.getCanonicalName()));
}
}
use of com.mvp4g.rebind.config.element.EventFilterElement 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.config.element.EventFilterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method newEventFilter.
private EventFilterElement newEventFilter(Class<? extends EventFilter<? extends EventBus>> c, String name) {
EventFilterElement eventFilter = new EventFilterElement();
eventFilter.setName(name);
oracle.addClass(c);
eventFilter.setClassName(c.getCanonicalName());
return eventFilter;
}
Aggregations