From 9cda1d21ad30511c89c051295d20a32b992923a9 Mon Sep 17 00:00:00 2001 From: Thinkofdeath Date: Fri, 24 Jul 2015 00:55:44 +0100 Subject: Fix an issue with the potion test --- src/test/java/org/bukkit/potion/PotionTest.java | 54 +++++++++++++++++-------- 1 file changed, 38 insertions(+), 16 deletions(-) (limited to 'src/test/java') diff --git a/src/test/java/org/bukkit/potion/PotionTest.java b/src/test/java/org/bukkit/potion/PotionTest.java index 58252aeb..9ea901d9 100644 --- a/src/test/java/org/bukkit/potion/PotionTest.java +++ b/src/test/java/org/bukkit/potion/PotionTest.java @@ -6,9 +6,47 @@ import static org.hamcrest.Matchers.is; import org.bukkit.Material; import org.bukkit.entity.LivingEntity; import org.bukkit.inventory.ItemStack; +import org.junit.BeforeClass; import org.junit.Test; public class PotionTest { + + @BeforeClass + public static void setup() { + PotionEffectType.registerPotionEffectType(new PotionEffectType(19){ + @Override + public double getDurationModifier() { + return 1; + } + + @Override + public String getName() { + return "Poison"; + } + + @Override + public boolean isInstant() { + return false; + } + }); + PotionEffectType.registerPotionEffectType(new PotionEffectType(6){ + @Override + public double getDurationModifier() { + return 1; + } + + @Override + public String getName() { + return "Heal"; + } + + @Override + public boolean isInstant() { + return false; + } + }); + } + @Test public void applyToItemStack() { Potion potion = new Potion(PotionType.POISON); @@ -44,22 +82,6 @@ public class PotionTest { @Test public void setExtended() { - PotionEffectType.registerPotionEffectType(new PotionEffectType(19){ - @Override - public double getDurationModifier() { - return 1; - } - - @Override - public String getName() { - return "Poison"; - } - - @Override - public boolean isInstant() { - return false; - } - }); Potion potion = new Potion(PotionType.POISON); assertFalse(potion.hasExtendedDuration()); potion.setHasExtendedDuration(true); -- cgit v1.2.3