From 90f6855a155ed6319c0d8592ef945d53b0f56083 Mon Sep 17 00:00:00 2001 From: schrom01 Date: Fri, 29 Apr 2022 16:09:44 +0200 Subject: [PATCH] changed Path Separator --- .../java/ch/zhaw/projekt2/turnierverwaltung/App.java | 2 +- .../ch/zhaw/projekt2/turnierverwaltung/FileIOTest.java | 10 +++++----- 2 files changed, 6 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/App.java b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/App.java index ce8229a..3273b7c 100644 --- a/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/App.java +++ b/app/src/main/java/ch/zhaw/projekt2/turnierverwaltung/App.java @@ -15,6 +15,6 @@ public class App { public static void main(String[] args) { System.out.println(new App().getGreeting()); - FileIO io = new FileIO(System.getProperty("user.dir") + File.separator + "tournierverwaltung_angrynerds"); + FileIO io = new FileIO(System.getProperty("user.dir") + "/tournierverwaltung_angrynerds"); } } diff --git a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FileIOTest.java b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FileIOTest.java index e11bff8..9e6b63d 100644 --- a/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FileIOTest.java +++ b/app/src/test/java/ch/zhaw/projekt2/turnierverwaltung/FileIOTest.java @@ -17,7 +17,7 @@ import static org.junit.jupiter.api.Assertions.*; class FileIOTest { - String RESOURCES_DIR = ".\\src\\test\\resources\\ch\\zhaw\\projekt2\\turnierverwaltung\\"; + String RESOURCES_DIR = "./src/test/resources/ch/zhaw/projekt2/turnierverwaltung/"; String mainDir; String saveDir; FileIO io; @@ -25,7 +25,7 @@ class FileIOTest { @Test void FileIONewDir() throws IOException { mainDir = RESOURCES_DIR + "FileIONew"; - saveDir = mainDir + "\\" + "saves"; + saveDir = mainDir + "/saves"; File mainDirFile = new File(mainDir); File saveDirFile = new File(mainDir); try{ @@ -75,7 +75,7 @@ class FileIOTest { void loadTournament() throws IOException, ClassNotFoundException { mainDir = RESOURCES_DIR + "FileIORead"; io = new FileIO(mainDir); - Tournament tournament = io.loadTournament(new File(mainDir + "\\saves\\test1.txt")); + Tournament tournament = io.loadTournament(new File(mainDir + "/saves/test1.txt")); assertEquals("test1", tournament.getName()); } @@ -88,7 +88,7 @@ class FileIOTest { @Test void loadTournamentEmpty(){ io = new FileIO(mainDir); - assertThrows(IOException.class, () -> io.loadTournament(new File(mainDir + "\\saves\\empty.txt"))); + assertThrows(IOException.class, () -> io.loadTournament(new File(mainDir + "/saves/empty.txt"))); } @Test @@ -110,7 +110,7 @@ class FileIOTest { void saveTournament() { Tournament tournament = new Tournament("test1"); io.saveTournament(tournament); - File file = new File(mainDir + "\\saves\\test1.txt"); + File file = new File(mainDir + "/saves/test1.txt"); if(file.exists()){ file.delete(); } else {