Archiviert
13
0

Update unit test to 1.5.1

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-04-11 22:51:44 +02:00
Ursprung bda4474d62
Commit 8e11a40662
3 geänderte Dateien mit 12 neuen und 3 gelöschten Zeilen

Datei anzeigen

@ -327,6 +327,7 @@ public class DefaultInstances implements InstanceProvider {
try { try {
return (T) constructor.newInstance(params); return (T) constructor.newInstance(params);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace();
// Cannot create it // Cannot create it
return null; return null;
} }

Datei anzeigen

@ -4,8 +4,10 @@ import static org.mockito.Matchers.any;
import static org.mockito.Mockito.mock; import static org.mockito.Mockito.mock;
import static org.mockito.Mockito.when; import static org.mockito.Mockito.when;
import net.minecraft.server.StatisticList;
// Will have to be updated for every version though // Will have to be updated for every version though
import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftItemFactory; import org.bukkit.craftbukkit.inventory.CraftItemFactory;
import org.bukkit.Bukkit; import org.bukkit.Bukkit;
import org.bukkit.Material; import org.bukkit.Material;
@ -34,6 +36,12 @@ public class BukkitInitialization {
initializePackage(); initializePackage();
try {
StatisticList.b();
} catch (Exception e) {
// Swallow
}
// Mock the server object // Mock the server object
Server mockedServer = mock(Server.class); Server mockedServer = mock(Server.class);
ItemFactory mockedFactory = mock(CraftItemFactory.class); ItemFactory mockedFactory = mock(CraftItemFactory.class);
@ -55,6 +63,6 @@ public class BukkitInitialization {
*/ */
public static void initializePackage() { public static void initializePackage() {
// Initialize reflection // Initialize reflection
MinecraftReflection.setMinecraftPackage("net.minecraft.server.v1_4_R1", "org.bukkit.craftbukkit.v1_4_R1"); MinecraftReflection.setMinecraftPackage("net.minecraft.server", "org.bukkit.craftbukkit");
} }
} }

Datei anzeigen

@ -22,7 +22,7 @@ import java.lang.reflect.Array;
import java.util.List; import java.util.List;
// Will have to be updated for every version though // Will have to be updated for every version though
import org.bukkit.craftbukkit.v1_4_R1.inventory.CraftItemFactory; import org.bukkit.craftbukkit.inventory.CraftItemFactory;
import org.bukkit.Material; import org.bukkit.Material;
import org.bukkit.WorldType; import org.bukkit.WorldType;