Fixed tests.

This commit is contained in:
Kusal Ekanayake
2017-09-12 16:52:26 +12:00
parent 9dad88e56a
commit ec7ee34305
4 changed files with 36 additions and 19 deletions
@@ -68,9 +68,11 @@ public class ChatCommandsTest {
} catch (InterruptedException ie) {
ie.printStackTrace();
}
mst.terminate();
host = null;
client = null;
mst = null;
} catch (IOException ioe) {
ioe.printStackTrace();
}
@@ -86,6 +88,11 @@ public class ChatCommandsTest {
new GameState("localhost");
mst = new MainServerThread();
host = null;
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
ie.printStackTrace();
}
try {
host = new ClientToServerThread("localhost", 4942);
} catch (IOException ioe) {
@@ -97,7 +104,7 @@ public class ChatCommandsTest {
ie.printStackTrace();
}
mst.startGame();
host.sendChatterMessage("[time_prefix] <name_prefix> >speed 5.0");
host.sendChatterMessage("[time_prefix] <name_prefix> >speed 5");
try {
Thread.sleep(100);
} catch (InterruptedException ie) {
@@ -106,7 +113,7 @@ public class ChatCommandsTest {
Assert.assertEquals(5.0, GameState.getSpeedMultiplier(), 0.00001);
mst.terminate();
try {
Thread.sleep(2000);
Thread.sleep(200);
} catch (InterruptedException ie) {
ie.printStackTrace();
}