Search in sources :

Example 1 with DictionaryDAOImpl

use of org.alfresco.repo.dictionary.DictionaryDAOImpl in project alfresco-repository by Alfresco.

the class PolicyComponentTest method setUp.

@Override
protected void setUp() throws Exception {
    // Instantiate Dictionary Service
    TenantService tenantService = new SingleTServiceImpl();
    DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
    dictionaryDAO.setTenantService(tenantService);
    initDictionaryCaches(dictionaryDAO, tenantService);
    DictionaryBootstrap bootstrap = new DictionaryBootstrap();
    List<String> bootstrapModels = new ArrayList<String>();
    bootstrapModels.add("alfresco/model/dictionaryModel.xml");
    bootstrapModels.add("alfresco/model/systemModel.xml");
    bootstrapModels.add("org/alfresco/repo/policy/policycomponenttest_model.xml");
    bootstrapModels.add(TEST_MODEL);
    bootstrap.setModels(bootstrapModels);
    bootstrap.setDictionaryDAO(dictionaryDAO);
    bootstrap.setTenantService(new SingleTServiceImpl());
    bootstrap.bootstrap();
    DictionaryComponent dictionary = new DictionaryComponent();
    dictionary.setDictionaryDAO(dictionaryDAO);
    // Instantiate Policy Component
    policyComponent = new PolicyComponentImpl(dictionary);
}
Also used : TenantService(org.alfresco.repo.tenant.TenantService) DictionaryComponent(org.alfresco.repo.dictionary.DictionaryComponent) DictionaryDAOImpl(org.alfresco.repo.dictionary.DictionaryDAOImpl) DictionaryBootstrap(org.alfresco.repo.dictionary.DictionaryBootstrap) SingleTServiceImpl(org.alfresco.repo.tenant.SingleTServiceImpl) ArrayList(java.util.ArrayList)

Example 2 with DictionaryDAOImpl

use of org.alfresco.repo.dictionary.DictionaryDAOImpl in project alfresco-repository by Alfresco.

the class MTPolicyComponentTest method setUp.

@Override
protected void setUp() throws Exception {
    TenantService mockTenantService = mock(TenantService.class);
    when(mockTenantService.isEnabled()).thenReturn(true);
    when(mockTenantService.getCurrentUserDomain()).thenReturn("test.com");
    when(mockTenantService.getDomainUser(any(String.class), any(String.class))).thenReturn("System");
    when(mockTenantService.getBaseName(any(NodeRef.class))).thenReturn(new NodeRef(BASE_PROTOCOL, BASE_IDENTIFIER, BASE_ID));
    when(mockTenantService.getBaseName(any(StoreRef.class))).thenReturn(new StoreRef(BASE_PROTOCOL, BASE_IDENTIFIER));
    DictionaryDAOImpl dictionaryDAO = new DictionaryDAOImpl();
    dictionaryDAO.setTenantService(mockTenantService);
    initDictionaryCaches(dictionaryDAO, mockTenantService);
    DictionaryBootstrap bootstrap = new DictionaryBootstrap();
    List<String> bootstrapModels = new ArrayList<String>();
    bootstrapModels.add("alfresco/model/dictionaryModel.xml");
    bootstrapModels.add("alfresco/model/systemModel.xml");
    bootstrapModels.add("org/alfresco/repo/policy/policycomponenttest_model.xml");
    bootstrapModels.add(TEST_MODEL);
    bootstrap.setModels(bootstrapModels);
    bootstrap.setDictionaryDAO(dictionaryDAO);
    bootstrap.setTenantService(mockTenantService);
    bootstrap.bootstrap();
    DictionaryComponent dictionary = new DictionaryComponent();
    dictionary.setDictionaryDAO(dictionaryDAO);
    // Instantiate Policy Component
    PolicyComponentImpl x = new PolicyComponentImpl(dictionary);
    x.setTenantService(mockTenantService);
    policyComponent = x;
}
Also used : NodeRef(org.alfresco.service.cmr.repository.NodeRef) StoreRef(org.alfresco.service.cmr.repository.StoreRef) TenantService(org.alfresco.repo.tenant.TenantService) DictionaryComponent(org.alfresco.repo.dictionary.DictionaryComponent) DictionaryDAOImpl(org.alfresco.repo.dictionary.DictionaryDAOImpl) DictionaryBootstrap(org.alfresco.repo.dictionary.DictionaryBootstrap) ArrayList(java.util.ArrayList)

Aggregations

ArrayList (java.util.ArrayList)2 DictionaryBootstrap (org.alfresco.repo.dictionary.DictionaryBootstrap)2 DictionaryComponent (org.alfresco.repo.dictionary.DictionaryComponent)2 DictionaryDAOImpl (org.alfresco.repo.dictionary.DictionaryDAOImpl)2 TenantService (org.alfresco.repo.tenant.TenantService)2 SingleTServiceImpl (org.alfresco.repo.tenant.SingleTServiceImpl)1 NodeRef (org.alfresco.service.cmr.repository.NodeRef)1 StoreRef (org.alfresco.service.cmr.repository.StoreRef)1