Commit 53512737 authored by Johannes Salentin's avatar Johannes Salentin
Browse files

new tests

parent 38812746
Pipeline #159970 passed with stages
in 1 minute and 23 seconds
This diff is collapsed.
......@@ -36,7 +36,7 @@
<directory>${basedir}</directory>
<includes>
<include>CentralModel.xml</include>
<include>Test.xml</include>
<include>SmellExample.xml</include>
<include>archimate3_Diagram.xsd</include>
<include>archimate3_View.xsd</include>
<include>archimate3_Model.xsd</include>
......
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestAmbiguousViewpoint {
private AmbiguousViewpoint detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new AmbiguousViewpoint();
assertEquals(detector.detect().size(), 1);
}
@Test
void test() {
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new AmbiguousViewpoint();
assertEquals(detector.detect().size(), 1);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestCyclicDependency {
private CyclicDependency detector;
@BeforeAll
void init() {
ModelAdapter model = new ModelAdapter("Test.xml", null);
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new CyclicDependency();
assertEquals(detector.detect().size(), 0);
}
@Test
void test() {
assertEquals(detector.detect().size(), 6);
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new CyclicDependency();
assertEquals(detector.detect().size(), 3);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestDeadComponent {
private DeadComponent detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new DeadComponent();
assertEquals(detector.detect().size(), 0);
}
@Test
void test() {
assertEquals(detector.detect().size(), 0);
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new DeadComponent();
assertEquals(detector.detect().size(), 2);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestDenseStructure {
private DenseStructure detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new DenseStructure();
assertEquals(detector.detect().size(), 0);
}
@Test
void test() {
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new DenseStructure();
assertEquals(detector.detect().size(), 0);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestDocumentation {
private Documentation detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new Documentation();
assertEquals(detector.detect().size(), 0);
}
@Test
void test() {
assertEquals(detector.detect().size(), 0);
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new Documentation();
assertEquals(detector.detect().size(), 1);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestDuplication {
private Duplication detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new Duplication();
assertEquals(detector.detect().size(), 0);
}
@Test
void test() {
assertEquals(detector.detect().size(), 0);
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new Duplication();
assertEquals(detector.detect().size(), 2);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestHubLikeModularization {
private HubLikeModularization detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new HubLikeModularization();
assertEquals(detector.detect().size(), 0);
}
@Test
void test() {
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new HubLikeModularization();
assertEquals(detector.detect().size(), 0);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestLazyComponent {
private LazyComponent detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new LazyComponent();
assertEquals(detector.detect().size(), 1);
}
@Test
void test() {
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new LazyComponent();
assertEquals(detector.detect().size(), 1);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestMessageChain {
private MessageChain detector;
@BeforeAll
void init() {
ModelAdapter model = new ModelAdapter("Test.xml", null);
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new MessageChain();
assertEquals(detector.detect().size(), 0);
}
@Test
void test() {
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new MessageChain();
assertEquals(detector.detect().size(), 1);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestSharedPersistency {
private SharedPersistency detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new SharedPersistency();
assertEquals(detector.detect().size(), 1);
}
@Test
void test() {
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new SharedPersistency();
assertEquals(detector.detect().size(), 1);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestStrictLayersViolation {
private StrictLayersViolation detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new StrictLayersViolation();
assertEquals(detector.detect().size(), 0);
}
@Test
void test() {
assertEquals(detector.detect().size(), 0);
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new StrictLayersViolation();
assertEquals(detector.detect().size(), 3);
}
}
package de.example.smells;
import de.example.main.ModelAdapter;
import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Test;
import static org.junit.jupiter.api.Assertions.assertEquals;
......@@ -10,15 +9,19 @@ class TestWeakenedModularity {
private WeakenedModularity detector;
@BeforeAll
void init() {
@Test
void testCentralModel() {
ModelAdapter model = new ModelAdapter("CentralModel.xml", null);
Detector.setModel(model);
detector = new WeakenedModularity();
assertEquals(detector.detect().size(), 3);
}
@Test
void test() {
assertEquals(detector.detect().size(), 3);
void testSmellExample() {
ModelAdapter model = new ModelAdapter("SmellExample.xml", null);
Detector.setModel(model);
detector = new WeakenedModularity();
assertEquals(detector.detect().size(), 1);
}
}
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