use of org.alfresco.repo.module.ModuleServiceImpl in project alfresco-repository by Alfresco.
the class ModuleServiceImplTest method setUp.
@Before
public void setUp() throws Exception {
moduleService = new ModuleServiceImpl();
Resource simpleMod = new PathMatchingResourcePatternResolver().getResource("classpath:alfresco/module/simplemodule.properties");
assertNotNull(simpleMod);
RegistryService reg = mock(RegistryService.class);
ApplicationContext applicationContext = mock(ApplicationContext.class);
when(reg.getProperty((RegistryKey) any())).thenAnswer(new Answer<Serializable>() {
public Serializable answer(InvocationOnMock invocation) throws Throwable {
RegistryKey key = (RegistryKey) invocation.getArguments()[0];
return new ModuleVersionNumber("1.1");
}
});
doReturn(Arrays.asList("fee", "alfresco-simple-module", "fo")).when(reg).getChildElements((RegistryKey) any());
doReturn(new Resource[] { simpleMod }).when(applicationContext).getResources(anyString());
moduleService.setRegistryService(reg);
moduleService.setApplicationContext(applicationContext);
}
Aggregations