From 10a4ec1c0b59353cdbcaf2f70f27cd2cc2f43aca Mon Sep 17 00:00:00 2001 From: fernferret Date: Fri, 9 Dec 2011 00:39:57 -0700 Subject: [PATCH] Add WorldContainer to tests, they pass again. Yay! --- .../onarandombox/MultiverseCore/test/TestWorldStuff.java | 6 +++--- .../MultiverseCore/test/utils/TestInstanceCreator.java | 2 ++ 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/test/java/com/onarandombox/MultiverseCore/test/TestWorldStuff.java b/src/test/java/com/onarandombox/MultiverseCore/test/TestWorldStuff.java index 31536bba..69297887 100644 --- a/src/test/java/com/onarandombox/MultiverseCore/test/TestWorldStuff.java +++ b/src/test/java/com/onarandombox/MultiverseCore/test/TestWorldStuff.java @@ -39,9 +39,9 @@ import com.onarandombox.MultiverseCore.utils.WorldManager; @PrepareForTest({ PluginManager.class, MultiverseCore.class, Permission.class, Bukkit.class, WorldManager.class }) public class TestWorldStuff { - TestInstanceCreator creator; - Server mockServer; - CommandSender mockCommandSender; + private TestInstanceCreator creator; + private Server mockServer; + private CommandSender mockCommandSender; @Before public void setUp() throws Exception { diff --git a/src/test/java/com/onarandombox/MultiverseCore/test/utils/TestInstanceCreator.java b/src/test/java/com/onarandombox/MultiverseCore/test/utils/TestInstanceCreator.java index 96691765..fa3f63b1 100644 --- a/src/test/java/com/onarandombox/MultiverseCore/test/utils/TestInstanceCreator.java +++ b/src/test/java/com/onarandombox/MultiverseCore/test/utils/TestInstanceCreator.java @@ -44,6 +44,7 @@ public class TestInstanceCreator { public static final File pluginDirectory = new File("bin/test/server/plugins/coretest"); public static final File serverDirectory = new File("bin/test/server"); + public static final File worldsDirectory = new File("bin/test/server"); public boolean setUp() { try { @@ -87,6 +88,7 @@ public class TestInstanceCreator { when(mockServer.getName()).thenReturn("TestBukkit"); Logger.getLogger("Minecraft").setParent(Util.logger); when(mockServer.getLogger()).thenReturn(Util.logger); + when(mockServer.getWorldContainer()).thenReturn(worldsDirectory); // Give the server some worlds when(mockServer.getWorld(anyString())).thenAnswer(new Answer() {