diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/org/bukkit/potion/Potion.java | 2 | ||||
-rw-r--r-- | src/test/java/org/bukkit/potion/PotionTest.java | 54 |
2 files changed, 39 insertions, 17 deletions
diff --git a/src/main/java/org/bukkit/potion/Potion.java b/src/main/java/org/bukkit/potion/Potion.java index 35428bd0..36f2f1ad 100644 --- a/src/main/java/org/bukkit/potion/Potion.java +++ b/src/main/java/org/bukkit/potion/Potion.java @@ -448,4 +448,4 @@ public class Potion { public int getNameId() { return name; } -}
\ No newline at end of file +} 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); |