mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Build issues caused by vm unable to open socket connections. Leaving as is for now.
#bug
This commit is contained in:
@@ -30,23 +30,23 @@ public class RegularPacketsTest {
|
|||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void packetsSentAtRegularIntervals () throws Exception {
|
public void packetsSentAtRegularIntervals () throws Exception {
|
||||||
// final double TEST_DISTANCE = 10.0;
|
final double TEST_DISTANCE = 10.0;
|
||||||
// serverThread.startGame();
|
serverThread.startGame();
|
||||||
// SleepThreadMaxDelay();
|
SleepThreadMaxDelay();
|
||||||
// Yacht yacht = new ArrayList<>(GameState.getYachts().values()).get(0);
|
Yacht yacht = new ArrayList<>(GameState.getYachts().values()).get(0);
|
||||||
// double startAngle = yacht.getHeading();
|
double startAngle = yacht.getHeading();
|
||||||
// long startTime = System.currentTimeMillis();
|
long startTime = System.currentTimeMillis();
|
||||||
// clientThread.sendBoatAction(BoatAction.UPWIND);
|
clientThread.sendBoatAction(BoatAction.UPWIND);
|
||||||
// Thread.sleep(200);
|
Thread.sleep(200);
|
||||||
// while (Math.abs(yacht.getHeading() - startAngle) < TEST_DISTANCE) {
|
while (Math.abs(yacht.getHeading() - startAngle) < TEST_DISTANCE) {
|
||||||
// Thread.sleep(1);
|
Thread.sleep(1);
|
||||||
// }
|
}
|
||||||
// clientThread.sendBoatAction(BoatAction.MAINTAIN_HEADING);
|
clientThread.sendBoatAction(BoatAction.MAINTAIN_HEADING);
|
||||||
// long endTime = System.currentTimeMillis();
|
long endTime = System.currentTimeMillis();
|
||||||
// SleepThreadMaxDelay();
|
SleepThreadMaxDelay();
|
||||||
// //Allowed to be two loops of delay due to loop delay and processing delay at client + server ends.
|
//Allowed to be two loops of delay due to loop delay and processing delay at client + server ends.
|
||||||
// Assert.assertEquals(TEST_DISTANCE / Yacht.TURN_STEP * ClientToServerThread.PACKET_SENDING_INTERVAL_MS,
|
Assert.assertEquals(TEST_DISTANCE / Yacht.TURN_STEP * ClientToServerThread.PACKET_SENDING_INTERVAL_MS,
|
||||||
// (endTime - startTime), 2 * ClientToServerThread.PACKET_SENDING_INTERVAL_MS);
|
(endTime - startTime), 2 * ClientToServerThread.PACKET_SENDING_INTERVAL_MS);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|||||||
Reference in New Issue
Block a user