From ee53fc0d5f167d8f62e265f0987ae2fe8cbcc85e Mon Sep 17 00:00:00 2001 From: "Kristian S. Stangeland" Date: Tue, 10 Dec 2013 22:57:43 +0100 Subject: [PATCH] Starting to add unit tests for PacketType. --- .../comphenix/protocol/PacketTypeTest.java | 21 +++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100644 ProtocolLib/src/test/java/com/comphenix/protocol/PacketTypeTest.java diff --git a/ProtocolLib/src/test/java/com/comphenix/protocol/PacketTypeTest.java b/ProtocolLib/src/test/java/com/comphenix/protocol/PacketTypeTest.java new file mode 100644 index 00000000..abd501ef --- /dev/null +++ b/ProtocolLib/src/test/java/com/comphenix/protocol/PacketTypeTest.java @@ -0,0 +1,21 @@ +package com.comphenix.protocol; + +import static org.junit.Assert.*; + +import org.junit.BeforeClass; +import org.junit.Test; + +import com.comphenix.protocol.PacketType.Protocol; +import com.comphenix.protocol.PacketType.Sender; + +public class PacketTypeTest { + @BeforeClass + public static void initializeReflection() throws IllegalAccessException { + BukkitInitialization.initializePackage(); + } + + @Test + public void testFindCurrent() { + assertEquals(PacketType.Play.Client.STEER_VEHICLE, PacketType.findCurrent(Protocol.PLAY, Sender.CLIENT, 12)); + } +}