Archiviert
13
0

Adding a test for checking the fallback methods in MinecraftReflection

Dieser Commit ist enthalten in:
Kristian S. Stangeland 2013-12-04 17:48:51 +01:00
Ursprung 398b1bc3be
Commit 7055cadaef

Datei anzeigen

@ -0,0 +1,29 @@
package com.comphenix.protocol.utility;
import static org.junit.Assert.*;
import net.minecraft.server.v1_7_R1.NBTCompressedStreamTools;
import net.minecraft.util.com.google.common.collect.Maps;
import org.junit.BeforeClass;
import org.junit.Test;
import com.comphenix.protocol.BukkitInitialization;
public class MinecraftReflectionTest {
@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.fromMap(Maps.<String, Class<?>>newHashMap())
);
}
@Test
public void testNbtStreamTools() {
assertEquals(NBTCompressedStreamTools.class, MinecraftReflection.getNbtCompressedStreamToolsClass());
}
}