git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@609 72836036-5685-4462-b002-a69064685172
This commit is contained in:
Ida Massow 2011-07-06 16:36:06 +02:00
parent 3193477354
commit 51b7fbe822
156 changed files with 22852 additions and 2001 deletions

View file

@ -84,6 +84,7 @@ public class GameControlTest {
assertSame(BottomPanelType.START_TURN_PANEL, view.bottomPanelType);
}
/** */
@Test
public void testNewGame() {
gameControl.getEndOfGameEvent().add(new IListener() {
@ -131,6 +132,7 @@ public class GameControlTest {
assertTrue(gameEnded);
}
/** */
@Test
public void testAborting() {
gameControl.startGame();

View file

@ -14,7 +14,6 @@ import jrummikub.control.SaveControl;
import jrummikub.model.GameSettings;
import jrummikub.model.GameState;
import jrummikub.model.IHand;
import jrummikub.model.MockRoundState;
import jrummikub.model.PlayerSettings;
import jrummikub.model.Position;
import jrummikub.model.RoundState;
@ -22,7 +21,6 @@ import jrummikub.model.Stone;
import jrummikub.model.StoneSet;
import jrummikub.model.Table;
import jrummikub.util.IListener;
import jrummikub.util.Pair;
import jrummikub.view.IView.BottomPanelType;
import jrummikub.view.MockView;
@ -33,12 +31,19 @@ import org.junit.Test;
* Tests for the network game control
*/
public class NetworkGameControlTest {
public NetworkGameControl hostControl, clientControl;
/** */
public NetworkGameControl hostControl;
/** */
public NetworkGameControl clientControl;
/** */
public GameSettings settings;
/** */
public MockView view;
/** */
public MockConnectionControl connection;
/** */
public boolean fired;
/** */
public RoundState roundState;
/** */

View file

@ -22,6 +22,7 @@ import jrummikub.view.MockView;
import org.junit.Before;
import org.junit.Test;
/** */
public class NetworkRoundControlTest {
private MockConnectionControl connectionControl;
private MockView view;
@ -30,6 +31,7 @@ public class NetworkRoundControlTest {
private GameSettings gameSettings;
/** */
@Before
public void setup() {
AIControl.useBackgroundThread = false;
@ -46,6 +48,7 @@ public class NetworkRoundControlTest {
connectionControl = new MockConnectionControl();
}
/** */
@Test
public void testHostRound() {
gameSettings.getPlayerList().get(1).setType(Type.COMPUTER);
@ -140,6 +143,7 @@ public class NetworkRoundControlTest {
assertFalse(connectionControl.turnEnded);
}
/** */
@Test
public void testClientRound() {
gameSettings.getPlayerList().get(0).setType(Type.NETWORK);

View file

@ -23,6 +23,7 @@ import jrummikub.view.MockView;
import org.junit.Before;
import org.junit.Test;
/** */
public class NetworkTurnControlTest {
private MockConnectionControl connectionControl;
private MockView view;
@ -34,6 +35,7 @@ public class NetworkTurnControlTest {
private boolean fired;
/** */
@Before
public void setup() {
gameSettings = new GameSettings();
@ -51,6 +53,7 @@ public class NetworkTurnControlTest {
turnControl = new NetworkTurnControl(connectionControl);
}
/** */
@Test
public void testTableUpdate() {
turnControl.setup(new TurnInfo(roundState, TurnMode.NORMAL_TURN, true),
@ -71,6 +74,7 @@ public class NetworkTurnControlTest {
assertEquals(1, n);
}
/** */
@Test
public void testRedeal() {
turnControl.getRedealEvent().add(new IListener() {

View file

@ -121,6 +121,7 @@ public class AIControlTest {
assertEquals(0, roundState.getActivePlayer().getHand().getSize());
}
/** */
@Test
public void testWithStonesOnTable() {
roundState.getActivePlayer().setLaidOut(true);