From ed0d5d3e1dc5681019eb0ef4e443a4c55a265266 Mon Sep 17 00:00:00 2001 From: miconis Date: Fri, 4 Dec 2020 15:41:31 +0100 Subject: [PATCH] implementation of the wf to dedup entities, addition of the module to run the wf on the cluster --- dnet-pace-core/pom.xml | 5 +++-- .../pace/clustering/ClusteringFunctionTest.java | 11 +++++------ .../java/eu/dnetlib/pace/common/PaceFunctionTest.java | 10 ++++------ .../eu/dnetlib/pace/comparators/ComparatorTest.java | 9 ++++----- .../test/java/eu/dnetlib/pace/config/ConfigTest.java | 10 +++++----- .../src/test/java/eu/dnetlib/pace/util/UtilTest.java | 5 ++--- 6 files changed, 23 insertions(+), 27 deletions(-) diff --git a/dnet-pace-core/pom.xml b/dnet-pace-core/pom.xml index 3ddd658b1..e72bd3292 100644 --- a/dnet-pace-core/pom.xml +++ b/dnet-pace-core/pom.xml @@ -43,9 +43,10 @@ commons-logging commons-logging + - junit - junit + org.junit.jupiter + junit-jupiter test diff --git a/dnet-pace-core/src/test/java/eu/dnetlib/pace/clustering/ClusteringFunctionTest.java b/dnet-pace-core/src/test/java/eu/dnetlib/pace/clustering/ClusteringFunctionTest.java index 396604cea..1b4f6f0eb 100644 --- a/dnet-pace-core/src/test/java/eu/dnetlib/pace/clustering/ClusteringFunctionTest.java +++ b/dnet-pace-core/src/test/java/eu/dnetlib/pace/clustering/ClusteringFunctionTest.java @@ -5,18 +5,17 @@ import com.google.common.collect.Maps; import eu.dnetlib.pace.AbstractPaceTest; import eu.dnetlib.pace.common.AbstractPaceFunctions; import eu.dnetlib.pace.config.DedupConfig; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.*; import java.util.Map; public class ClusteringFunctionTest extends AbstractPaceTest { - private Map params; - DedupConfig conf; + private static Map params; + private static DedupConfig conf; - @Before - public void setUp() throws Exception { + @BeforeAll + public static void setUp() throws Exception { params = Maps.newHashMap(); conf = DedupConfig.load(AbstractPaceFunctions.readFromClasspath("/eu/dnetlib/pace/config/organization.current.conf.json", ClusteringFunctionTest.class)); } diff --git a/dnet-pace-core/src/test/java/eu/dnetlib/pace/common/PaceFunctionTest.java b/dnet-pace-core/src/test/java/eu/dnetlib/pace/common/PaceFunctionTest.java index d92d4009a..ff1ca6721 100644 --- a/dnet-pace-core/src/test/java/eu/dnetlib/pace/common/PaceFunctionTest.java +++ b/dnet-pace-core/src/test/java/eu/dnetlib/pace/common/PaceFunctionTest.java @@ -1,10 +1,8 @@ package eu.dnetlib.pace.common; -import org.junit.Assert; -import org.junit.Test; - -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; +import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; public class PaceFunctionTest extends AbstractPaceFunctions { @@ -27,7 +25,7 @@ public class PaceFunctionTest extends AbstractPaceFunctions { @Test public void normalizeTest() { - Assert.assertEquals("universitat", normalize("Universität")); + assertEquals("universitat", normalize("Universität")); System.out.println(normalize("İstanbul Ticarət Universiteti")); } diff --git a/dnet-pace-core/src/test/java/eu/dnetlib/pace/comparators/ComparatorTest.java b/dnet-pace-core/src/test/java/eu/dnetlib/pace/comparators/ComparatorTest.java index c1ce3d883..060526bfb 100644 --- a/dnet-pace-core/src/test/java/eu/dnetlib/pace/comparators/ComparatorTest.java +++ b/dnet-pace-core/src/test/java/eu/dnetlib/pace/comparators/ComparatorTest.java @@ -5,23 +5,22 @@ import eu.dnetlib.pace.model.MapDocument; import eu.dnetlib.pace.tree.*; import eu.dnetlib.pace.config.DedupConfig; import eu.dnetlib.pace.util.MapDocumentUtil; -import org.junit.Before; -import org.junit.Test; + +import org.junit.jupiter.api.*; +import static org.junit.jupiter.api.Assertions.assertEquals; import eu.dnetlib.pace.common.AbstractPaceFunctions; import java.util.HashMap; import java.util.Map; -import static junit.framework.Assert.assertEquals; -import static junit.framework.Assert.assertTrue; public class ComparatorTest extends AbstractPaceFunctions { private Map params; private DedupConfig conf; - @Before + @BeforeAll public void setup() { params = new HashMap<>(); params.put("weight", "1.0"); diff --git a/dnet-pace-core/src/test/java/eu/dnetlib/pace/config/ConfigTest.java b/dnet-pace-core/src/test/java/eu/dnetlib/pace/config/ConfigTest.java index 4abf40cc8..05a8636ac 100644 --- a/dnet-pace-core/src/test/java/eu/dnetlib/pace/config/ConfigTest.java +++ b/dnet-pace-core/src/test/java/eu/dnetlib/pace/config/ConfigTest.java @@ -7,22 +7,22 @@ import eu.dnetlib.pace.model.FieldList; import eu.dnetlib.pace.model.MapDocument; import eu.dnetlib.pace.tree.JsonListMatch; import eu.dnetlib.pace.util.MapDocumentUtil; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.*; + +import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertNotNull; import java.util.HashMap; import java.util.List; import java.util.Map; import java.util.stream.Collectors; -import static org.junit.Assert.assertEquals; -import static org.junit.Assert.assertNotNull; public class ConfigTest extends AbstractPaceTest { private Map params; - @Before + @BeforeAll public void setup() { params = new HashMap<>(); params.put("jpath_value", "$.value"); diff --git a/dnet-pace-core/src/test/java/eu/dnetlib/pace/util/UtilTest.java b/dnet-pace-core/src/test/java/eu/dnetlib/pace/util/UtilTest.java index b85be57d1..d8e0767d5 100644 --- a/dnet-pace-core/src/test/java/eu/dnetlib/pace/util/UtilTest.java +++ b/dnet-pace-core/src/test/java/eu/dnetlib/pace/util/UtilTest.java @@ -1,7 +1,6 @@ package eu.dnetlib.pace.util; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.*; import java.util.HashMap; import java.util.Map; @@ -10,7 +9,7 @@ public class UtilTest { Map params; - @Before + @BeforeAll public void setUp(){ params = new HashMap(); }