From b47231ca8c5a1ac846c8c7db2b6c2894ce607bd4 Mon Sep 17 00:00:00 2001 From: boy0001 Date: Mon, 3 Nov 2014 20:08:57 +1100 Subject: [PATCH] Would this classify as a test case? --- PlotSquared/pom.xml | 5 +++++ .../src/main/java/PlotTesting/Test1.java | 17 +++++++++++++++++ .../com/intellectualcrafters/plot/PlotMain.java | 9 ++++++++- 3 files changed, 30 insertions(+), 1 deletion(-) create mode 100644 PlotSquared/src/main/java/PlotTesting/Test1.java diff --git a/PlotSquared/pom.xml b/PlotSquared/pom.xml index d529daca8..693e8169f 100644 --- a/PlotSquared/pom.xml +++ b/PlotSquared/pom.xml @@ -90,5 +90,10 @@ system ${project.basedir}/lib/plotme-0.13f.jar + + junit + junit + 4.11 + \ No newline at end of file diff --git a/PlotSquared/src/main/java/PlotTesting/Test1.java b/PlotSquared/src/main/java/PlotTesting/Test1.java new file mode 100644 index 000000000..baa462f0e --- /dev/null +++ b/PlotSquared/src/main/java/PlotTesting/Test1.java @@ -0,0 +1,17 @@ +package PlotTesting; + +import org.junit.Assert; +import org.junit.Test; + +import com.intellectualcrafters.plot.PlotHelper; +import com.intellectualcrafters.plot.PlotMain; + +public class Test1 { + + // I have no idea what I should actually test :p + + @Test + public void testSquare() { + Assert.assertEquals(PlotHelper.square(5), 25); + } +} diff --git a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java index ceaa9f8c0..bf45e615e 100644 --- a/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java +++ b/PlotSquared/src/main/java/com/intellectualcrafters/plot/PlotMain.java @@ -697,7 +697,14 @@ public class PlotMain extends JavaPlugin { } if (getServer().getPluginManager().getPlugin("WorldEdit") != null) { worldEdit = (WorldEditPlugin) getServer().getPluginManager().getPlugin("WorldEdit"); - getServer().getPluginManager().registerEvents(new WorldEditListener(), this); + + String version = worldEdit.getDescription().getVersion(); + if (version!=null && version.startsWith("5")) { + PlotMain.sendConsoleSenderMessage("&cPlease update to WorldEdit 6 for improved stability and additional features:\nhttp://builds.enginehub.org/job/worldedit"); + } + else { + getServer().getPluginManager().registerEvents(new WorldEditListener(), this); + } } if (Settings.WORLDGUARD) { if (getServer().getPluginManager().getPlugin("WorldGuard") != null) {