Delete ServerTest.java

This commit is contained in:
Kristian Knarvik 2018-01-31 22:32:24 +00:00 committed by GitHub
parent b15177b8aa
commit 322d66e0c7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1,65 +0,0 @@
import javax.naming.ConfigurationException;
import net.knarcraft.serverlauncher.server.*;
import net.knarcraft.serverlauncher.userinterface.GUI;
import net.knarcraft.serverlauncher.userinterface.ServerTab;
import java.awt.*;
import java.io.*;
/**
* A class for testing new and existing features.
*
* @author Kristian Knarvik <kristian.knarvik@knett.no>
* @version 0.0.0.1
* @since 0.0.0.1
*/
class ServerTest {
public static void main(String[] args) {
EventQueue.invokeLater(() -> {
try {
setup();
GUI window = new GUI();
window.getFrame().setVisible(true);
Server server1 = new Server("Server1", window, new ServerTab("Server1"));
server1.toggle();
server1.setPath("C:\\Users\\Kristian\\Desktop\\Test");
server1.setType(ServerType.getServerTypes().get(4));
server1.setServerVersion("1.12.2");
server1.setMaxRam("1G");
Server.startServers();
InputStream stdout = server1.getProcess().getInputStream ();
BufferedReader reader = new BufferedReader (new InputStreamReader(stdout));
OutputStream stdin = server1.getProcess().getOutputStream ();
BufferedWriter writer = new BufferedWriter(new OutputStreamWriter(stdin));
String line;
while ((line = reader.readLine ()) != null) {
System.out.println ("Stdout: " + line);
writer.write("stop\n");
writer.flush();
}
//writer.close();
} catch (Exception e) {
e.printStackTrace();
}
});
}
private static void setup() {
try {
ServerType.loadServerTypes();
} catch (ConfigurationException e) {
e.printStackTrace();
System.exit(1);
}
}
}