From 477e8e9b82d6bcbec006914a22e05a2c18492869 Mon Sep 17 00:00:00 2001 From: Matthias Schiffer Date: Mon, 20 Jun 2011 04:25:14 +0200 Subject: Fix NetworkRoundControl test git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@508 72836036-5685-4462-b002-a69064685172 --- .../jrummikub/control/network/NetworkRoundControlTest.java | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'test/jrummikub') diff --git a/test/jrummikub/control/network/NetworkRoundControlTest.java b/test/jrummikub/control/network/NetworkRoundControlTest.java index b388998..82f4dc7 100644 --- a/test/jrummikub/control/network/NetworkRoundControlTest.java +++ b/test/jrummikub/control/network/NetworkRoundControlTest.java @@ -38,15 +38,18 @@ public class NetworkRoundControlTest { gameSettings.getPlayerList().add(new PlayerSettings("Jannis", Color.GREEN)); gameSettings.getPlayerList().add(new PlayerSettings("Bennet", Color.BLACK)); + gameSettings.getPlayerList().get(1).setType(Type.COMPUTER); + gameSettings.getPlayerList().get(2).setType(Type.NETWORK); + gameSettings.getPlayerList().get(3).setType(Type.COMPUTER); + view = new MockView(); connectionControl = new MockConnectionControl(); } @Test public void testHostRound() { - gameSettings.getPlayerList().get(1).setType(Type.COMPUTER); - gameSettings.getPlayerList().get(2).setType(Type.NETWORK); - gameSettings.getPlayerList().get(3).setType(Type.COMPUTER); + connectionControl.nickname = gameSettings.getPlayerList().get(0).getName(); + testRoundState = new RoundState(gameSettings, null); testRound = new NetworkRoundControl(testRoundState, view, connectionControl, true); @@ -119,9 +122,8 @@ public class NetworkRoundControlTest { @Test public void testClientRound() { - gameSettings.getPlayerList().get(0).setType(Type.NETWORK); - gameSettings.getPlayerList().get(1).setType(Type.COMPUTER); - gameSettings.getPlayerList().get(3).setType(Type.COMPUTER); + connectionControl.nickname = gameSettings.getPlayerList().get(2).getName(); + testRoundState = new RoundState(gameSettings, null); for (int i = 0; i < 4; ++i) { IPlayer player = testRoundState.getNthPlayer(i); -- cgit v1.2.3