mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 14:28:43 +00:00
Fixed disconnection issues. Fix is only temporary until a consistent interface for disconnections exists.
#bug #implement
This commit is contained in:
@@ -0,0 +1,20 @@
|
||||
package seng302.visualiser.ClientToServerTests;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
import seng302.gameServer.MainServerThread;
|
||||
import seng302.visualiser.ClientToServerThread;
|
||||
|
||||
/**
|
||||
* Created by cir27 on 17/08/17.
|
||||
*/
|
||||
public class DisconnectionTest {
|
||||
@Test
|
||||
public void testServerDisconnection () throws Exception {
|
||||
MainServerThread serverThread = new MainServerThread();
|
||||
ClientToServerThread clientThread = new ClientToServerThread("localhost", 4942);
|
||||
Thread.sleep(1000);
|
||||
clientThread.addDisconnectionListener(message -> Assert.assertTrue(message != null));
|
||||
serverThread.terminate();
|
||||
}
|
||||
}
|
||||
@@ -61,7 +61,7 @@ public class RegularPacketsTest {
|
||||
// SleepThreadMaxDelay();
|
||||
// ServerYacht yacht = new ArrayList<>(GameState.getYachts().values()).get(0);
|
||||
// boolean startState = yacht.getSailIn();
|
||||
// clientThread.sendBoatActionMessage(BoatAction.SAILS_IN);
|
||||
// clientThread.sendBoatAction(BoatAction.SAILS_IN);
|
||||
// SleepThreadMaxDelay();
|
||||
// Assert.assertEquals(startState, !yacht.getSailIn());
|
||||
// }
|
||||
|
||||
Reference in New Issue
Block a user