use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method newHistoryConverter.
private HistoryConverterElement newHistoryConverter(Class<?> c, String name) {
HistoryConverterElement historyConverter = new HistoryConverterElement();
historyConverter.setName(name);
oracle.addClass(c);
historyConverter.setClassName(c.getCanonicalName());
return historyConverter;
}
use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testEventHistoryConverterRemove.
@Test
public void testEventHistoryConverterRemove() throws InvalidMvp4gConfigurationException {
HistoryConverterElement hc1 = newHistoryConverter(SimpleHistoryConverter01.class, "hc1");
HistoryConverterElement hc2 = newHistoryConverter(SimpleHistoryConverter02.class, "hc2");
historyConverters.add(hc1);
historyConverters.add(hc2);
EventElement event = newEvent("testEvent");
event.setHistory("hc1");
events.add(event);
setEventBus();
assertEquals(2, historyConverters.size());
assertTrue(historyConverters.contains(hc1));
assertTrue(historyConverters.contains(hc2));
configuration.validateHistoryConverters();
assertEquals(1, historyConverters.size());
assertTrue(historyConverters.contains(hc1));
assertFalse(historyConverters.contains(hc2));
configuration.validateHistoryConverters();
}
use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class Mvp4gConfigurationTest method testRemoveClearHistory.
@Test
public void testRemoveClearHistory() throws InvalidMvp4gConfigurationException {
HistoryConverterElement e = new HistoryConverterElement();
e.setClassName(ClearHistory.class.getCanonicalName());
historyConverters.add(e);
EventBusElement eventBus = new EventBusElement(EventBus.class.getName(), BaseEventBus.class.getName(), false);
configuration.setEventBus(eventBus);
configuration.validateHistoryConverters();
}
use of com.mvp4g.rebind.config.element.HistoryConverterElement in project mvp4g by mvp4g.
the class HistoryAnnotationsLoader method loadElementWithServices.
/*
* (non-Javadoc)
*
* @see
* com.mvp4g.rebind.config.loader.annotation.Mvp4gAnnotationsWithServiceLoader#loadElementWithServices
* (com.google.gwt.core.ext.typeinfo.JClassType, java.lang.annotation.Annotation,
* com.mvp4g.rebind.config.Mvp4gConfiguration)
*/
@Override
Mvp4gWithServicesElement loadElementWithServices(JClassType c, History annotation, Mvp4gConfiguration configuration) throws Mvp4gAnnotationException {
String className = c.getQualifiedSourceName();
String historyName = buildElementNameIfNeeded(annotation.name(), className, "");
String type = annotation.type().name();
HistoryConverterElement historyConverter = new HistoryConverterElement();
historyConverter.setName(historyName);
historyConverter.setClassName(className);
historyConverter.setType(type);
addElement(configuration.getHistoryConverters(), historyConverter, c, null);
return historyConverter;
}
Aggregations