Fixed broken JUnit setup

This commit is contained in:
law39 2020-04-30 11:46:55 +01:00
parent 3beb45941c
commit 0d38840842
4 changed files with 12 additions and 16 deletions

View file

@ -38,21 +38,14 @@
<!-- </dependency>-->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.2</version>
<scope>test</scope>
<artifactId>junit-jupiter</artifactId>
<version>5.4.2</version>
</dependency>
<dependency>
<groupId>org.testfx</groupId>
<artifactId>testfx-junit5</artifactId>
<version>4.0.16-alpha</version>
</dependency>
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.5.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<build>
<plugins>

View file

@ -3,8 +3,9 @@ module uk.ac.aber.cs22120.group20 {
requires javafx.fxml;
requires com.fasterxml.jackson.core;
requires com.fasterxml.jackson.databind;
requires org.junit.jupiter.api;
requires org.junit.jupiter;
requires org.testfx;
requires org.junit.jupiter.api;
opens uk.ac.aber.cs22120.group20.javafx to javafx.fxml;
@ -16,6 +17,6 @@ module uk.ac.aber.cs22120.group20 {
exports uk.ac.aber.cs22120.group20.json to com.fasterxml.jackson.databind;
exports uk.ac.aber.cs22120.group20.javafx to javafx.graphics, javafx.fxml;
exports uk.ac.aber.cs22120.group20.test to org.junit.jupiter.api,org.junit.platform.commons;
exports uk.ac.aber.cs22120.group20.test to org.junit.jupiter;
// exports uk.ac.aber.cs22120.group20.test to junit;
}

View file

@ -1,3 +1,5 @@
package uk.ac.aber.cs22120.group20.test;
import static org.junit.jupiter.api.Assertions.*;
class FlashcardControllerTest {

View file

@ -21,14 +21,14 @@ import static org.junit.jupiter.api.Assertions.assertArrayEquals;
* @See
*/
public class JSONTest {
LinkedList<DictionaryEntry> testList;
static LinkedList<DictionaryEntry> testList;
LinkedList<DictionaryEntry> loadedList;
File testFile;
JsonProcessing processor = new JsonProcessing();
static File testFile;
static JsonProcessing processor = new JsonProcessing();
@BeforeAll
public void setupTest() {
public static void setupTest() {
// Populate a test list with DictionaryEntrys that is to be used for the loading/saving tests.
testList = new LinkedList<>(Arrays.asList(new DictionaryEntry("abbey","abaty","nm"), new DictionaryEntry("about to", "ar fin", "other"),
@ -68,7 +68,7 @@ public class JSONTest {
}
@AfterAll
public void deleteFile() {
public static void deleteFile() {
testFile.delete();
}