Skip to content

Commit

Permalink
Add default test sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
Wertik committed Sep 20, 2020
1 parent a7fef6f commit 45a9e1f
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>space.devport.wertik.czechcraftquery</groupId>
<artifactId>CzechcraftQuery</artifactId>
<version>2.4.1</version>
<version>2.4.2</version>

<name>CzechcraftQuery</name>

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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()) {

Expand Down
1 change: 1 addition & 0 deletions src/main/resources/tests/test1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"PvPCraft","slug":"pvpcraft","address":"play.pvpcraft.cz","position":20,"votes":4400}
1 change: 1 addition & 0 deletions src/main/resources/tests/test2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
{"name":"PvPCraft","slug":"pvpcraft","address":"play.pvpcraft.cz","position":10,"votes":300}

0 comments on commit 45a9e1f

Please sign in to comment.