diff options
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/bukkit/StructureTypeTest.java | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/src/test/java/org/bukkit/StructureTypeTest.java b/src/test/java/org/bukkit/StructureTypeTest.java new file mode 100644 index 00000000..57f68761 --- /dev/null +++ b/src/test/java/org/bukkit/StructureTypeTest.java @@ -0,0 +1,45 @@ +package org.bukkit; + +import java.util.Map; +import net.minecraft.server.WorldGenFactory; +import org.bukkit.support.AbstractTestingBase; +import org.junit.Assert; +import org.junit.BeforeClass; +import org.junit.Test; + +/** + * This test makes sure that Bukkit always has Minecraft structure types up to + * date. + */ +public class StructureTypeTest extends AbstractTestingBase { + + private static Map<String, StructureType> structures; + + @BeforeClass + public static void setUp() { + structures = StructureType.getStructureTypes(); + } + + @Test + public void testMinecraftToBukkit() { + for (String key : WorldGenFactory.b.keySet()) { // PAIL rename structureStartMap + Assert.assertNotNull(structures.get(key)); + } + } + + @Test + public void testBukkit() { + for (Map.Entry<String, StructureType> entry : structures.entrySet()) { + Assert.assertNotNull(StructureType.getStructureTypes().get(entry.getKey())); + Assert.assertNotNull(StructureType.getStructureTypes().get(entry.getValue().getName())); + } + } + + @Test + public void testBukkitToMinecraft() { + for (Map.Entry<String, StructureType> entry : structures.entrySet()) { + Assert.assertNotNull(WorldGenFactory.b.get(entry.getKey())); + Assert.assertNotNull(WorldGenFactory.b.get(entry.getValue().getName())); + } + } +} |