Search in sources :

Example 1 with DataAccessService

use of com.qcadoo.model.internal.api.DataAccessService in project qcadoo by qcadoo.

the class EntityListImplTest method init.

@Before
public void init() {
    dataAccessService = mock(DataAccessService.class);
    SearchRestrictions restrictions = new SearchRestrictions();
    ReflectionTestUtils.setField(restrictions, "dataAccessService", dataAccessService);
}
Also used : DataAccessService(com.qcadoo.model.internal.api.DataAccessService) SearchRestrictions(com.qcadoo.model.api.search.SearchRestrictions) Before(org.junit.Before)

Example 2 with DataAccessService

use of com.qcadoo.model.internal.api.DataAccessService in project qcadoo by qcadoo.

the class EntityTreeImplTest method init.

@Before
public void init() {
    dataAccessService = mock(DataAccessService.class);
    SearchRestrictions restrictions = new SearchRestrictions();
    ReflectionTestUtils.setField(restrictions, "dataAccessService", dataAccessService);
}
Also used : DataAccessService(com.qcadoo.model.internal.api.DataAccessService) SearchRestrictions(com.qcadoo.model.api.search.SearchRestrictions) Before(org.junit.Before)

Example 3 with DataAccessService

use of com.qcadoo.model.internal.api.DataAccessService 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;
        }
    }
}
Also used : CustomHook(com.qcadoo.model.CustomHook) ApplicationContext(org.springframework.context.ApplicationContext) TranslationService(com.qcadoo.localization.api.TranslationService) DataAccessService(com.qcadoo.model.internal.api.DataAccessService) DataDefinitionServiceImpl(com.qcadoo.model.internal.DataDefinitionServiceImpl) ModelXmlToClassConverterImpl(com.qcadoo.model.internal.classconverter.ModelXmlToClassConverterImpl) InternalDataDefinition(com.qcadoo.model.internal.api.InternalDataDefinition) DataDefinition(com.qcadoo.model.api.DataDefinition) BeforeClass(org.junit.BeforeClass)

Aggregations

DataAccessService (com.qcadoo.model.internal.api.DataAccessService)3 SearchRestrictions (com.qcadoo.model.api.search.SearchRestrictions)2 Before (org.junit.Before)2 TranslationService (com.qcadoo.localization.api.TranslationService)1 CustomHook (com.qcadoo.model.CustomHook)1 DataDefinition (com.qcadoo.model.api.DataDefinition)1 DataDefinitionServiceImpl (com.qcadoo.model.internal.DataDefinitionServiceImpl)1 InternalDataDefinition (com.qcadoo.model.internal.api.InternalDataDefinition)1 ModelXmlToClassConverterImpl (com.qcadoo.model.internal.classconverter.ModelXmlToClassConverterImpl)1 BeforeClass (org.junit.BeforeClass)1 ApplicationContext (org.springframework.context.ApplicationContext)1