Commit f41a39bd authored by DominikE's avatar DominikE
Browse files

Add method to check whether a module is loaded

parent 8e1fe62b
Pipeline #2506 passed with stage
in 39 seconds
......@@ -340,6 +340,18 @@ public class Moduli
}
/**
* Check whether a module is loaded.
*
* @param moduleId the Class of the module
* @return if the module is loaded
*/
public boolean isModuleLoaded(Class<? extends AModule> moduleId)
{
return modules.containsKey(moduleId);
}
/**
* Checks, if dependencies can be resolved.
*
......
......@@ -47,6 +47,8 @@ public class ModuliTest
moduli.loadModulesSafe(MODULE_CONFIG_PATH + "test_config.xml");
assertThat(moduli.getModulesState().get(), is(ModulesState.RESOLVED));
assertThat(moduli.isModuleLoaded(TestModule.class), is(true));
moduli.startModules();
assertThat(moduli.getModulesState().get(), is(ModulesState.ACTIVE));
......@@ -77,6 +79,7 @@ public class ModuliTest
{
moduli.loadModulesSafe(MODULE_CONFIG_PATH + "empty_config.xml");
assertThat(moduli.getModulesState().get(), is(ModulesState.RESOLVED));
assertThat(moduli.isModuleLoaded(TestModule.class), is(false));
moduli.startModules();
assertThat(moduli.getModulesState().get(), is(ModulesState.ACTIVE));
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment