summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorrmichela <deltahat@gmail.com>2012-03-28 01:41:33 -0400
committerEvilSeph <evilseph@gmail.com>2012-03-28 19:21:57 -0400
commit1dc7eadf800fac39cc1470e5c51ca07b245b8988 (patch)
tree0b90871cca04452e9af527bc3cba7b4877f3cdcc /src/test
parente9064329e60a5076286f078471b9324175f8f9b7 (diff)
downloadbukkit-1dc7eadf800fac39cc1470e5c51ca07b245b8988.tar
bukkit-1dc7eadf800fac39cc1470e5c51ca07b245b8988.tar.gz
bukkit-1dc7eadf800fac39cc1470e5c51ca07b245b8988.tar.lz
bukkit-1dc7eadf800fac39cc1470e5c51ca07b245b8988.tar.xz
bukkit-1dc7eadf800fac39cc1470e5c51ca07b245b8988.zip
[Bleeding] Removing the last metadata item for a key now sets hasMetadata(key) to false. Addresses BUKKIT-1380
Diffstat (limited to 'src/test')
-rw-r--r--src/test/java/org/bukkit/metadata/MetadataStoreTest.java9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/metadata/MetadataStoreTest.java b/src/test/java/org/bukkit/metadata/MetadataStoreTest.java
index f35d5be4..30f03686 100644
--- a/src/test/java/org/bukkit/metadata/MetadataStoreTest.java
+++ b/src/test/java/org/bukkit/metadata/MetadataStoreTest.java
@@ -97,6 +97,15 @@ public class MetadataStoreTest {
}
@Test
+ public void testMetadataRemoveLast() {
+ subject.setMetadata("subject", "key", new FixedMetadataValue(pluginX, 10));
+ subject.removeMetadata("subject", "key", pluginX);
+
+ assertFalse(subject.hasMetadata("subject", "key"));
+ assertEquals(0, subject.getMetadata("subject", "key").size());
+ }
+
+ @Test
public void testMetadataRemoveForNonExistingPlugin() {
subject.setMetadata("subject", "key", new FixedMetadataValue(pluginX, 10));
subject.removeMetadata("subject", "key", pluginY);