mirror of
https://github.com/dmulloy2/ProtocolLib.git
synced 2024-11-05 02:10:14 +01:00
Adding a test for checking the fallback methods in MinecraftReflection
This commit is contained in:
parent
398b1bc3be
commit
7055cadaef
@ -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());
|
||||
}
|
||||
}
|
Loading…
Reference in New Issue
Block a user