From 1c9d419c27e52347122f2eb43e294a36e0613501 Mon Sep 17 00:00:00 2001 From: Celtic Minstrel Date: Sat, 25 Feb 2012 12:39:10 -0500 Subject: [Bleeding] Add missing methods to Bukkit class, fix non-static methods, and add a junit test to ensure both these problems will be caught in future. --- src/test/java/org/bukkit/BukkitMirrorTest.java | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 src/test/java/org/bukkit/BukkitMirrorTest.java (limited to 'src/test/java/org') diff --git a/src/test/java/org/bukkit/BukkitMirrorTest.java b/src/test/java/org/bukkit/BukkitMirrorTest.java new file mode 100644 index 00000000..5728e429 --- /dev/null +++ b/src/test/java/org/bukkit/BukkitMirrorTest.java @@ -0,0 +1,19 @@ +package org.bukkit; + +import static org.junit.Assert.*; + +import java.lang.reflect.Method; +import java.lang.reflect.Modifier; + +import org.junit.Test; + +public class BukkitMirrorTest { + @Test + public final void test() throws NoSuchMethodException { + Method[] serverMethods = Server.class.getDeclaredMethods(); + for(Method method : serverMethods) { + Method mirrorMethod = Bukkit.class.getDeclaredMethod(method.getName(), method.getParameterTypes()); + assertTrue("Bukkit." + method.getName() + " must be static!", Modifier.isStatic(mirrorMethod.getModifiers())); + } + } +} -- cgit v1.2.3