merge tests into development #25
@@ -15,6 +15,7 @@
|
||||
import pp.mdga.game.BonusCard;
|
||||
import pp.mdga.game.Color;
|
||||
import pp.mdga.message.client.ClientMessage;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
import static org.junit.Assert.*;
|
||||
@@ -1313,7 +1314,7 @@ public void testPowerCardSubStatesToPlayPowerCard() {
|
||||
|
||||
/**
|
||||
* UC-ClientState-30: Test the transition from PowerCard sub-states to RollDice.
|
||||
*
|
||||
* <p>
|
||||
* tests the transition from ChoosePowerCard from PowerCard to RollDice
|
||||
*/
|
||||
@Test
|
||||
@@ -1572,7 +1573,7 @@ public void testRollDiceToWait() {
|
||||
|
||||
/**
|
||||
* UC-ClientState-36: Test the transition from ChoosePiece to Wait.
|
||||
*
|
||||
* <p>
|
||||
* this method tests the transition from noPiece to Wait
|
||||
*/
|
||||
@Test
|
||||
@@ -1815,7 +1816,6 @@ public void testStayInChoosePowerCard() {
|
||||
clientGameLogic.received(waitPiece);
|
||||
clientGameLogic.received(spectatorMessage);
|
||||
clientGameLogic.received(selectPieceMessage);
|
||||
//TODO selectable pieces
|
||||
|
||||
//tests if the client is still in the choosePowerCard-State
|
||||
assertEquals(clientGameLogic.getState(), gameState);
|
||||
@@ -2066,7 +2066,8 @@ public void testSwapToPowerCardEndState() {
|
||||
powerCard.setState(swap);
|
||||
assertEquals(powerCard.getState(), swap);
|
||||
|
||||
//todo send the message to force the statechange
|
||||
//sends the playCardMessage
|
||||
clientGameLogic.received(playCardSwap);
|
||||
|
||||
//tests if the client is in PlayPowerCard
|
||||
assertEquals(clientGameLogic.getState(), gameState);
|
||||
|
||||
@@ -46,9 +46,9 @@ public class ServerStateTest {
|
||||
private SelectTSKMessage selectTSK;
|
||||
private DisconnectedMessage disconnect;
|
||||
|
||||
//declare state-machines here
|
||||
//declare state-States here
|
||||
|
||||
//TODO: interrupt and lobby are no state-machines
|
||||
//TODO: interrupt and lobby are no state-States
|
||||
|
||||
//declare states here
|
||||
//TODO
|
||||
@@ -79,13 +79,13 @@ public class ServerStateTest {
|
||||
private RollDiceState rollDiceState;
|
||||
private SecondRollState secondRoll;
|
||||
private SelectPieceState selectPiece;
|
||||
private StartPieceState startPiece;
|
||||
private StartPieceState startPieceState;
|
||||
private ThirdRollState thirdRoll;
|
||||
private TurnState turnState;
|
||||
private WaitingPieceState waitingPiece;
|
||||
|
||||
/**
|
||||
* TODO initialize the states and machines and messages here
|
||||
* this method is used to initialize the attributes of this test-class
|
||||
*/
|
||||
@Before
|
||||
public void setUp() {
|
||||
@@ -124,7 +124,7 @@ public void broadcast(ServerMessage message) {
|
||||
from = 1234;
|
||||
fromHost = 2345;
|
||||
|
||||
//initialize the state-machines here
|
||||
//initialize the states here
|
||||
thirdRoll = rollDiceState.getThirdRollState();
|
||||
secondRoll = rollDiceState.getSecondRollState();
|
||||
firstRollState = rollDiceState.getThirdRollState();
|
||||
@@ -132,7 +132,7 @@ public void broadcast(ServerMessage message) {
|
||||
noPiece = choosePieceState.getNoPieceState();
|
||||
noTurnState = choosePieceState.getNoTurnState();
|
||||
waitingPiece = choosePieceState.getWaitingPieceState();
|
||||
startPiece = choosePieceState.getStartPieceState();
|
||||
startPieceState = choosePieceState.getStartPieceState();
|
||||
selectPiece =choosePieceState.getSelectPieceState();
|
||||
|
||||
powerCardState = turnState.getPowerCardState();
|
||||
@@ -257,6 +257,9 @@ public void testInterruptToGameContinue() {
|
||||
|
||||
//Todo send all other messages except forceContinue
|
||||
|
||||
//tests if the server is still in Interrupt
|
||||
assertEquals(serverGameLogic.getCurrentState(),interruptState);
|
||||
|
||||
//sends the continue-message to the server
|
||||
serverGameLogic.received(forceContinueGame, from);
|
||||
|
||||
@@ -273,7 +276,7 @@ public void testInterruptToGameReconnect() {
|
||||
serverGameLogic.setCurrentState(interruptState);
|
||||
assertEquals(serverGameLogic.getCurrentState() ,interruptState);
|
||||
|
||||
//todo implement the timer
|
||||
//todo implement the reconnect
|
||||
|
||||
//tests if new Stet is in GameState
|
||||
assertEquals(serverGameLogic.getCurrentState() ,gameState);
|
||||
@@ -598,7 +601,7 @@ public void testMovePieceToFirstRoll() {
|
||||
assertEquals(serverGameLogic.getCurrentState() ,gameState);
|
||||
assertEquals(gameState.getCurrentState() ,turnState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
assertEquals(rollDiceState.getCurrentState() ,firstRollStateState);
|
||||
assertEquals(rollDiceState.getCurrentState() ,firstRollState);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -619,9 +622,9 @@ public void testFirstRollToRollDiceEndState() {
|
||||
turnState.setCurrentState(rollDiceState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
|
||||
//sends the RollDiceMachine in FirstRoll
|
||||
rollDiceMachine.setCurrentState(firstRollState);
|
||||
assertEquals(rollDiceMachine.getCurrentState() ,firstRollStateState);
|
||||
//sends the RollDiceState in FirstRoll
|
||||
rollDiceState.setCurrentState(firstRollState);
|
||||
assertEquals(rollDiceState.getCurrentState() ,firstRollState);
|
||||
|
||||
//TODO 2 Möglichkeiten
|
||||
|
||||
@@ -650,9 +653,9 @@ public void testFirstRollToSecondRoll() {
|
||||
turnState.setCurrentState(rollDiceState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
|
||||
//sends the RollDiceMachine in FirstRoll
|
||||
rollDiceMachine.setCurrentState(firstRollState);
|
||||
assertEquals(rollDiceMachine.getCurrentState() ,firstRollStateState);
|
||||
//sends the RollDiceState in FirstRoll
|
||||
rollDiceState.setCurrentState(firstRollState);
|
||||
assertEquals(rollDiceState.getCurrentState() ,firstRollState);
|
||||
|
||||
//Todo player has no figures to move and had no 6
|
||||
|
||||
@@ -660,7 +663,7 @@ public void testFirstRollToSecondRoll() {
|
||||
assertEquals(serverGameLogic.getCurrentState() ,gameState);
|
||||
assertEquals(gameState.getCurrentState() ,turnState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
assertEquals(rollDiceMachine.getCurrentState() ,secondRollState);
|
||||
assertEquals(rollDiceState.getCurrentState() ,secondRollState);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -681,9 +684,9 @@ public void testSecondRollToRollDiceEndState() {
|
||||
turnState.setCurrentState(rollDiceState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
|
||||
//sends the RollDiceMachine in SecondRoll
|
||||
rollDiceMachine.setCurrentState(secondRoll);
|
||||
assertEquals(rollDiceMachine.getCurrentState() ,secondRollState);
|
||||
//sends the RollDiceState in SecondRoll
|
||||
rollDiceState.setCurrentState(secondRoll);
|
||||
assertEquals(rollDiceState.getCurrentState() ,secondRollState);
|
||||
|
||||
//Todo
|
||||
|
||||
@@ -712,9 +715,9 @@ public void testSecondRollToThirdRoll() {
|
||||
turnState.setCurrentState(rollDiceState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
|
||||
//sends the RollDiceMachine in SecondRoll
|
||||
rollDiceMachine.setCurrentState(secondRoll);
|
||||
assertEquals(rollDiceMachine.getCurrentState() ,secondRollState);
|
||||
//sends the RollDiceState in SecondRoll
|
||||
rollDiceState.setCurrentState(secondRoll);
|
||||
assertEquals(rollDiceState.getCurrentState() ,secondRollState);
|
||||
|
||||
//Todo player has no figures to move and had no 6
|
||||
|
||||
@@ -722,7 +725,7 @@ public void testSecondRollToThirdRoll() {
|
||||
assertEquals(serverGameLogic.getCurrentState() ,gameState);
|
||||
assertEquals(gameState.getCurrentState() ,turnState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
assertEquals(rollDiceMachine.getCurrentState() ,thirdRollState);
|
||||
assertEquals(rollDiceState.getCurrentState() ,thirdRollState);
|
||||
}
|
||||
|
||||
/**
|
||||
@@ -743,9 +746,9 @@ public void testThirdRollToRollDiceEndState() {
|
||||
turnState.setCurrentState(rollDiceState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
|
||||
//sends the RollDiceMachine in ThirdRoll
|
||||
rollDiceMachine.setCurrentState(thirdRoll);
|
||||
assertEquals(rollDiceMachine.getCurrentState() ,thirdRollState);
|
||||
//sends the RollDiceState in ThirdRoll
|
||||
rollDiceState.setCurrentState(thirdRoll);
|
||||
assertEquals(rollDiceState.getCurrentState() ,thirdRollState);
|
||||
|
||||
//Todo
|
||||
|
||||
@@ -774,9 +777,9 @@ public void testThirdRollToTurnEndState() {
|
||||
turnState.setCurrentState(rollDiceState);
|
||||
assertEquals(turnState.getCurrentState() ,rollDiceState);
|
||||
|
||||
//sends the RollDiceMachine in ThirdRoll
|
||||
rollDiceMachine.setCurrentState(thirdRoll);
|
||||
assertEquals(rollDiceMachine.getCurrentState() ,thirdRollState);
|
||||
//sends the RollDiceState in ThirdRoll
|
||||
rollDiceState.setCurrentState(thirdRoll);
|
||||
assertEquals(rollDiceState.getCurrentState() ,thirdRollState);
|
||||
|
||||
//Todo
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user