Fix tests, and caught NPE

This commit is contained in:
Eric Stokes 2011-11-26 17:42:58 -07:00
parent 939a2e8b1f
commit 156e7ce373
2 changed files with 4 additions and 1 deletions

View File

@ -64,6 +64,9 @@ public class ImportCommand extends MultiverseCommand {
private String getPotentialWorlds() {
File worldFolder = this.plugin.getServer().getWorldContainer();
if (worldFolder == null) {
return "";
}
File[] files = worldFolder.listFiles();
String worldList = "";
Collection<MultiverseWorld> worlds = this.worldManager.getMVWorlds();

View File

@ -84,7 +84,7 @@ public class TestWorldStuff {
// Import the first world. The world folder does not exist.
plugin.onCommand(mockCommandSender, mockCommand, "", normalArgs);
verify(mockCommandSender).sendMessage(ChatColor.RED + "FAILED.");
verify(mockCommandSender).sendMessage("That world folder does not exist...");
verify(mockCommandSender).sendMessage("That world folder does not exist. These look like worlds to me:");
// We should still have no worlds.
assertEquals(0, creator.getCore().getMVWorldManager().getMVWorlds().size());