Messed aroung with tests, adding back in the ability for craftbukkit.

This commit is contained in:
graywolf336 2015-01-28 00:04:25 -06:00
parent 112895c3e3
commit 9473928d5f
2 changed files with 12 additions and 0 deletions

View File

@ -55,6 +55,14 @@
<type>jar</type>
</dependency>
<dependency>
<groupId>org.bukkit</groupId>
<artifactId>craftbukkit</artifactId>
<version>1.8-R0.1-SNAPSHOT</version>
<type>jar</type>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.sk89q</groupId>
<artifactId>worldedit</artifactId>

View File

@ -28,6 +28,7 @@ import org.bukkit.WorldCreator;
import org.bukkit.WorldType;
import org.bukkit.command.CommandSender;
import org.bukkit.command.ConsoleCommandSender;
import org.bukkit.craftbukkit.v1_8_R1.inventory.CraftItemFactory;
import org.bukkit.entity.Player;
import org.bukkit.permissions.Permission;
import org.bukkit.plugin.Plugin;
@ -42,9 +43,11 @@ import org.mockito.invocation.InvocationOnMock;
import org.mockito.stubbing.Answer;
import org.powermock.api.mockito.PowerMockito;
import org.powermock.core.MockGateway;
import org.powermock.core.classloader.annotations.PrepareForTest;
import com.graywolf336.jail.JailMain;
@PrepareForTest({ CraftItemFactory.class })
public class TestInstanceCreator {
private JailMain main;
private Server mockServer;
@ -71,6 +74,7 @@ public class TestInstanceCreator {
Logger.getLogger("Minecraft").setParent(Util.logger);
when(mockServer.getLogger()).thenReturn(Util.logger);
when(mockServer.getWorldContainer()).thenReturn(worldsDirectory);
when(mockServer.getItemFactory()).thenReturn(CraftItemFactory.instance());
MockWorldFactory.makeNewMockWorld("world", Environment.NORMAL, WorldType.NORMAL);