Makes the project into a Maven project
Some checks failed
KnarCraft/Minecraft-Server-Launcher/master There was a failure building this commit
Some checks failed
KnarCraft/Minecraft-Server-Launcher/master There was a failure building this commit
Moves stuff around Adds Jenkinsfile Changes some package names Replaces library with Maven dependency
This commit is contained in:
@ -0,0 +1,17 @@
|
||||
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.IOException;
|
||||
|
||||
public class DownloadTests {
|
||||
@Test
|
||||
public void downloadJarsTest() throws IOException, ConfigurationException {
|
||||
// Will currently always fail since knarcraft.net is down.
|
||||
ServerType.loadServerTypes();
|
||||
Profile.downloadJars();
|
||||
}
|
||||
}
|
@ -0,0 +1,36 @@
|
||||
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 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
|
||||
Profile.addProfile("Test");
|
||||
Profile.getCurrent().save();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void stringBetweenTest() { //Make sure stringBetween is not creating exceptions
|
||||
String substring = stringBetween("fish'nchips", "f", "'");
|
||||
assertEquals("ish", substring);
|
||||
substring = stringBetween("something", "whale", "fish");
|
||||
assertEquals("", substring);
|
||||
substring = stringBetween("something", "so", "fish");
|
||||
assertEquals("", substring);
|
||||
substring = stringBetween("something", "asd", "ing");
|
||||
assertEquals("", substring);
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user