Archiviert
13
0

Properly initialize required internals

Dieser Commit ist enthalten in:
Dan Mulloy 2015-06-16 20:09:46 -04:00
Ursprung f5f3eef988
Commit 6e553bc59d
2 geänderte Dateien mit 15 neuen und 13 gelöschten Zeilen

Datei anzeigen

@ -24,10 +24,20 @@ import org.bukkit.inventory.ItemStack;
import org.junit.AfterClass;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import com.comphenix.protocol.BukkitInitialization;
@RunWith(org.powermock.modules.junit4.PowerMockRunner.class)
@PowerMockIgnore({ "org.apache.log4j.*", "org.apache.logging.*", "org.bukkit.craftbukkit.libs.jline.*" })
public class MinecraftReflectionTest {
@BeforeClass
public static void initializeBukkit() throws IllegalAccessException {
BukkitInitialization.initializeItemMeta();
}
// Mocking objects
private interface FakeEntity {
public Entity getBukkitEntity();
@ -37,17 +47,6 @@ public class MinecraftReflectionTest {
public Block getBukkitEntity();
}
@BeforeClass
public static void initializeReflection() throws IllegalAccessException {
BukkitInitialization.initializePackage();
// Set up a package with no class loader knowledge
MinecraftReflection.minecraftPackage = new CachedPackage(
MinecraftReflection.getMinecraftPackage(),
ClassSource.fromClassLoader()
);
}
@AfterClass
public static void undoMocking() {
// NOP

Datei anzeigen

@ -22,6 +22,8 @@ import org.bukkit.Location;
import org.bukkit.Material;
import org.junit.BeforeClass;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.powermock.core.classloader.annotations.PowerMockIgnore;
import com.comphenix.protocol.BukkitInitialization;
import com.comphenix.protocol.reflect.EquivalentConverter;
@ -30,12 +32,13 @@ import com.comphenix.protocol.utility.MinecraftReflection;
/**
* @author dmulloy2
*/
@RunWith(org.powermock.modules.junit4.PowerMockRunner.class)
@PowerMockIgnore({ "org.apache.log4j.*", "org.apache.logging.*", "org.bukkit.craftbukkit.libs.jline.*" })
public class MultiBlockChangeTest {
@BeforeClass
public static void initializeBukkit() throws IllegalAccessException {
BukkitInitialization.initializePackage();
BukkitInitialization.initializeItemMeta();
}
@Test