[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.

By: Celtic Minstrel <celtic.minstrel.ca@some.place>
This commit is contained in:
Bukkit/Spigot
2012-02-25 12:39:10 -05:00
parent 716821eebc
commit e1b9154af1
2 changed files with 55 additions and 4 deletions

View File

@@ -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()));
}
}
}