processed some Todo in the Client State, to test unwanted statechanged
This commit is contained in:
@@ -87,11 +87,9 @@ public class ClientStateTest {
|
|||||||
private MoveMessage moveMessage;
|
private MoveMessage moveMessage;
|
||||||
private NoTurnMessage noTurn;
|
private NoTurnMessage noTurn;
|
||||||
private PauseGameMessage interruptMessage;
|
private PauseGameMessage interruptMessage;
|
||||||
|
|
||||||
private PlayCardMessage playCardSwap;
|
private PlayCardMessage playCardSwap;
|
||||||
private PlayCardMessage playCardShield;
|
private PlayCardMessage playCardShield;
|
||||||
private PlayCardMessage playCardTurbo;
|
private PlayCardMessage playCardTurbo;
|
||||||
|
|
||||||
private PossibleCardMessage possibleCard;
|
private PossibleCardMessage possibleCard;
|
||||||
private PossiblePieceMessage possiblePiece;
|
private PossiblePieceMessage possiblePiece;
|
||||||
private RankingResponseMessage rankingResponce;
|
private RankingResponseMessage rankingResponce;
|
||||||
@@ -104,7 +102,6 @@ public class ClientStateTest {
|
|||||||
private UpdateTSKMessage updateTSK;
|
private UpdateTSKMessage updateTSK;
|
||||||
private WaitPieceMessage waitPiece;
|
private WaitPieceMessage waitPiece;
|
||||||
|
|
||||||
|
|
||||||
private int from;
|
private int from;
|
||||||
private String name;
|
private String name;
|
||||||
private Color color;
|
private Color color;
|
||||||
@@ -112,7 +109,6 @@ public class ClientStateTest {
|
|||||||
private BonusCard shieldCard;
|
private BonusCard shieldCard;
|
||||||
private BonusCard turboCard;
|
private BonusCard turboCard;
|
||||||
|
|
||||||
|
|
||||||
@Before
|
@Before
|
||||||
public void setUp() {
|
public void setUp() {
|
||||||
//initialize the game
|
//initialize the game
|
||||||
@@ -166,15 +162,11 @@ public void send(ClientMessage msg) {
|
|||||||
waitPiece = new WaitPieceMessage();
|
waitPiece = new WaitPieceMessage();
|
||||||
interruptMessage = new PauseGameMessage();
|
interruptMessage = new PauseGameMessage();
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//initialize the settings
|
//initialize the settings
|
||||||
mainSettings = settings.getMainSettings();
|
mainSettings = settings.getMainSettings();
|
||||||
videoSettings = settings.getVideoSettings();
|
videoSettings = settings.getVideoSettings();
|
||||||
audioSettings = settings.getAudioSettings();
|
audioSettings = settings.getAudioSettings();
|
||||||
settings = new SettingsState(clientGameLogic);
|
settings = new SettingsState();
|
||||||
|
|
||||||
|
|
||||||
//initialize the states
|
//initialize the states
|
||||||
dialogs = clientGameLogic.getDialogs();
|
dialogs = clientGameLogic.getDialogs();
|
||||||
@@ -234,7 +226,40 @@ public void testDialogsToGame() {
|
|||||||
clientGameLogic.setState(dialogs);
|
clientGameLogic.setState(dialogs);
|
||||||
assertEquals(clientGameLogic.getState(), dialogs);
|
assertEquals(clientGameLogic.getState(), dialogs);
|
||||||
|
|
||||||
//TODO
|
//sends all messages, which don't indicate a statechange
|
||||||
|
clientGameLogic.received(activePlayer);
|
||||||
|
clientGameLogic.received(anyPiece);
|
||||||
|
clientGameLogic.received(briefing);
|
||||||
|
clientGameLogic.received(ceremonyMessage);
|
||||||
|
clientGameLogic.received(die);
|
||||||
|
clientGameLogic.received(diceAgain);
|
||||||
|
clientGameLogic.received(diceNow);
|
||||||
|
clientGameLogic.received(endOfTurn);
|
||||||
|
clientGameLogic.received(lobbyAccept);
|
||||||
|
clientGameLogic.received(lobbyDeny);
|
||||||
|
clientGameLogic.received(lobbyPlayerJoin);
|
||||||
|
clientGameLogic.received(lobbyPlayerLeave);
|
||||||
|
clientGameLogic.received(moveMessage);
|
||||||
|
clientGameLogic.received(noTurn);
|
||||||
|
clientGameLogic.received(interruptMessage);
|
||||||
|
clientGameLogic.received(playCardSwap);
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
clientGameLogic.received(playCardTurbo);
|
||||||
|
clientGameLogic.received(possibleCard);
|
||||||
|
clientGameLogic.received(possiblePiece);
|
||||||
|
clientGameLogic.received(rankingResponce);
|
||||||
|
clientGameLogic.received(rankingRollAgain);
|
||||||
|
clientGameLogic.received(reconnectBriefing);
|
||||||
|
clientGameLogic.received(resumeGame);
|
||||||
|
//clientGameLogic.received(startGame); Todo rightful message
|
||||||
|
clientGameLogic.received(startPieceMessage);
|
||||||
|
clientGameLogic.received(updateReady);
|
||||||
|
clientGameLogic.received(updateTSK);
|
||||||
|
clientGameLogic.received(waitPiece);
|
||||||
|
|
||||||
|
//tests if the client is still in lobby
|
||||||
|
assertEquals(clientGameLogic.getState(), dialogs);
|
||||||
|
assertEquals(dialogs.getState(), lobby);
|
||||||
|
|
||||||
//sends the startGame-Message to the client
|
//sends the startGame-Message to the client
|
||||||
clientGameLogic.received(startGame);
|
clientGameLogic.received(startGame);
|
||||||
@@ -267,7 +292,38 @@ public void testClientGameToCeremony() {
|
|||||||
clientGameLogic.setState(gameState);
|
clientGameLogic.setState(gameState);
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
|
|
||||||
//TODO
|
clientGameLogic.received(activePlayer);
|
||||||
|
clientGameLogic.received(anyPiece);
|
||||||
|
clientGameLogic.received(briefing);
|
||||||
|
//clientGameLogic.received(ceremonyMessage); todo rightful message
|
||||||
|
clientGameLogic.received(die);
|
||||||
|
clientGameLogic.received(diceAgain);
|
||||||
|
clientGameLogic.received(diceNow);
|
||||||
|
clientGameLogic.received(endOfTurn);
|
||||||
|
clientGameLogic.received(lobbyAccept);
|
||||||
|
clientGameLogic.received(lobbyDeny);
|
||||||
|
clientGameLogic.received(lobbyPlayerJoin);
|
||||||
|
clientGameLogic.received(lobbyPlayerLeave);
|
||||||
|
clientGameLogic.received(moveMessage);
|
||||||
|
clientGameLogic.received(noTurn);
|
||||||
|
clientGameLogic.received(interruptMessage);
|
||||||
|
clientGameLogic.received(playCardSwap);
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
clientGameLogic.received(playCardTurbo);
|
||||||
|
clientGameLogic.received(possibleCard);
|
||||||
|
clientGameLogic.received(possiblePiece);
|
||||||
|
clientGameLogic.received(rankingResponce);
|
||||||
|
clientGameLogic.received(rankingRollAgain);
|
||||||
|
clientGameLogic.received(reconnectBriefing);
|
||||||
|
clientGameLogic.received(resumeGame);
|
||||||
|
clientGameLogic.received(startGame);
|
||||||
|
clientGameLogic.received(startPieceMessage);
|
||||||
|
clientGameLogic.received(updateReady);
|
||||||
|
clientGameLogic.received(updateTSK);
|
||||||
|
clientGameLogic.received(waitPiece);
|
||||||
|
|
||||||
|
//tests if the client is still in game-state
|
||||||
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
|
|
||||||
//sends the Ceremony-Message to the client
|
//sends the Ceremony-Message to the client
|
||||||
clientGameLogic.received(ceremonyMessage);
|
clientGameLogic.received(ceremonyMessage);
|
||||||
@@ -288,8 +344,6 @@ public void testClientGameSubStatesToInterrupt() {
|
|||||||
clientGameLogic.setState(gameState);
|
clientGameLogic.setState(gameState);
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
|
|
||||||
//TODO
|
|
||||||
|
|
||||||
//sends the Ceremony-Message to the client
|
//sends the Ceremony-Message to the client
|
||||||
clientGameLogic.received(interruptMessage);
|
clientGameLogic.received(interruptMessage);
|
||||||
|
|
||||||
@@ -321,8 +375,38 @@ public void testStayInInterrupt() {
|
|||||||
clientGameLogic.setState(interrupt);
|
clientGameLogic.setState(interrupt);
|
||||||
assertEquals(clientGameLogic.getState(), interrupt);
|
assertEquals(clientGameLogic.getState(), interrupt);
|
||||||
|
|
||||||
//Todo send all messages except the continue-message
|
//sends all messages, which don't indicate a statechange
|
||||||
|
clientGameLogic.received(activePlayer);
|
||||||
|
clientGameLogic.received(anyPiece);
|
||||||
|
clientGameLogic.received(briefing);
|
||||||
|
clientGameLogic.received(ceremonyMessage);
|
||||||
|
clientGameLogic.received(die);
|
||||||
|
clientGameLogic.received(diceAgain);
|
||||||
|
clientGameLogic.received(diceNow);
|
||||||
|
clientGameLogic.received(endOfTurn);
|
||||||
|
clientGameLogic.received(lobbyAccept);
|
||||||
|
clientGameLogic.received(lobbyDeny);
|
||||||
|
clientGameLogic.received(lobbyPlayerJoin);
|
||||||
|
clientGameLogic.received(lobbyPlayerLeave);
|
||||||
|
clientGameLogic.received(moveMessage);
|
||||||
|
clientGameLogic.received(noTurn);
|
||||||
|
clientGameLogic.received(interruptMessage);
|
||||||
|
clientGameLogic.received(playCardSwap);
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
clientGameLogic.received(playCardTurbo);
|
||||||
|
clientGameLogic.received(possibleCard);
|
||||||
|
clientGameLogic.received(possiblePiece);
|
||||||
|
clientGameLogic.received(rankingResponce);
|
||||||
|
clientGameLogic.received(rankingRollAgain);
|
||||||
|
clientGameLogic.received(reconnectBriefing);
|
||||||
|
//clientGameLogic.received(resumeGame); Todo rightful message
|
||||||
|
clientGameLogic.received(startGame);
|
||||||
|
clientGameLogic.received(startPieceMessage);
|
||||||
|
clientGameLogic.received(updateReady);
|
||||||
|
clientGameLogic.received(updateTSK);
|
||||||
|
clientGameLogic.received(waitPiece);
|
||||||
|
|
||||||
|
//tests if the client is in the interrupt
|
||||||
assertEquals(clientGameLogic.getState(), interrupt);
|
assertEquals(clientGameLogic.getState(), interrupt);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -335,7 +419,8 @@ public void testClientInterruptToGame() {
|
|||||||
clientGameLogic.setState(interrupt);
|
clientGameLogic.setState(interrupt);
|
||||||
assertEquals(clientGameLogic.getState(), interrupt);
|
assertEquals(clientGameLogic.getState(), interrupt);
|
||||||
|
|
||||||
//Todo sends the continue-message
|
//sends the continue message
|
||||||
|
clientGameLogic.received(resumeGame);
|
||||||
|
|
||||||
//tests if the client is in the game
|
//tests if the client is in the game
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -454,7 +539,7 @@ public void testNetworkDialogToNetworkDialog1() {
|
|||||||
dialogs.setState(networkDialog);
|
dialogs.setState(networkDialog);
|
||||||
assertEquals(dialogs.getState(), networkDialog);
|
assertEquals(dialogs.getState(), networkDialog);
|
||||||
|
|
||||||
//todo test receiving all messages and making input
|
//todo test input
|
||||||
|
|
||||||
assertEquals(clientGameLogic.getState(), dialogs);
|
assertEquals(clientGameLogic.getState(), dialogs);
|
||||||
assertEquals(dialogs.getState(), networkDialog);
|
assertEquals(dialogs.getState(), networkDialog);
|
||||||
@@ -535,7 +620,37 @@ public void testStayInLobby() {
|
|||||||
dialogs.setState(lobby);
|
dialogs.setState(lobby);
|
||||||
assertEquals(dialogs.getState(), lobby);
|
assertEquals(dialogs.getState(), lobby);
|
||||||
|
|
||||||
//todo send all messages that dont indicate a change-state
|
|
||||||
|
//sends all messages, which don't indicate a statechange
|
||||||
|
clientGameLogic.received(activePlayer);
|
||||||
|
clientGameLogic.received(anyPiece);
|
||||||
|
clientGameLogic.received(briefing);
|
||||||
|
clientGameLogic.received(ceremonyMessage);
|
||||||
|
clientGameLogic.received(die);
|
||||||
|
clientGameLogic.received(diceAgain);
|
||||||
|
clientGameLogic.received(diceNow);
|
||||||
|
clientGameLogic.received(endOfTurn);
|
||||||
|
clientGameLogic.received(lobbyAccept);//Todo rightful message
|
||||||
|
clientGameLogic.received(lobbyDeny);//Todo rightful message
|
||||||
|
clientGameLogic.received(lobbyPlayerJoin);
|
||||||
|
clientGameLogic.received(lobbyPlayerLeave);
|
||||||
|
clientGameLogic.received(moveMessage);
|
||||||
|
clientGameLogic.received(noTurn);
|
||||||
|
clientGameLogic.received(interruptMessage);
|
||||||
|
clientGameLogic.received(playCardSwap);
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
clientGameLogic.received(playCardTurbo);
|
||||||
|
clientGameLogic.received(possibleCard);
|
||||||
|
clientGameLogic.received(possiblePiece);
|
||||||
|
clientGameLogic.received(rankingResponce);
|
||||||
|
clientGameLogic.received(rankingRollAgain);
|
||||||
|
clientGameLogic.received(reconnectBriefing);
|
||||||
|
clientGameLogic.received(resumeGame);
|
||||||
|
//clientGameLogic.received(startGame); Todo rightful message
|
||||||
|
clientGameLogic.received(startPieceMessage);
|
||||||
|
clientGameLogic.received(updateReady);
|
||||||
|
clientGameLogic.received(updateTSK);
|
||||||
|
clientGameLogic.received(waitPiece);
|
||||||
|
|
||||||
assertEquals(clientGameLogic.getState(), dialogs);
|
assertEquals(clientGameLogic.getState(), dialogs);
|
||||||
assertEquals(dialogs.getState(), lobby);
|
assertEquals(dialogs.getState(), lobby);
|
||||||
@@ -555,7 +670,7 @@ public void testLobbyToRollRankingDice() {
|
|||||||
assertEquals(dialogs.getState(), lobby);
|
assertEquals(dialogs.getState(), lobby);
|
||||||
|
|
||||||
//sends the message to start the game
|
//sends the message to start the game
|
||||||
clientGameLogic.received();//TODO message
|
clientGameLogic.received(startGame);
|
||||||
|
|
||||||
//tests if the clientStateMachine is in the GameState
|
//tests if the clientStateMachine is in the GameState
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -580,7 +695,8 @@ public void testDetermineStartPlayerToWait() {
|
|||||||
gameState.setState(determineStartPlayer);
|
gameState.setState(determineStartPlayer);
|
||||||
assertEquals(gameState.getState(), determineStartPlayer);
|
assertEquals(gameState.getState(), determineStartPlayer);
|
||||||
|
|
||||||
//TODO
|
//sends the message, that indicate a statechange to wait
|
||||||
|
clientGameLogic.received(noTurn);
|
||||||
|
|
||||||
//tests if the client is in the Wait-State
|
//tests if the client is in the Wait-State
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -601,7 +717,7 @@ public void testWaitToAnimation() {
|
|||||||
assertEquals(gameState.getState(), waiting);
|
assertEquals(gameState.getState(), waiting);
|
||||||
|
|
||||||
//sends the moveMessage
|
//sends the moveMessage
|
||||||
clientGameLogic.received(moveMessage); //Todo ??? richtige message
|
clientGameLogic.received(moveMessage);
|
||||||
|
|
||||||
//tests if a piece is moved,that the client goes into Animation
|
//tests if a piece is moved,that the client goes into Animation
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -612,7 +728,7 @@ public void testWaitToAnimation() {
|
|||||||
assertEquals(gameState.getState(), waiting);
|
assertEquals(gameState.getState(), waiting);
|
||||||
|
|
||||||
//sends the playTurboCard-message
|
//sends the playTurboCard-message
|
||||||
clientGameLogic.received(playCardTurbo); //Todo ??? richtige message
|
clientGameLogic.received(playCardTurbo);
|
||||||
|
|
||||||
//tests if a powerCard is played,that the client goes into Animation
|
//tests if a powerCard is played,that the client goes into Animation
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -623,7 +739,18 @@ public void testWaitToAnimation() {
|
|||||||
assertEquals(gameState.getState(), waiting);
|
assertEquals(gameState.getState(), waiting);
|
||||||
|
|
||||||
//sends the playTurboCard-message
|
//sends the playTurboCard-message
|
||||||
clientGameLogic.received(die); //Todo ??? richtige message
|
clientGameLogic.received(die);
|
||||||
|
|
||||||
|
//tests if a die is rolled,that the client goes into Animation
|
||||||
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
|
assertEquals(gameState.getState(), animation);
|
||||||
|
|
||||||
|
//sends the client in WaitState
|
||||||
|
gameState.setState(waiting);
|
||||||
|
assertEquals(gameState.getState(), waiting);
|
||||||
|
|
||||||
|
//sends the activePlayer-message
|
||||||
|
clientGameLogic.received(activePlayer);
|
||||||
|
|
||||||
//tests if a die is rolled,that the client goes into Animation
|
//tests if a die is rolled,that the client goes into Animation
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -672,7 +799,8 @@ public void testWaitToGameEndState() {
|
|||||||
gameState.setState(waiting);
|
gameState.setState(waiting);
|
||||||
assertEquals(gameState.getState(), waiting);
|
assertEquals(gameState.getState(), waiting);
|
||||||
|
|
||||||
//Todo
|
//send the ceremony-Message
|
||||||
|
clientGameLogic.received(ceremonyMessage);
|
||||||
|
|
||||||
//tests if the client is in the ceremony
|
//tests if the client is in the ceremony
|
||||||
assertEquals(clientGameLogic.getState(), ceremony);
|
assertEquals(clientGameLogic.getState(), ceremony);
|
||||||
@@ -716,8 +844,9 @@ public void testSpectatorToGameEndState() {
|
|||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
public void testPowerCardSubStatesToPlayPowerCard() {
|
public void testPowerCardSubStatesToPlayPowerCard() {
|
||||||
//sends the client in th e swap-state
|
/**
|
||||||
|
* sends the client in the swap-state
|
||||||
|
*/
|
||||||
//sends the ClientAutomaton in GameState
|
//sends the ClientAutomaton in GameState
|
||||||
clientGameLogic.setState(gameState);
|
clientGameLogic.setState(gameState);
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -734,17 +863,17 @@ public void testPowerCardSubStatesToPlayPowerCard() {
|
|||||||
powerCard.setState(choosePowerCard);
|
powerCard.setState(choosePowerCard);
|
||||||
assertEquals(powerCard.getState(), swap);
|
assertEquals(powerCard.getState(), swap);
|
||||||
|
|
||||||
//TODO
|
//sends the playCardMessage
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
|
||||||
//tests if the client is in rollDice
|
//tests if the client is in playPowerCard
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
assertEquals(gameState.getState(), turnState);
|
assertEquals(gameState.getState(), turnState);
|
||||||
assertEquals(turnState.getState(), playPowerCard);
|
assertEquals(turnState.getState(), playPowerCard);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* send the client in the shield-state
|
||||||
//send the client in the shield-state
|
*/
|
||||||
|
|
||||||
//sends the ClientAutomaton in GameState
|
//sends the ClientAutomaton in GameState
|
||||||
clientGameLogic.setState(gameState);
|
clientGameLogic.setState(gameState);
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -761,9 +890,10 @@ public void testPowerCardSubStatesToPlayPowerCard() {
|
|||||||
powerCard.setState(choosePowerCard);
|
powerCard.setState(choosePowerCard);
|
||||||
assertEquals(powerCard.getState(), shield);
|
assertEquals(powerCard.getState(), shield);
|
||||||
|
|
||||||
//TODO
|
//sends the playCardMessage
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
|
||||||
//tests if the client is in rollDice
|
//tests if the client is in playPowerCard
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
assertEquals(gameState.getState(), turnState);
|
assertEquals(gameState.getState(), turnState);
|
||||||
assertEquals(turnState.getState(), playPowerCard);
|
assertEquals(turnState.getState(), playPowerCard);
|
||||||
@@ -792,7 +922,8 @@ public void testPowerCardSubStatesToRollDice() {
|
|||||||
powerCard.setState(choosePowerCard);
|
powerCard.setState(choosePowerCard);
|
||||||
assertEquals(powerCard.getState(), choosePowerCard);
|
assertEquals(powerCard.getState(), choosePowerCard);
|
||||||
|
|
||||||
//TODO
|
//sends RollDiceMessage
|
||||||
|
clientGameLogic.received(diceNow);
|
||||||
|
|
||||||
//tests if the client is in rollDice
|
//tests if the client is in rollDice
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -817,7 +948,36 @@ public void testStayInPlayPowerCard() {
|
|||||||
turnState.setState(playPowerCard);
|
turnState.setState(playPowerCard);
|
||||||
assertEquals(turnState.getState(), playPowerCard);
|
assertEquals(turnState.getState(), playPowerCard);
|
||||||
|
|
||||||
//Todo send messages to test to stay in playPowerCard
|
//sends all messages that don't indicate a state-change
|
||||||
|
clientGameLogic.received(activePlayer);
|
||||||
|
clientGameLogic.received(anyPiece);
|
||||||
|
clientGameLogic.received(briefing);
|
||||||
|
clientGameLogic.received(ceremonyMessage);
|
||||||
|
clientGameLogic.received(die); todo rightful message
|
||||||
|
clientGameLogic.received(diceAgain);
|
||||||
|
//clientGameLogic.received(diceNow);
|
||||||
|
clientGameLogic.received(endOfTurn);
|
||||||
|
clientGameLogic.received(lobbyAccept);
|
||||||
|
clientGameLogic.received(lobbyDeny);
|
||||||
|
clientGameLogic.received(lobbyPlayerJoin);
|
||||||
|
clientGameLogic.received(lobbyPlayerLeave);
|
||||||
|
clientGameLogic.received(moveMessage);
|
||||||
|
clientGameLogic.received(noTurn);
|
||||||
|
clientGameLogic.received(interruptMessage);
|
||||||
|
clientGameLogic.received(playCardSwap);
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
clientGameLogic.received(playCardTurbo);
|
||||||
|
clientGameLogic.received(possibleCard);
|
||||||
|
clientGameLogic.received(possiblePiece);
|
||||||
|
clientGameLogic.received(rankingResponce);
|
||||||
|
clientGameLogic.received(rankingRollAgain);
|
||||||
|
clientGameLogic.received(reconnectBriefing);
|
||||||
|
clientGameLogic.received(resumeGame);
|
||||||
|
clientGameLogic.received(startGame);
|
||||||
|
clientGameLogic.received(startPieceMessage);
|
||||||
|
clientGameLogic.received(updateReady);
|
||||||
|
clientGameLogic.received(updateTSK);
|
||||||
|
clientGameLogic.received(waitPiece);
|
||||||
|
|
||||||
//tests if the client is in PlayPowerCard
|
//tests if the client is in PlayPowerCard
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -842,8 +1002,44 @@ public void testPlayPowerCardToRollDice() {
|
|||||||
turnState.setState(playPowerCard);
|
turnState.setState(playPowerCard);
|
||||||
assertEquals(turnState.getState(), playPowerCard);
|
assertEquals(turnState.getState(), playPowerCard);
|
||||||
|
|
||||||
//Todo send messages to test the transition in rollDice
|
//sends all messages that don't indicate a state-change
|
||||||
//Todo test other messages, that there is no state change
|
clientGameLogic.received(activePlayer);
|
||||||
|
clientGameLogic.received(anyPiece);
|
||||||
|
clientGameLogic.received(briefing);
|
||||||
|
clientGameLogic.received(ceremonyMessage);
|
||||||
|
clientGameLogic.received(die);
|
||||||
|
clientGameLogic.received(diceAgain);
|
||||||
|
//clientGameLogic.received(diceNow); todo rightful message
|
||||||
|
clientGameLogic.received(endOfTurn);
|
||||||
|
clientGameLogic.received(lobbyAccept);
|
||||||
|
clientGameLogic.received(lobbyDeny);
|
||||||
|
clientGameLogic.received(lobbyPlayerJoin);
|
||||||
|
clientGameLogic.received(lobbyPlayerLeave);
|
||||||
|
clientGameLogic.received(moveMessage);
|
||||||
|
clientGameLogic.received(noTurn);
|
||||||
|
clientGameLogic.received(interruptMessage);
|
||||||
|
clientGameLogic.received(playCardSwap);
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
clientGameLogic.received(playCardTurbo);
|
||||||
|
clientGameLogic.received(possibleCard);
|
||||||
|
clientGameLogic.received(possiblePiece);
|
||||||
|
clientGameLogic.received(rankingResponce);
|
||||||
|
clientGameLogic.received(rankingRollAgain);
|
||||||
|
clientGameLogic.received(reconnectBriefing);
|
||||||
|
clientGameLogic.received(resumeGame);
|
||||||
|
clientGameLogic.received(startGame);
|
||||||
|
clientGameLogic.received(startPieceMessage);
|
||||||
|
clientGameLogic.received(updateReady);
|
||||||
|
clientGameLogic.received(updateTSK);
|
||||||
|
clientGameLogic.received(waitPiece);
|
||||||
|
|
||||||
|
//tests if the client is in RollDice
|
||||||
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
|
assertEquals(gameState.getState(), turnState);
|
||||||
|
assertEquals(turnState.getState(), playPowerCard);
|
||||||
|
|
||||||
|
//sends the die-message
|
||||||
|
clientGameLogic.received(diceNow);
|
||||||
|
|
||||||
//tests if the client is in RollDice
|
//tests if the client is in RollDice
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -868,7 +1064,36 @@ public void testStayInRollDice() {
|
|||||||
turnState.setState(rollDice);
|
turnState.setState(rollDice);
|
||||||
assertEquals(turnState.getState(), rollDice);
|
assertEquals(turnState.getState(), rollDice);
|
||||||
|
|
||||||
//TODO
|
//sends all messages, that don't indicate a state-change
|
||||||
|
clientGameLogic.received(activePlayer);
|
||||||
|
clientGameLogic.received(anyPiece);
|
||||||
|
clientGameLogic.received(briefing);
|
||||||
|
clientGameLogic.received(ceremonyMessage);
|
||||||
|
//clientGameLogic.received(die);
|
||||||
|
clientGameLogic.received(diceAgain);
|
||||||
|
clientGameLogic.received(diceNow);
|
||||||
|
clientGameLogic.received(endOfTurn);
|
||||||
|
clientGameLogic.received(lobbyAccept);
|
||||||
|
clientGameLogic.received(lobbyDeny);
|
||||||
|
clientGameLogic.received(lobbyPlayerJoin);
|
||||||
|
clientGameLogic.received(lobbyPlayerLeave);
|
||||||
|
clientGameLogic.received(moveMessage);
|
||||||
|
//clientGameLogic.received(noTurn);
|
||||||
|
clientGameLogic.received(interruptMessage);
|
||||||
|
clientGameLogic.received(playCardSwap);
|
||||||
|
clientGameLogic.received(playCardShield);
|
||||||
|
clientGameLogic.received(playCardTurbo);
|
||||||
|
clientGameLogic.received(possibleCard);
|
||||||
|
clientGameLogic.received(possiblePiece);
|
||||||
|
clientGameLogic.received(rankingResponce);
|
||||||
|
clientGameLogic.received(rankingRollAgain);
|
||||||
|
clientGameLogic.received(reconnectBriefing);
|
||||||
|
clientGameLogic.received(resumeGame);
|
||||||
|
clientGameLogic.received(startGame);
|
||||||
|
clientGameLogic.received(startPieceMessage);
|
||||||
|
clientGameLogic.received(updateReady);
|
||||||
|
clientGameLogic.received(updateTSK);
|
||||||
|
clientGameLogic.received(waitPiece);
|
||||||
|
|
||||||
//tests if the client is in RollDice
|
//tests if the client is in RollDice
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
@@ -899,7 +1124,6 @@ public void testRollDiceToChoosePiece() {
|
|||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
assertEquals(gameState.getState(), choosePiece);
|
assertEquals(gameState.getState(), choosePiece);
|
||||||
assertEquals(choosePiece.getState(), noPiece);
|
assertEquals(choosePiece.getState(), noPiece);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -927,7 +1151,7 @@ public void testRollDiceToWait() {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* UC-ClientState-36: Test the transition from ChoosePiece to Wait.
|
* UC-ClientState-36: Test the transition from ChoosePiece to Wait.
|
||||||
*
|
* <p>
|
||||||
* this method tests the transition from noPiece to Wait
|
* this method tests the transition from noPiece to Wait
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@@ -949,12 +1173,11 @@ public void testChoosePieceToWait() {
|
|||||||
//tests if the client is in the wait-state
|
//tests if the client is in the wait-state
|
||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
assertEquals(gameState.getState(), waiting);
|
assertEquals(gameState.getState(), waiting);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* UC-ClientState-37: Test the transition from ChoosePiece to MovePiece.
|
* UC-ClientState-37: Test the transition from ChoosePiece to MovePiece.
|
||||||
*
|
* <p>
|
||||||
* this method tests the transition from noPiece to Wait
|
* this method tests the transition from noPiece to Wait
|
||||||
*/
|
*/
|
||||||
@Test
|
@Test
|
||||||
@@ -977,7 +1200,6 @@ public void testChoosePieceToMovePiece() {
|
|||||||
assertEquals(clientGameLogic.getState(), gameState);
|
assertEquals(clientGameLogic.getState(), gameState);
|
||||||
assertEquals(gameState.getState(), turnState);
|
assertEquals(gameState.getState(), turnState);
|
||||||
assertEquals(turnState.getState(), movePiece);
|
assertEquals(turnState.getState(), movePiece);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -1645,5 +1867,4 @@ public void testAudioSettingsToMainSettings() {
|
|||||||
public void testClientStateSubStatesToMainSettings() {
|
public void testClientStateSubStatesToMainSettings() {
|
||||||
// todo Implementation goes here
|
// todo Implementation goes here
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user