Add WorldContainer to tests, they pass again. Yay!

This commit is contained in:
fernferret 2011-12-09 00:39:57 -07:00
parent 5159fe7a17
commit 10a4ec1c0b
2 changed files with 5 additions and 3 deletions

View File

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

View File

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