Would this classify as a test case?

This commit is contained in:
boy0001 2014-11-03 20:08:57 +11:00
parent 9fcab4ba87
commit b47231ca8c
3 changed files with 30 additions and 1 deletions

View File

@ -90,5 +90,10 @@
<scope>system</scope>
<systemPath>${project.basedir}/lib/plotme-0.13f.jar</systemPath>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
</dependency>
</dependencies>
</project>

View File

@ -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);
}
}

View File

@ -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) {