mirror of
https://github.com/michaelrausch/Party-Parrots-At-Sea.git
synced 2026-05-09 06:18:44 +00:00
Finished off chat cucumber test.
#story[1246]
This commit is contained in:
@@ -3,19 +3,19 @@ package steps;
|
|||||||
import cucumber.api.java.en.Given;
|
import cucumber.api.java.en.Given;
|
||||||
import cucumber.api.java.en.Then;
|
import cucumber.api.java.en.Then;
|
||||||
import cucumber.api.java.en.When;
|
import cucumber.api.java.en.When;
|
||||||
import javafx.scene.layout.Pane;
|
import javafx.util.Pair;
|
||||||
import seng302.gameServer.GameStages;
|
import org.junit.Assert;
|
||||||
import seng302.gameServer.GameState;
|
|
||||||
import seng302.gameServer.MainServerThread;
|
import seng302.gameServer.MainServerThread;
|
||||||
|
import seng302.model.stream.packets.StreamPacket;
|
||||||
|
import seng302.utilities.StreamParser;
|
||||||
import seng302.visualiser.ClientToServerThread;
|
import seng302.visualiser.ClientToServerThread;
|
||||||
import seng302.visualiser.GameClient;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Cucumber test for sending chat messages
|
||||||
* Created by kre39 on 7/08/17.
|
* Created by kre39 on 7/08/17.
|
||||||
*/
|
*/
|
||||||
public class SendChatSteps {
|
public class SendChatSteps {
|
||||||
|
|
||||||
private boolean dcSent = false;
|
|
||||||
private ClientToServerThread client;
|
private ClientToServerThread client;
|
||||||
private ClientToServerThread host;
|
private ClientToServerThread host;
|
||||||
private MainServerThread mst;
|
private MainServerThread mst;
|
||||||
@@ -49,7 +49,9 @@ public class SendChatSteps {
|
|||||||
|
|
||||||
@Then("^the other client should receive the message \"([^\"]*)\"$")
|
@Then("^the other client should receive the message \"([^\"]*)\"$")
|
||||||
public void the_other_client_should_receive_the_message(String arg1) throws Throwable {
|
public void the_other_client_should_receive_the_message(String arg1) throws Throwable {
|
||||||
System.out.println("HERE IT IS" + host.getPacketQueue().peek());
|
Object[] packets = host.getPacketQueue().toArray();
|
||||||
|
Pair<Integer, String> message = StreamParser.extractChatterText((StreamPacket) packets[packets.length - 1]);
|
||||||
|
Assert.assertEquals("[time_prefix] <name_prefix> " + arg1, message.getValue());
|
||||||
mst.terminate();
|
mst.terminate();
|
||||||
host.setSocketToClose();
|
host.setSocketToClose();
|
||||||
client.setSocketToClose();
|
client.setSocketToClose();
|
||||||
|
|||||||
@@ -13,6 +13,7 @@ import seng302.model.ServerYacht;
|
|||||||
import seng302.visualiser.ClientToServerThread;
|
import seng302.visualiser.ClientToServerThread;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
* Cucumber test for toggling sail
|
||||||
* Created by kre39 on 7/08/17.
|
* Created by kre39 on 7/08/17.
|
||||||
*/
|
*/
|
||||||
public class ToggleSailSteps {
|
public class ToggleSailSteps {
|
||||||
|
|||||||
Reference in New Issue
Block a user