From 45a9e1fbc456c3c4d7d7d1b9a8f6d7f312b0eb71 Mon Sep 17 00:00:00 2001 From: Wertik Date: Sun, 20 Sep 2020 18:12:28 +0200 Subject: [PATCH] Add default test sources. --- pom.xml | 2 +- .../wertik/czechcraftquery/system/test/TestManager.java | 9 +++++++-- src/main/resources/tests/test1.json | 1 + src/main/resources/tests/test2.json | 1 + 4 files changed, 10 insertions(+), 3 deletions(-) create mode 100644 src/main/resources/tests/test1.json create mode 100644 src/main/resources/tests/test2.json diff --git a/pom.xml b/pom.xml index 49b1426..f46d99b 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ space.devport.wertik.czechcraftquery CzechcraftQuery - 2.4.1 + 2.4.2 CzechcraftQuery diff --git a/src/main/java/space/devport/wertik/czechcraftquery/system/test/TestManager.java b/src/main/java/space/devport/wertik/czechcraftquery/system/test/TestManager.java index f6f4a65..5ac9917 100644 --- a/src/main/java/space/devport/wertik/czechcraftquery/system/test/TestManager.java +++ b/src/main/java/space/devport/wertik/czechcraftquery/system/test/TestManager.java @@ -30,8 +30,13 @@ public TestManager(QueryPlugin plugin) { public void load() { File testDirectory = new File(plugin.getDataFolder(), "/tests/"); - // We don't mind. - if (!testDirectory.exists()) return; + // Create defaults. + if (!testDirectory.exists()) { + testDirectory.mkdirs(); + + plugin.saveResource("tests/test1.json", false); + plugin.saveResource("tests/test2.json", false); + } for (File file : testDirectory.listFiles()) { diff --git a/src/main/resources/tests/test1.json b/src/main/resources/tests/test1.json new file mode 100644 index 0000000..b7e3b33 --- /dev/null +++ b/src/main/resources/tests/test1.json @@ -0,0 +1 @@ +{"name":"PvPCraft","slug":"pvpcraft","address":"play.pvpcraft.cz","position":20,"votes":4400} \ No newline at end of file diff --git a/src/main/resources/tests/test2.json b/src/main/resources/tests/test2.json new file mode 100644 index 0000000..f8e20c0 --- /dev/null +++ b/src/main/resources/tests/test2.json @@ -0,0 +1 @@ +{"name":"PvPCraft","slug":"pvpcraft","address":"play.pvpcraft.cz","position":10,"votes":300} \ No newline at end of file