Does some much needed cleanup, adds the Paper server type and fixes broken downloads
Some checks failed
KnarCraft/Minecraft-Server-Launcher/pipeline/head There was a failure building this commit

This commit is contained in:
2020-08-06 19:55:27 +02:00
parent 9ef314b178
commit 26cc5370e2
30 changed files with 1722 additions and 1557 deletions

View File

@ -1,15 +1,17 @@
package net.knarcraft.minecraftserverlauncher;
import net.knarcraft.minecraftserverlauncher.server.ServerType;
import net.knarcraft.minecraftserverlauncher.userinterface.FakeGUI;
import net.knarcraft.minecraftserverlauncher.utility.JarDownloader;
import org.junit.Test;
import javax.naming.ConfigurationException;
import java.io.File;
import java.io.IOException;
public class DownloadTests {
@Test
public void downloadJarsTest() throws ConfigurationException {
ServerType.loadServerTypes();
//Profile.downloadJars();
public void downloadJarsTest() throws IOException {
String targetDirectory = Main.getApplicationWorkDirectory() + File.separator + "files" + File.separator + "testjars" + File.separator;
JarDownloader downloader = new JarDownloader(new FakeGUI(), targetDirectory);
downloader.downloadJars();
}
}

View File

@ -1,20 +1,14 @@
package net.knarcraft.minecraftserverlauncher;
import net.knarcraft.minecraftserverlauncher.profile.Profile;
import net.knarcraft.minecraftserverlauncher.server.ServerType;
import org.junit.Test;
import javax.naming.ConfigurationException;
import java.io.FileNotFoundException;
import static net.knarcraft.minecraftserverlauncher.Shared.stringBetween;
import static net.knarcraft.minecraftserverlauncher.utility.CommonFunctions.stringBetween;
import static org.junit.Assert.assertEquals;
public class Tests {
@Test
public void loadServerVersions() throws ConfigurationException { //Make sure the server versions file has correct syntax
ServerType.loadServerTypes();
}
@Test
public void saveProfile() throws FileNotFoundException { //Make sure we can write profiles to disk

View File

@ -0,0 +1,16 @@
package net.knarcraft.minecraftserverlauncher.userinterface;
public class FakeGUI extends MessageHandler implements GUI {
/***
* Initializes a new fake gui
*/
public FakeGUI() {
super(true);
}
@Override
public void printMessageToGUI(String message) {
System.out.println(message);
}
}