Commit 57657b6f authored by DominikE's avatar DominikE

Add tests for cyclic and unresolved dependencies

parent 7b3e2a78
......@@ -10,6 +10,7 @@ import org.junit.After;
import org.junit.Before;
import org.junit.Test;
import edu.tigers.moduli.exceptions.InitModuleException;
import edu.tigers.moduli.listenerVariables.ModulesState;
import edu.tigers.moduli.modules.ConfiguredTestModule;
import edu.tigers.moduli.modules.TestModule;
......@@ -103,4 +104,20 @@ public class ModuliTest
assertThat(module.getConfigProperty()).isEqualTo("exists");
}
@Test(expected = InitModuleException.class)
public void testCyclicConfiguration() throws Exception
{
moduli.loadModulesSafe(MODULE_CONFIG_PATH + "cyclic_config.xml");
moduli.startModules();
}
@Test(expected = InitModuleException.class)
public void testUnresolvedDependencyConfiguration() throws Exception
{
moduli.loadModulesSafe(MODULE_CONFIG_PATH + "unresolved_dependency_config.xml");
moduli.startModules();
}
}
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<moduleTest>
<globalConfiguration>
<environment>MODULI</environment>
</globalConfiguration>
<module id="edu.tigers.moduli.modules.TestModule">
<implementation>edu.tigers.moduli.modules.ConcreteTestModule</implementation>
<dependency>edu.tigers.moduli.modules.ConfiguredTestModule</dependency>
</module>
<module id="edu.tigers.moduli.modules.ConfiguredTestModule">
<properties>
<testProperty>exists</testProperty>
</properties>
<dependency>edu.tigers.moduli.modules.TestModule</dependency>
</module>
</moduleTest>
\ No newline at end of file
......@@ -6,10 +6,6 @@
<environment>MODULI</environment>
</globalConfiguration>
<module id="edu.tigers.moduli.modules.TestModule">
<implementation>edu.tigers.moduli.modules.ConcreteTestModule</implementation>
</module>
<module id="edu.tigers.moduli.modules.ConfiguredTestModule">
<properties>
......@@ -18,4 +14,8 @@
<dependency>edu.tigers.moduli.modules.TestModule</dependency>
</module>
<module id="edu.tigers.moduli.modules.TestModule">
<implementation>edu.tigers.moduli.modules.ConcreteTestModule</implementation>
</module>
</moduleTest>
\ No newline at end of file
<?xml version="1.0" encoding="UTF-8" ?>
<moduleTest>
<globalConfiguration>
<environment>MODULI</environment>
</globalConfiguration>
<module id="edu.tigers.moduli.modules.TestModule">
<implementation>edu.tigers.moduli.modules.ConcreteTestModule</implementation>
</module>
<module id="edu.tigers.moduli.modules.ConfiguredTestModule">
<properties>
<testProperty>exists</testProperty>
</properties>
<dependency>edu.tigers.moduli.modules.ConcreteTestModule</dependency>
</module>
</moduleTest>
\ No newline at end of file
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