use of com.qcadoo.model.internal.classconverter.ModelXmlToClassConverterImpl in project qcadoo by qcadoo.
the class ModelXmlToDefinitionConverterTest method init.
@BeforeClass
public static void init() throws Exception {
applicationContext = mock(ApplicationContext.class);
dataAccessService = mock(DataAccessService.class);
translationService = mock(TranslationService.class);
dataDefinitionService = new DataDefinitionServiceImpl();
modelXmlToDefinitionConverter = new ModelXmlToDefinitionConverterImpl();
setField(modelXmlToDefinitionConverter, "dataDefinitionService", dataDefinitionService);
setField(modelXmlToDefinitionConverter, "dataAccessService", dataAccessService);
setField(modelXmlToDefinitionConverter, "applicationContext", applicationContext);
setField(modelXmlToDefinitionConverter, "translationService", translationService);
given(applicationContext.getBean(CustomHook.class)).willReturn(new CustomHook());
modelXmlToClassConverter = new ModelXmlToClassConverterImpl();
((ModelXmlToClassConverterImpl) modelXmlToClassConverter).setBeanClassLoader(ClassLoader.getSystemClassLoader());
dataDefinitions = performConvert(Utils.FULL_FIRST_ENTITY_XML_RESOURCE, Utils.FULL_SECOND_ENTITY_XML_RESOURCE, Utils.FULL_THIRD_ENTITY_XML_RESOURCE, Utils.OTHER_FIRST_ENTITY_XML_RESOURCE, Utils.OTHER_SECOND_ENTITY_XML_RESOURCE);
for (DataDefinition dd : dataDefinitions.toArray(new DataDefinition[dataDefinitions.size()])) {
if (dd.getName().equals("firstEntity") && dd.getPluginIdentifier().equals("full")) {
dataDefinition = (InternalDataDefinition) dd;
}
}
}
Aggregations