diff --git a/src/test/java/de/hsel/spm/baudas/analysis/ClusterTest.java b/src/test/java/de/hsel/spm/baudas/analysis/ClusterTest.java index 2711fa6..8eddd85 100644 --- a/src/test/java/de/hsel/spm/baudas/analysis/ClusterTest.java +++ b/src/test/java/de/hsel/spm/baudas/analysis/ClusterTest.java @@ -11,10 +11,16 @@ import java.util.concurrent.atomic.AtomicReference; import static org.junit.jupiter.api.Assertions.assertEquals; import static org.junit.jupiter.api.Assertions.assertTimeout; -public class ClusterTest { +/** + * test for Cluster Analysis. + * + * @author Julian Hinxlage + * @version 0.1 + */ +class ClusterTest { @Test - public void test100() { + void test100() { URL url = getClass().getClassLoader().getResource("kd100.csv"); assert url != null; @@ -22,6 +28,35 @@ public class ClusterTest { AtomicReference>> results = new AtomicReference<>(); + + assertTimeout(Duration.ofMillis(2000), () -> results.set(cluster.getResult())); + + assertEquals("m", results.get().get(0).get("Geschlecht")); + } + + @Test + void test1000() { + URL url = getClass().getClassLoader().getResource("kd1000.csv"); + assert url != null; + + Cluster cluster = new Cluster(new File(url.getFile())); + + AtomicReference>> results = new AtomicReference<>(); + + assertTimeout(Duration.ofMillis(2000), () -> results.set(cluster.getResult())); + + assertEquals("m", results.get().get(0).get("Geschlecht")); + } + + @Test + void test10000() { + URL url = getClass().getClassLoader().getResource("kd10000.csv"); + assert url != null; + + Cluster cluster = new Cluster(new File(url.getFile())); + + AtomicReference>> results = new AtomicReference<>(); + assertTimeout(Duration.ofMillis(2000), () -> results.set(cluster.getResult())); assertEquals("m", results.get().get(0).get("Geschlecht"));