summaryrefslogtreecommitdiffstats
path: root/src/test/java/org/bukkit/WorldTypeTest.java
blob: 8d063ca57daad32ce6643681740fc001f30ab5fb (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
package org.bukkit;

import static org.junit.Assert.fail;

import java.util.ArrayList;
import java.util.List;

import net.minecraft.server.WorldType;
import org.junit.Test;

public class WorldTypeTest {
    @Test
    public void testTypes() {
        List<WorldType> missingTypes = new ArrayList<WorldType>();

        for (WorldType type : WorldType.types) {
            if (type == null) continue;

            if (org.bukkit.WorldType.getByName(type.name()) == null) {
                missingTypes.add(type);
            }
        }

        if (!missingTypes.isEmpty()) {
            for (WorldType type : missingTypes) {
                System.out.println(type.name() + " is missing!");
            }
            fail("Missing (" + missingTypes.size() + ") WorldTypes!");
        }
    }
}