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);
}
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;
}
Aggregations