Add isRecord and new material method tests.

Cleaned up all of the CraftBukkit tests, including moving some tests
from MaterialTest to PerMaterialTest.

By: Wesley Wolfe <weswolf@aol.com>
This commit is contained in:
CraftBukkit/Spigot
2012-12-14 02:02:02 -06:00
parent 5e25b8cbe8
commit 30e0f5be63
8 changed files with 122 additions and 90 deletions

View File

@@ -3,11 +3,11 @@ package org.bukkit.potion;
import static org.junit.Assert.*;
import static org.hamcrest.Matchers.*;
import java.lang.reflect.Field;
import java.util.EnumMap;
import java.util.Map;
import org.bukkit.craftbukkit.potion.CraftPotionBrewer;
import org.bukkit.support.Util;
import org.junit.BeforeClass;
import org.junit.Test;
@@ -36,9 +36,7 @@ public class PotionTest {
@Test
public void testEffectCompleteness() throws SecurityException, IllegalAccessException, NoSuchFieldException {
Field durationsField = net.minecraft.server.PotionBrewer.class.getDeclaredField("effectDurations");
durationsField.setAccessible(true);
Map<Integer, ?> effectDurations = (Map<Integer, ?>) durationsField.get(null);
Map<Integer, ?> effectDurations = Util.getInternalState(net.minecraft.server.PotionBrewer.class, null, "effectDurations");
Map<PotionType, String> effects = new EnumMap(PotionType.class);
for (int id : effectDurations.keySet()) {