diff --git a/AMAKFX/pom.xml b/AMAKFX/pom.xml index b82294e9d0e3da250d02f5ae3bcbcd3479afb7cd..7de3815da4c742af6d5a9a738d71bf0a5def69b2 100644 --- a/AMAKFX/pom.xml +++ b/AMAKFX/pom.xml @@ -22,11 +22,6 @@ </build> <dependencies> - <dependency> - <groupId>org.junit.jupiter</groupId> - <artifactId>junit-jupiter-engine</artifactId> - <version>5.3.1</version> - </dependency> <dependency> <groupId>org.jfree</groupId> diff --git a/AMAKFX/tests/agent/TestAgentBasicsOperations.java b/AMAKFX/tests/agent/TestAgentBasicsOperations.java index bd8f656981a833d66c148913d8693cd0934a5a31..4db6a03738616b9de556cc8e6871a1a7a3b6b830 100644 --- a/AMAKFX/tests/agent/TestAgentBasicsOperations.java +++ b/AMAKFX/tests/agent/TestAgentBasicsOperations.java @@ -1,10 +1,10 @@ package agent; -import static org.junit.Assert.assertNotNull; +import static org.junit.jupiter.api.Assertions.assertNotNull; import static org.junit.jupiter.api.Assertions.assertTrue; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import fr.irit.smac.amak.Agent; import fr.irit.smac.amak.CommunicatingAgent; @@ -16,7 +16,7 @@ public class TestAgentBasicsOperations extends ObjectsForAgentTesting { private Agent<TestAMAS, TestEnv> agent; - @Before + @BeforeEach public void setUp() { super.setup(); diff --git a/AMAKFX/tests/agent/TestAgentMessagingFeature.java b/AMAKFX/tests/agent/TestAgentMessagingFeature.java index 1bcbfb95ba324321aab812ba798d45545116c2e3..8e06619335c48004ebbc18603be3c214fdc02ad5 100644 --- a/AMAKFX/tests/agent/TestAgentMessagingFeature.java +++ b/AMAKFX/tests/agent/TestAgentMessagingFeature.java @@ -5,10 +5,10 @@ import static org.junit.jupiter.api.Assertions.assertTrue; import java.util.Collection; -import org.junit.After; -import org.junit.Before; -import org.junit.Ignore; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; import fr.irit.smac.amak.messaging.IAmakEnvelope; import testutils.ObjectsForAgentTesting; @@ -19,7 +19,7 @@ public class TestAgentMessagingFeature extends ObjectsForAgentTesting { public ObjectsForMessagingTesting omt; - @Before + @BeforeEach public void omt() { omt = new ObjectsForMessagingTesting(); } @@ -45,7 +45,7 @@ public class TestAgentMessagingFeature extends ObjectsForAgentTesting { * Since I was never able to make it fail reliably, I suspect a badly designed test, * And decided to deactivate it. */ - @Ignore @Test + @Disabled @Test public void getAllReceivedMessagesSendWithRawID() throws InterruptedException { communicantAgent1.run(); boolean sendingSuccessful = communicantAgent1.sendMessage(omt.MSG_1, ObjectsForAgentTesting.RAW_ID3); @@ -89,7 +89,7 @@ public class TestAgentMessagingFeature extends ObjectsForAgentTesting { assertEquals(omt.MSG_1, msg); } - @After + @AfterEach public void teardown() { omt.teardown(); } diff --git a/AMAKFX/tests/agent/TestAgentMessagingReaderAllMsg.java b/AMAKFX/tests/agent/TestAgentMessagingReaderAllMsg.java index 5d32ebc79d6eb5a7fd5c7110850604ada16f195b..97d44f045d5f76bf17addf0c0c2cfe4c3d38e8f5 100644 --- a/AMAKFX/tests/agent/TestAgentMessagingReaderAllMsg.java +++ b/AMAKFX/tests/agent/TestAgentMessagingReaderAllMsg.java @@ -7,8 +7,8 @@ import java.util.Collection; import java.util.HashSet; import java.util.Set; -import org.junit.After; -import org.junit.Test; +import org.junit.jupiter.api.AfterEach; +import org.junit.jupiter.api.Test; import fr.irit.smac.amak.messaging.IAmakEnvelope; import fr.irit.smac.amak.messaging.IAmakMessage; @@ -53,7 +53,7 @@ public class TestAgentMessagingReaderAllMsg extends ObjectsForAgentTesting { } - @After + @AfterEach public void teardown() { omt.teardown(); } diff --git a/AMAKFX/tests/agent/TestAgentTwoPhaseScheduling.java b/AMAKFX/tests/agent/TestAgentTwoPhaseScheduling.java index 6dbbb3a2666ab84cf4f216753425058ef9a4a066..5457b79b99c9e4b818496bb87413d1ba1273ac93 100644 --- a/AMAKFX/tests/agent/TestAgentTwoPhaseScheduling.java +++ b/AMAKFX/tests/agent/TestAgentTwoPhaseScheduling.java @@ -1,14 +1,15 @@ package agent; -import static org.junit.Assert.assertFalse; + import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertFalse; import java.util.concurrent.Semaphore; import java.util.concurrent.TimeUnit; import java.util.concurrent.atomic.AtomicInteger; -import org.junit.Before; -import org.junit.Test; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Test; import fr.irit.smac.amak.Amas; import fr.irit.smac.amak.CommunicatingAgent; @@ -25,8 +26,9 @@ public class TestAgentTwoPhaseScheduling { private TestAMAS amas; private static final Semaphore semaphoreToCreateBlockingState = new Semaphore(1); - @Before + @BeforeEach public void setup() { + Configuration.commandLineMode = true; ObjectsForAgentTesting o = new ObjectsForAgentTesting(); TestEnv env = o.new TestEnv(); amas = new TestAMAS(env); @@ -53,7 +55,7 @@ public class TestAgentTwoPhaseScheduling { System.out.println("main : wait for token"); boolean hasToken = semaphoreToWaitAgentEnding.tryAcquire(2, 10, TimeUnit.SECONDS); System.out.println("main : token release or expire, hasToken=" + hasToken); - assertFalse("None token should be available !", hasToken); + assertFalse(hasToken, "None token should be available !"); assertEquals(1, perceptionIsDone.get()); assertEquals(0, decideAndActDoneWithoutAllPerceptions.get()); } diff --git a/AMAKFX/tests/messaging/TestCustomMetaData.java b/AMAKFX/tests/messaging/TestCustomMetaData.java index 4acddb6ecf61546d40969235e1172a4195b0f3ce..1801871a5cd18b6172da6647a7f0c522a84c0ec7 100644 --- a/AMAKFX/tests/messaging/TestCustomMetaData.java +++ b/AMAKFX/tests/messaging/TestCustomMetaData.java @@ -1,12 +1,12 @@ package messaging; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import fr.irit.smac.amak.messaging.IAmakEnvelope; import fr.irit.smac.amak.messaging.IAmakMessage; diff --git a/AMAKFX/tests/messaging/TestsBasicsOperations.java b/AMAKFX/tests/messaging/TestsBasicsOperations.java index c6b12a8be0ca90e4bc4f4da951b4908beb29acea..9656bd1e8d1c7818ef6810d604ec231f009f32eb 100644 --- a/AMAKFX/tests/messaging/TestsBasicsOperations.java +++ b/AMAKFX/tests/messaging/TestsBasicsOperations.java @@ -1,12 +1,13 @@ package messaging; -import static org.junit.Assert.assertTrue; -import static org.junit.Assert.fail; + import static org.junit.jupiter.api.Assertions.assertEquals; +import static org.junit.jupiter.api.Assertions.assertTrue; +import static org.junit.jupiter.api.Assertions.fail; import java.util.List; -import org.junit.Test; +import org.junit.jupiter.api.Test; import fr.irit.smac.amak.messaging.IAmakEnvelope; import fr.irit.smac.amak.messaging.IAmakMessage; diff --git a/AMAKFX/tests/testutils/ObjectsForAgentTesting.java b/AMAKFX/tests/testutils/ObjectsForAgentTesting.java index af137a80f53120a0b3439b5228a739b702cfd0c2..a029283fb9d31eb6291af84c3594ce5acab782c9 100644 --- a/AMAKFX/tests/testutils/ObjectsForAgentTesting.java +++ b/AMAKFX/tests/testutils/ObjectsForAgentTesting.java @@ -1,6 +1,7 @@ package testutils; -import org.junit.Before; + +import org.junit.jupiter.api.BeforeEach; import fr.irit.smac.amak.Amas; import fr.irit.smac.amak.CommunicatingAgent; @@ -18,7 +19,7 @@ public class ObjectsForAgentTesting { public TestEnv env; - @Before + @BeforeEach public void setup() { Configuration.commandLineMode = true; diff --git a/AMAKFX/tests/testutils/ObjectsForMessagingTesting.java b/AMAKFX/tests/testutils/ObjectsForMessagingTesting.java index 3f9bde46ec343c5edf6afca337ec72e7d5512a17..b3f759497d7ae713ee3c15bcb12f1feef353f3e3 100644 --- a/AMAKFX/tests/testutils/ObjectsForMessagingTesting.java +++ b/AMAKFX/tests/testutils/ObjectsForMessagingTesting.java @@ -1,6 +1,8 @@ package testutils; -import org.junit.After; + + +import org.junit.jupiter.api.AfterEach; import fr.irit.smac.amak.aid.AddressableAID; import fr.irit.smac.amak.internal.messaging.ImplMessagingServiceAgentMessaging; @@ -52,7 +54,7 @@ public class ObjectsForMessagingTesting { return address; } - @After + @AfterEach public void teardown() { messagingServices.disposeAll(); } diff --git a/AMOEBAonAMAK/pom.xml b/AMOEBAonAMAK/pom.xml index f6290548f9767a6193f048f4d66076eebf5b6529..0d13e5166648b25d31befd757af1ae3436023817 100644 --- a/AMOEBAonAMAK/pom.xml +++ b/AMOEBAonAMAK/pom.xml @@ -18,14 +18,7 @@ <build> <sourceDirectory>src</sourceDirectory> - <resources> - <resource> - <directory>src</directory> - <excludes> - <exclude>**/*.java</exclude> - </excludes> - </resource> - </resources> + <testSourceDirectory>tests</testSourceDirectory> </build> <dependencies> diff --git a/AMOEBAonAMAK/src/agents/AmoebaAgent.java b/AMOEBAonAMAK/src/agents/AmoebaAgent.java index a2cd8dffd3aa2b05d17fe5bc601c078fbf22c0d7..132cad38b43c0dc8ed11a6530e6ef2106ac9ef3d 100644 --- a/AMOEBAonAMAK/src/agents/AmoebaAgent.java +++ b/AMOEBAonAMAK/src/agents/AmoebaAgent.java @@ -1,7 +1,5 @@ package agents; -import static org.junit.jupiter.api.Assertions.assertTrue; - import agents.percept.Percept; import fr.irit.smac.amak.Agent; import fr.irit.smac.amak.tools.Loggable; @@ -17,8 +15,6 @@ public abstract class AmoebaAgent extends Agent<AMOEBA, World> implements Loggab protected String name; private boolean dying; - static AmoebaAgent lastDeath = null; - protected RenderStrategy renderStrategy; /** @@ -28,7 +24,6 @@ public abstract class AmoebaAgent extends Agent<AMOEBA, World> implements Loggab public AmoebaAgent(AMOEBA amas, Object... params) { super(amas, params); this.dying = false; - assertTrue(this != lastDeath); } @Override @@ -75,7 +70,6 @@ public abstract class AmoebaAgent extends Agent<AMOEBA, World> implements Loggab } super.destroy(); logger().debug("CYCLE "+getAmas().getCycle(), "Agent %s destroyed.", toString()); - lastDeath = this; } /** diff --git a/AMOEBAonAMAK/src/experiments/FILE.java b/AMOEBAonAMAK/src/experiments/FILE.java index f77dfc4b3562041866dc9cde737d075134df62e9..d4c5f048aaff94e6bafa8f8e46b8ac32d38a7aa5 100644 --- a/AMOEBAonAMAK/src/experiments/FILE.java +++ b/AMOEBAonAMAK/src/experiments/FILE.java @@ -1,7 +1,7 @@ package experiments; -//Packages � importer afin d'utiliser l'objet File +//Packages a importer afin d'utiliser l'objet File import java.io.FileNotFoundException; import java.io.PrintWriter; diff --git a/AMOEBAonAMAK/src/experiments/F_XY_System.java b/AMOEBAonAMAK/src/experiments/F_XY_System.java index bd851cba1184affd56b05654d8dd735a4b6cc6ea..42899708ec1a01c6948f08d8fb87fb613dfe2402 100644 --- a/AMOEBAonAMAK/src/experiments/F_XY_System.java +++ b/AMOEBAonAMAK/src/experiments/F_XY_System.java @@ -45,8 +45,8 @@ public class F_XY_System implements StudiedSystem { result = getResult(x, y); - out.put("px", x); - out.put("py", y); + out.put("px0", x); + out.put("px1", y); out.put("oracle", result); return out; } diff --git a/AMOEBAonAMAK/src/kernel/SaveHelper.java b/AMOEBAonAMAK/src/kernel/SaveHelper.java index 643e10827172b8d1fd38a3cc5df6222cf47e2d66..6544059ea5ca631308c4e64355ddd68f5e4542a8 100644 --- a/AMOEBAonAMAK/src/kernel/SaveHelper.java +++ b/AMOEBAonAMAK/src/kernel/SaveHelper.java @@ -4,7 +4,6 @@ import java.io.File; import java.io.IOException; import java.nio.file.DirectoryStream; import java.nio.file.Files; -import java.nio.file.LinkOption; import java.nio.file.Path; import java.nio.file.Paths; import java.util.ArrayList; @@ -16,6 +15,7 @@ import gui.saveExplorer.SaveExplorer; import javafx.event.ActionEvent; import javafx.event.EventHandler; import javafx.stage.FileChooser; +import utils.DeleteDirectory; /** * An helper class that handle save, autosave, and load needs of an AMOEBA. @@ -58,7 +58,7 @@ public class SaveHelper { /** * Path to the save directory. */ - private Path dir; + public Path dir; private AMOEBA amoeba; @@ -101,7 +101,7 @@ public class SaveHelper { AmoebaWindow.addOnCloseAction(()-> { if(deleteFolderOnClose) { try { - deleteDirectoryRecursion(dir); + DeleteDirectory.deleteDirectoryRecursion(dir); } catch (IOException e) { e.printStackTrace(); System.err.println("Failed to delete saves files on close."); @@ -112,29 +112,21 @@ public class SaveHelper { } } - /** - * Delete a directory and everything in it, recursively. - * @param path - * @throws IOException - */ - private void deleteDirectoryRecursion(Path path) throws IOException { - if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) { - try (DirectoryStream<Path> entries = Files.newDirectoryStream(path)) { - for (Path entry : entries) { - deleteDirectoryRecursion(entry); - } - } - } - Files.delete(path); - } - /** * Load a save pointed by path. * @param path path to the save. */ public void load(String path) { File f = new File(path); - backupSystem.load(f); + load(f); + } + + /** + * Load a save from file. + * @param path path to the save. + */ + public void load(File file) { + backupSystem.load(file); } /** @@ -143,8 +135,16 @@ public class SaveHelper { */ public void save(String path) { File f = new File(path); + save(f); + } + + /** + * Create a save in file. + * @param path path of the new save + */ + public void save(File file) { backupSystem.setLoadPresetContext(true); - backupSystem.save(f); + backupSystem.save(file); } /** diff --git a/AMOEBAonAMAK/src/utils/DeleteDirectory.java b/AMOEBAonAMAK/src/utils/DeleteDirectory.java new file mode 100644 index 0000000000000000000000000000000000000000..b9a6d382afaa0f7471786dbc6aa0a0ab41c26e24 --- /dev/null +++ b/AMOEBAonAMAK/src/utils/DeleteDirectory.java @@ -0,0 +1,25 @@ +package utils; + +import java.io.IOException; +import java.nio.file.DirectoryStream; +import java.nio.file.Files; +import java.nio.file.LinkOption; +import java.nio.file.Path; + +public class DeleteDirectory { + /** + * Delete a directory and everything in it, recursively. + * @param path + * @throws IOException + */ + public static void deleteDirectoryRecursion(Path path) throws IOException { + if (Files.isDirectory(path, LinkOption.NOFOLLOW_LINKS)) { + try (DirectoryStream<Path> entries = Files.newDirectoryStream(path)) { + for (Path entry : entries) { + deleteDirectoryRecursion(entry); + } + } + } + Files.delete(path); + } +} diff --git a/AMOEBAonAMAK/src/utils/Round.java b/AMOEBAonAMAK/src/utils/Round.java new file mode 100644 index 0000000000000000000000000000000000000000..9cfe127c9246683749a3c015f17b09c730300f16 --- /dev/null +++ b/AMOEBAonAMAK/src/utils/Round.java @@ -0,0 +1,20 @@ +package utils; + +import java.math.BigDecimal; +import java.math.RoundingMode; + +public class Round { + /** + * Round a value to its nth decimal + * @param value + * @param places + * @return + */ + public static double round(double value, int places) { + if (places < 0) throw new IllegalArgumentException(); + + BigDecimal bd = new BigDecimal(value); + bd = bd.setScale(places, RoundingMode.HALF_UP); + return bd.doubleValue(); + } +} diff --git a/AMOEBAonAMAK/tests/savesystem/TestBackupSystem.java b/AMOEBAonAMAK/tests/savesystem/TestBackupSystem.java new file mode 100644 index 0000000000000000000000000000000000000000..33a0b3eb1dc8cd662e60978ef519a198700c49d4 --- /dev/null +++ b/AMOEBAonAMAK/tests/savesystem/TestBackupSystem.java @@ -0,0 +1,161 @@ +package savesystem; + +import static org.junit.jupiter.api.Assertions.assertArrayEquals; +import static org.junit.jupiter.api.Assertions.assertEquals; + +import java.io.File; +import java.io.IOException; +import java.util.HashMap; + +import org.junit.jupiter.api.BeforeAll; +import org.junit.jupiter.api.BeforeEach; +import org.junit.jupiter.api.Disabled; +import org.junit.jupiter.api.Test; + +import experiments.F_XY_System; +import fr.irit.smac.amak.Configuration; +import kernel.AMOEBA; +import kernel.StudiedSystem; +import utils.DeleteDirectory; +import utils.Round; + +public class TestBackupSystem { + + AMOEBA amoeba; + static final int SIZE = 100; + static final int ROUNDING_DECIMAL = 5; + static HashMap<String, Double>[] train = new HashMap[SIZE]; + static HashMap<String, Double>[] test = new HashMap[SIZE]; + + @BeforeAll + public static void setupTrainTestValues() { + StudiedSystem studiedSystem = new F_XY_System(50.0); + for (int i = 0; i < train.length; i++) { + studiedSystem.playOneStep(); + train[i] = studiedSystem.getOutput(); + } + for (int i = 0; i < test.length; i++) { + studiedSystem.playOneStep(); + test[i] = studiedSystem.getOutput(); + } + } + + @BeforeEach + public void setup() { + Configuration.allowedSimultaneousAgentsExecution = 1; + Configuration.commandLineMode = true; + StudiedSystem studiedSystem = new F_XY_System(50.0); + amoeba = new AMOEBA("resources/twoDimensionsLauncher.xml", studiedSystem); + for (int i = 0; i < train.length; i++) { + studiedSystem.playOneStep(); + amoeba.learn(train[i]); + } + } + + @Test + public void testSaveLoadSize() throws IOException { + File tempFile = File.createTempFile("testSave", "xml"); + tempFile.deleteOnExit(); + + amoeba.saver.save(tempFile); + + StudiedSystem studiedSystem = new F_XY_System(50.0); + AMOEBA amoebaLoad = new AMOEBA(tempFile.getAbsolutePath(), studiedSystem); + /* + * Improvement idea : defining equals on agent, and then test equality + */ + assertEquals(amoeba.getAgents().size(), amoebaLoad.getAgents().size()); + + try { + DeleteDirectory.deleteDirectoryRecursion(amoeba.saver.dir); + DeleteDirectory.deleteDirectoryRecursion(amoebaLoad.saver.dir); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Test @Disabled + public void testSaveLoadRequestSameAmoeba() throws IOException { + File tempFile = File.createTempFile("testSave", "xml"); + tempFile.deleteOnExit(); + Double[] requestOriginal = new Double[SIZE]; + Double[] requestLoaded = new Double[SIZE]; + + amoeba.saver.save(tempFile); + for (int i = 0; i < test.length; i++) { + requestOriginal[i] = Round.round(amoeba.request(test[i]), ROUNDING_DECIMAL); + } + + amoeba.saver.load(tempFile); + for (int i = 0; i < test.length; i++) { + requestLoaded[i] = Round.round(amoeba.request(test[i]), ROUNDING_DECIMAL); + } + + assertArrayEquals(requestOriginal, requestLoaded); + try { + DeleteDirectory.deleteDirectoryRecursion(amoeba.saver.dir); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Test @Disabled + public void testSaveLoadRequestDiffAmoeba() throws IOException { + File tempFile = File.createTempFile("testSave", "xml"); + tempFile.deleteOnExit(); + Double[] requestOriginal = new Double[SIZE]; + Double[] requestLoaded = new Double[SIZE]; + + amoeba.saver.save(tempFile); + for (int i = 0; i < test.length; i++) { + requestOriginal[i] = Round.round(amoeba.request(test[i]), ROUNDING_DECIMAL); + } + + StudiedSystem studiedSystem = new F_XY_System(50.0); + AMOEBA amoebaLoad = new AMOEBA(tempFile.getAbsolutePath(), studiedSystem); + amoebaLoad.saver.load(tempFile); + for (int i = 0; i < test.length; i++) { + requestLoaded[i] = Round.round(amoebaLoad.request(test[i]), ROUNDING_DECIMAL); + } + + assertArrayEquals(requestOriginal, requestLoaded); + try { + DeleteDirectory.deleteDirectoryRecursion(amoeba.saver.dir); + DeleteDirectory.deleteDirectoryRecursion(amoebaLoad.saver.dir); + } catch (IOException e) { + e.printStackTrace(); + } + } + + @Test @Disabled + public void testSaveLoadRequestDiffAmoebaNew() throws IOException { + File tempFile = File.createTempFile("testSave", "xml"); + tempFile.deleteOnExit(); + Double[] requestLoaded1 = new Double[SIZE]; + Double[] requestLoaded2 = new Double[SIZE]; + + amoeba.saver.save(tempFile); + + AMOEBA amoebaLoad1 = new AMOEBA(tempFile.getAbsolutePath(), null); + amoebaLoad1.saver.load(tempFile); + for (int i = 0; i < test.length; i++) { + requestLoaded1[i] = Round.round(amoebaLoad1.request(test[i]), ROUNDING_DECIMAL); + } + + AMOEBA amoebaLoad2 = new AMOEBA(tempFile.getAbsolutePath(), null); + amoebaLoad2.saver.load(tempFile); + for (int i = 0; i < test.length; i++) { + requestLoaded2[i] = Round.round(amoebaLoad2.request(test[i]), ROUNDING_DECIMAL); + } + + assertArrayEquals(requestLoaded1, requestLoaded2); + try { + DeleteDirectory.deleteDirectoryRecursion(amoeba.saver.dir); + DeleteDirectory.deleteDirectoryRecursion(amoebaLoad1.saver.dir); + DeleteDirectory.deleteDirectoryRecursion(amoebaLoad2.saver.dir); + } catch (IOException e) { + e.printStackTrace(); + } + } + +} diff --git a/pom.xml b/pom.xml index 0f8b51f0831074059477e50a993f612ce69675de..cbe4f07bac0e5f3d5a2dac74dd20d1ee13b0544d 100644 --- a/pom.xml +++ b/pom.xml @@ -42,6 +42,7 @@ <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-surefire-plugin</artifactId> + <version>2.22.2</version> <configuration> <reuseForks>false</reuseForks> <forkCount>1C</forkCount> @@ -76,10 +77,9 @@ <dependencies> <dependency> - <groupId>junit</groupId> - <artifactId>junit</artifactId> - <version>4.8.2</version> - <scope>test</scope> + <groupId>org.junit.jupiter</groupId> + <artifactId>junit-jupiter-engine</artifactId> + <version>5.4.2</version> </dependency> <dependency> <groupId>org.openjfx</groupId>