Daemon: add testSysModules using the standard ModuleOverloader
Allow the testing of the module override in the sysInjector by adding the testSysModule provided by the test to the standard override behaviour. Make possible the writing of integration test scenarios for all libModules, including the ones that rely on the overriding of existing modules. Enable the replacement of the AuditModule in tests, by adding the extra createAuditModule() method which is intended to be overridden by tests. Then, the test-case is based on a default audit module annotated with @ModuleImpl which is subsequently overridden by a libModule, annotated with @ModuleImpl as well and a matching name. Bug: Issue 13393 Change-Id: I68306905c0db5cecb92a7a504fa8d4adc8305103
This commit is contained in:
@@ -491,12 +491,13 @@ public class Daemon extends SiteProgram {
|
||||
modules.add(new AccountDeactivator.Module());
|
||||
modules.add(new ChangeCleanupRunner.Module());
|
||||
}
|
||||
modules.addAll(testSysModules);
|
||||
modules.add(new LocalMergeSuperSetComputation.Module());
|
||||
modules.add(new DefaultProjectNameLockManager.Module());
|
||||
return cfgInjector.createChildInjector(
|
||||
ModuleOverloader.override(
|
||||
modules, LibModuleLoader.loadModules(cfgInjector, LibModuleType.SYS_MODULE)));
|
||||
|
||||
List<Module> libModules = LibModuleLoader.loadModules(cfgInjector, LibModuleType.SYS_MODULE);
|
||||
libModules.addAll(testSysModules);
|
||||
|
||||
return cfgInjector.createChildInjector(ModuleOverloader.override(modules, libModules));
|
||||
}
|
||||
|
||||
private Module createIndexModule() {
|
||||
|
Reference in New Issue
Block a user