refactored the whole client package structure
This commit is contained in:
@@ -4,10 +4,28 @@
|
||||
import org.junit.Test;
|
||||
import pp.mdga.client.*;
|
||||
import pp.mdga.client.Ceremony;
|
||||
import pp.mdga.client.StartPiece;
|
||||
import pp.mdga.client.ceremonyState.CeremonyStateMachine;
|
||||
import pp.mdga.client.ceremonyState.Podium;
|
||||
import pp.mdga.client.ceremonyState.Statistics;
|
||||
import pp.mdga.client.dialogState.DialogsStateMachine;
|
||||
import pp.mdga.client.dialogState.Lobby;
|
||||
import pp.mdga.client.dialogState.NetworkDialog;
|
||||
import pp.mdga.client.dialogState.StartDialog;
|
||||
import pp.mdga.client.gameState.*;
|
||||
import pp.mdga.client.gameState.turnState.choosePieceState.*;
|
||||
import pp.mdga.client.gameState.determineStartPlayer.DetermineStartPlayerStateMachine;
|
||||
import pp.mdga.client.gameState.turnState.*;
|
||||
import pp.mdga.client.gameState.turnState.powerCardState.ChoosePowerCard;
|
||||
import pp.mdga.client.gameState.turnState.powerCardState.PowerCardStateMachine;
|
||||
import pp.mdga.client.gameState.turnState.powerCardState.Shield;
|
||||
import pp.mdga.client.gameState.turnState.powerCardState.Swap;
|
||||
import pp.mdga.client.Settings;
|
||||
import pp.mdga.client.settingsState.AudioSettings;
|
||||
import pp.mdga.client.settingsState.MainSettings;
|
||||
import pp.mdga.client.settingsState.SettingsStateMachine;
|
||||
import pp.mdga.client.settingsState.VideoSettings;
|
||||
import pp.mdga.game.BonusCard;
|
||||
import pp.mdga.game.Color;
|
||||
import pp.mdga.game.Game;
|
||||
import pp.mdga.message.client.ClientMessage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
@@ -35,7 +53,7 @@ public class ClientStateTest {
|
||||
private DetermineStartPlayerStateMachine determineStartPlayerStateMachine;
|
||||
private Dialogs dialogs;
|
||||
private DialogsStateMachine dialogsStateMachine;
|
||||
private GameState gameState;
|
||||
private Game gameState;
|
||||
private GameStateMachine gameStateMachine;
|
||||
private Interrupt interrupt;
|
||||
private Lobby lobby;
|
||||
@@ -104,12 +122,12 @@ public class ClientStateTest {
|
||||
private BonusCard shieldCard;
|
||||
private BonusCard turboCard;
|
||||
|
||||
private Game game;
|
||||
private pp.mdga.game.Game game;
|
||||
|
||||
@Before
|
||||
public void setUp() {
|
||||
//initialize the game
|
||||
game = new Game();
|
||||
game = new pp.mdga.game.Game();
|
||||
|
||||
//initialize the playerID
|
||||
from=1234;
|
||||
@@ -179,7 +197,7 @@ public void send(ClientMessage msg) {
|
||||
|
||||
//initialize the states
|
||||
dialogs = new Dialogs(clientAutomaton,clientGameLogic);
|
||||
gameState = new GameState(clientAutomaton,clientGameLogic);
|
||||
gameState = new Game(clientAutomaton,clientGameLogic);
|
||||
ceremony = new Ceremony(clientAutomaton,clientGameLogic);
|
||||
interrupt = new Interrupt(clientAutomaton,clientGameLogic,gameState);
|
||||
|
||||
@@ -243,10 +261,10 @@ public void testDialogsToGame() {
|
||||
clientGameLogic.receive(startGame);
|
||||
|
||||
//tests if the client is in the gameState after receiving the message
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//tests if the new State of the GameStateMachine is in DetermineStartPlayer
|
||||
GameState gameState1 = (GameState) clientAutomaton.getState();
|
||||
Game gameState1 = (Game) clientAutomaton.getState();
|
||||
GameStateMachine gameStateMachine1 = gameState1.getGameStateMachine();
|
||||
assertTrue(gameStateMachine1.getState() instanceof DetermineStartPlayer);
|
||||
|
||||
@@ -272,7 +290,7 @@ public void testDialogsToClientStateEndState() {
|
||||
public void testClientGameToCeremony() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the Ceremony-Message to the client
|
||||
clientGameLogic.receive(ceremonyMessage);
|
||||
@@ -295,7 +313,7 @@ public void testClientGameSubStatesToInterrupt() {
|
||||
clientAutomaton.gotoState(gameState);
|
||||
|
||||
//tests if the client is in GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the Ceremony-Message to the client
|
||||
clientGameLogic.receive(interrupt);
|
||||
@@ -338,7 +356,7 @@ public void testClientInterruptToGame() {
|
||||
//Todo sends the continue-message
|
||||
|
||||
//tests if the client is in the game
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -562,10 +580,10 @@ public void testLobbyToRollRankingDice() {
|
||||
clientGameLogic.receive();//TODO message
|
||||
|
||||
//tests if the clientStateMachine is in the GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//tests if the clientStateMachine is in the DetermineStartPlayer
|
||||
GameState gameState1 = (GameState) clientAutomaton.getState();
|
||||
Game gameState1 = (Game) clientAutomaton.getState();
|
||||
GameStateMachine gameStateMachine1 = gameState1.getGameStateMachine();
|
||||
assertTrue(gameStateMachine1.getState() instanceof DetermineStartPlayer);
|
||||
|
||||
@@ -590,7 +608,7 @@ public void testDetermineStartPlayerToWait() {
|
||||
public void testWaitToAnimation() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the client in WaitState
|
||||
gameStateMachine.gotoState(waiting);
|
||||
@@ -598,7 +616,7 @@ public void testWaitToAnimation() {
|
||||
|
||||
//tests if a piece is moved,that the client goes into Animation
|
||||
clientGameLogic.receive(moveMessage); //Todo ??? richtige message
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Animation);
|
||||
|
||||
//sends the client in WaitState
|
||||
@@ -607,7 +625,7 @@ public void testWaitToAnimation() {
|
||||
|
||||
//tests if a powerCard is played,that the client goes into Animation
|
||||
clientGameLogic.receive(playCardTurbo); //Todo ??? richtige message
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Animation);
|
||||
|
||||
//sends the client in WaitState
|
||||
@@ -616,7 +634,7 @@ public void testWaitToAnimation() {
|
||||
|
||||
//tests if a die is rolled,that the client goes into Animation
|
||||
clientGameLogic.receive(dice); //Todo ??? richtige message
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Animation);
|
||||
}
|
||||
|
||||
@@ -627,7 +645,7 @@ public void testWaitToAnimation() {
|
||||
public void testWaitToTurn() {
|
||||
//sends client in gameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Waiting
|
||||
gameStateMachine.gotoState(waiting);
|
||||
@@ -637,7 +655,7 @@ public void testWaitToTurn() {
|
||||
clientGameLogic.receive(activePlayer);
|
||||
|
||||
//tests if the client is in GameState
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//tests if Client is in Turn
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
@@ -714,7 +732,7 @@ public void testPowerCardSubStatesToRollDice() {
|
||||
public void testStayInPlayPowerCard() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -727,7 +745,7 @@ public void testStayInPlayPowerCard() {
|
||||
//Todo send messages to test to stay in playPowerCard
|
||||
|
||||
//tests if the client is in PlayPowerCard
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof PlayPowerCard);
|
||||
}
|
||||
@@ -739,7 +757,7 @@ public void testStayInPlayPowerCard() {
|
||||
public void testPlayPowerCardToRollDice() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -753,7 +771,7 @@ public void testPlayPowerCardToRollDice() {
|
||||
//Todo test other messages, that there is no state change
|
||||
|
||||
//tests if the client is in RollDice
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof RollDice);
|
||||
}
|
||||
@@ -839,7 +857,7 @@ public void testChoosePowerCardToRollDice() {
|
||||
//TODO
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -856,7 +874,7 @@ public void testChoosePowerCardToRollDice() {
|
||||
//todo send the messages, to force a state change to rollDice
|
||||
|
||||
//tests if the turnStateMachine is in RollDice
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof RollDice);
|
||||
}
|
||||
@@ -868,7 +886,7 @@ public void testChoosePowerCardToRollDice() {
|
||||
public void testChoosePowerCardToSwap() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -885,7 +903,7 @@ public void testChoosePowerCardToSwap() {
|
||||
//todo send the messages, to force a state change to swap
|
||||
|
||||
//tests if the client is in Swap
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof PowerCard);
|
||||
assertTrue(powerCardStateMachine.getState() instanceof Swap);
|
||||
@@ -898,7 +916,7 @@ public void testChoosePowerCardToSwap() {
|
||||
public void testChoosePowerCardToShield() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -915,7 +933,7 @@ public void testChoosePowerCardToShield() {
|
||||
//todo send the messages, to force a state change to shield
|
||||
|
||||
//tests if the client is in Shield
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof PowerCard);
|
||||
assertTrue(powerCardStateMachine.getState() instanceof Shield);
|
||||
@@ -928,7 +946,7 @@ public void testChoosePowerCardToShield() {
|
||||
public void testStayInShield() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -945,7 +963,7 @@ public void testStayInShield() {
|
||||
//todo send the messages, which dont force a statechange
|
||||
|
||||
//tests if the client is in PlayPowerCard
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof PowerCard);
|
||||
assertTrue(powerCardStateMachine.getState() instanceof PlayPowerCard);
|
||||
@@ -958,7 +976,7 @@ public void testStayInShield() {
|
||||
public void testShieldToPowerCardEndState() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -976,7 +994,7 @@ public void testShieldToPowerCardEndState() {
|
||||
//todo send the message to force the statechange
|
||||
|
||||
//tests if the client is in PlayPowerCard
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof PlayPowerCard);
|
||||
}
|
||||
@@ -988,7 +1006,7 @@ public void testShieldToPowerCardEndState() {
|
||||
public void testSwapToPowerCardEndState() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1005,7 +1023,7 @@ public void testSwapToPowerCardEndState() {
|
||||
//todo send the message to force the statechange
|
||||
|
||||
//tests if the client is in PlayPowerCard
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof PlayPowerCard);
|
||||
}
|
||||
@@ -1017,7 +1035,7 @@ public void testSwapToPowerCardEndState() {
|
||||
public void testNoPieceInWaitingPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1036,7 +1054,7 @@ public void testNoPieceInWaitingPiece() {
|
||||
//sends to the clientGameLogic the message WaitPiece
|
||||
clientGameLogic.receive(waitPiece);
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof ChoosePiece);
|
||||
assertTrue(choosePieceStateMachine.getState() instanceof WaitingPiece);
|
||||
@@ -1049,7 +1067,7 @@ public void testNoPieceInWaitingPiece() {
|
||||
public void testNoPieceInSelectedPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1068,7 +1086,7 @@ public void testNoPieceInSelectedPiece() {
|
||||
//sends to the clientGameLogic the message SelectPiece
|
||||
clientGameLogic.receive(selectPiece);
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof ChoosePiece);
|
||||
assertTrue(choosePieceStateMachine.getState() instanceof SelectPiece);
|
||||
@@ -1081,7 +1099,7 @@ public void testNoPieceInSelectedPiece() {
|
||||
public void testNoPieceInStartPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1100,7 +1118,7 @@ public void testNoPieceInStartPiece() {
|
||||
//sends to the clientGameLogic the message StartPiece
|
||||
clientGameLogic.receive(startPiece);
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof ChoosePiece);
|
||||
assertTrue(choosePieceStateMachine.getState() instanceof StartPiece);
|
||||
@@ -1113,7 +1131,7 @@ public void testNoPieceInStartPiece() {
|
||||
public void testNoPieceInWait() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1132,7 +1150,7 @@ public void testNoPieceInWait() {
|
||||
//sends to the clientGameLogic the message NoTurn
|
||||
clientGameLogic.receive(noTurn);
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof Waiting);
|
||||
}
|
||||
@@ -1144,7 +1162,7 @@ public void testNoPieceInWait() {
|
||||
public void testStayInWaitingPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1160,7 +1178,7 @@ public void testStayInWaitingPiece() {
|
||||
|
||||
//TODO send all sever-messages except ... to the clientGameLogic to test there are no state change
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof ChoosePiece);
|
||||
assertTrue(choosePieceStateMachine.getState() instanceof WaitingPiece);
|
||||
@@ -1173,7 +1191,7 @@ public void testStayInWaitingPiece() {
|
||||
public void testWaitingPieceInChoosePieceEndState() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1189,7 +1207,7 @@ public void testWaitingPieceInChoosePieceEndState() {
|
||||
|
||||
//Todo send the message to the clientGameLogic to force a state change
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof MovePiece);
|
||||
}
|
||||
@@ -1201,7 +1219,7 @@ public void testWaitingPieceInChoosePieceEndState() {
|
||||
public void testStayInSelectedPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1217,7 +1235,7 @@ public void testStayInSelectedPiece() {
|
||||
|
||||
//Todo send all server messages which dont force a state change here
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof ChoosePiece);
|
||||
assertTrue(choosePieceStateMachine.getState() instanceof SelectPiece);
|
||||
@@ -1230,7 +1248,7 @@ public void testStayInSelectedPiece() {
|
||||
public void testSelectedPieceInChoosePieceEndState() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1246,7 +1264,7 @@ public void testSelectedPieceInChoosePieceEndState() {
|
||||
|
||||
//Todo send the message which force a state change
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof MovePiece);
|
||||
}
|
||||
@@ -1258,7 +1276,7 @@ public void testSelectedPieceInChoosePieceEndState() {
|
||||
public void testStayInStartPiece() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1274,7 +1292,7 @@ public void testStayInStartPiece() {
|
||||
|
||||
//todo send all messages which dont force a state change
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof ChoosePiece);
|
||||
assertTrue(choosePieceStateMachine.getState() instanceof StartPiece);
|
||||
@@ -1287,7 +1305,7 @@ public void testStayInStartPiece() {
|
||||
public void testStartPieceToChoosePieceEndState() {
|
||||
//sends the ClientAutomaton in GameState
|
||||
clientAutomaton.gotoState(gameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
|
||||
//sends the gameStateMachine in the Turn
|
||||
gameStateMachine.gotoState(turn);
|
||||
@@ -1303,7 +1321,7 @@ public void testStartPieceToChoosePieceEndState() {
|
||||
|
||||
//Todo send the message which force a state change
|
||||
|
||||
assertTrue(clientAutomaton.getState() instanceof GameState);
|
||||
assertTrue(clientAutomaton.getState() instanceof Game);
|
||||
assertTrue(gameStateMachine.getState() instanceof Turn);
|
||||
assertTrue(turnStateMachine.getState() instanceof MovePiece);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user