Makes snapshot a vanilla version and loads all jars from the jars folder
Some checks failed
KnarCraft/Minecraft-Server-Launcher/pipeline/head There was a failure building this commit
Some checks failed
KnarCraft/Minecraft-Server-Launcher/pipeline/head There was a failure building this commit
This commit is contained in:
@ -0,0 +1,38 @@
|
||||
package net.knarcraft.minecraftserverlauncher.server;
|
||||
|
||||
import net.knarcraft.minecraftserverlauncher.server.servertypes.ServerType;
|
||||
import org.junit.Test;
|
||||
|
||||
import javax.naming.ConfigurationException;
|
||||
|
||||
import java.util.Arrays;
|
||||
|
||||
import static junit.framework.TestCase.assertEquals;
|
||||
|
||||
public class ServerTypeHandlerTest {
|
||||
|
||||
@Test
|
||||
public void getTypeNamesTest() throws ConfigurationException {
|
||||
String[] serverTypeNames = ServerTypeHandler.getTypeNames();
|
||||
|
||||
String[] typeNames = new String[serverTypeNames.length];
|
||||
int index = 0;
|
||||
for (ServerType serverType : ServerTypeHandler.getServerTypes()) {
|
||||
typeNames[index++] = serverType.getName();
|
||||
}
|
||||
assertEquals(Arrays.asList(typeNames), Arrays.asList(serverTypeNames));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void getTypeFromNameTest() throws ConfigurationException {
|
||||
ServerType targetType = null;
|
||||
for (ServerType serverType : ServerTypeHandler.getServerTypes()) {
|
||||
if (serverType.getName().equals("Vanilla")) {
|
||||
targetType = serverType;
|
||||
}
|
||||
}
|
||||
ServerType typeFromName = ServerTypeHandler.getByName("Vanilla");
|
||||
assertEquals(targetType, typeFromName);
|
||||
}
|
||||
|
||||
}
|
Reference in New Issue
Block a user