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

This commit is contained in:
2020-08-13 03:04:02 +02:00
parent ab6453cdc3
commit 70d064e590
12 changed files with 210 additions and 67 deletions

View File

@ -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);
}
}