diff options
author | JJ | 2022-12-27 05:38:32 +0000 |
---|---|---|
committer | JJ | 2022-12-27 15:30:20 +0000 |
commit | c14e53775591cb4d75b486d21f4849552d5c7c8c (patch) | |
tree | fc9d67b66107f4965f3173183ec846e4d8e090c4 /src/test | |
parent | 0e693fd4814572712a4192cb4f176e71f7a344f7 (diff) |
Remove garbage serialization/logging code
Diffstat (limited to 'src/test')
-rw-r--r-- | src/test/persistance/JsonUtilsTest.java | 36 |
1 files changed, 0 insertions, 36 deletions
diff --git a/src/test/persistance/JsonUtilsTest.java b/src/test/persistance/JsonUtilsTest.java deleted file mode 100644 index 9ab9b1c..0000000 --- a/src/test/persistance/JsonUtilsTest.java +++ /dev/null @@ -1,36 +0,0 @@ -package persistance; - -import org.json.JSONArray; -import org.json.JSONObject; -import org.junit.jupiter.api.Test; - -import java.util.ArrayDeque; - -import static org.junit.jupiter.api.Assertions.*; - -public class JsonUtilsTest { - private static final String testPath = "data/test.cache"; - - @Test - void testWritingEmptyFile() { - ArrayDeque<String> test = new ArrayDeque<>(); - JsonUtils.writeToFile(new JSONArray(test), testPath); - - JSONArray dugUp = JsonUtils.readFromFile(testPath); - assertTrue(dugUp.isEmpty()); - } - - @Test - void testWritingLists() { - ArrayDeque<String> test = new ArrayDeque<>(); - test.add("/home/apropos/foo/bar"); // absolute path - test.add("data"); // relative path - test.add("/home/apropos/baz/bar"); // another path - JsonUtils.writeToFile(new JSONArray(test), testPath); - - JSONArray dugUp = JsonUtils.readFromFile(testPath); - for (int i = 0; i < dugUp.length(); i++) { - assertTrue(test.removeFirst().equals(dugUp.get(i))); - } - } -} |