mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Working cucumber tests for sails toggle.
When sails in will send a sails out message when sails out will send a sails in message and then checks for the new status of the sail #story[1111]
This commit is contained in:
@@ -585,7 +585,7 @@ public class Yacht {
|
|||||||
this.velocity = velocity;
|
this.velocity = velocity;
|
||||||
updateVelocityProperty(velocity);
|
updateVelocityProperty(velocity);
|
||||||
for (YachtLocationListener yll : locationListeners) {
|
for (YachtLocationListener yll : locationListeners) {
|
||||||
yll.notifyLocation(this, lat, lng, heading, velocity);
|
yll.notifyLocation(this, lat, lng, heading, velocity, clientSailsIn);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -34,8 +34,12 @@ public class ToggleSailSteps {
|
|||||||
mst = new MainServerThread();
|
mst = new MainServerThread();
|
||||||
client = new ClientToServerThread("localhost", 4942);
|
client = new ClientToServerThread("localhost", 4942);
|
||||||
GameState.setCurrentStage(GameStages.RACING);
|
GameState.setCurrentStage(GameStages.RACING);
|
||||||
|
Thread.sleep(200); // Sleep needed to help the threads all be up to speed with each other
|
||||||
|
Yacht yacht = (new ArrayList<>(GameState.getYachts().values())).get(0);
|
||||||
|
Assert.assertFalse(yacht.getSailIn());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@When("^the user has pressed \"([^\"]*)\"$")
|
@When("^the user has pressed \"([^\"]*)\"$")
|
||||||
public void the_user_has_pressed(String arg1) throws Throwable {
|
public void the_user_has_pressed(String arg1) throws Throwable {
|
||||||
startTime = System.currentTimeMillis();
|
startTime = System.currentTimeMillis();
|
||||||
@@ -50,7 +54,12 @@ public class ToggleSailSteps {
|
|||||||
|
|
||||||
@Then("^the sails are \"([^\"]*)\"$")
|
@Then("^the sails are \"([^\"]*)\"$")
|
||||||
public void the_sails_are(String arg1) throws Throwable {
|
public void the_sails_are(String arg1) throws Throwable {
|
||||||
//Yacht yacht = (new ArrayList<>(GameState.getYachts().values())).get(0);
|
Thread.sleep(200); // Sleep needed to help the threads all be up to speed with each other
|
||||||
//Assert.assertTrue(yacht.getSailIn());
|
Yacht yacht = (new ArrayList<>(GameState.getYachts().values())).get(0);
|
||||||
|
if (arg1 == "in") {
|
||||||
|
Assert.assertTrue(yacht.getSailIn());
|
||||||
|
} else {
|
||||||
|
Assert.assertFalse(yacht.getSailIn());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user