summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorMatthias Schiffer <mschiffer@universe-factory.net>2011-06-20 03:59:04 +0200
committerMatthias Schiffer <mschiffer@universe-factory.net>2011-06-20 03:59:04 +0200
commitf3f8ffe4621e91d33732bba9e103ff790a16c7b3 (patch)
treea4663053ea570c7a077a244de9f4f884294208d1 /test
parente79295f271062f2186c2ce0f9b69f1ddfc964abf (diff)
downloadJRummikub-f3f8ffe4621e91d33732bba9e103ff790a16c7b3.tar
JRummikub-f3f8ffe4621e91d33732bba9e103ff790a16c7b3.zip
Added NetworkGameControl
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@503 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test')
-rw-r--r--test/jrummikub/control/RoundControlTest.java10
-rw-r--r--test/jrummikub/control/SaveControlTest.java11
-rw-r--r--test/jrummikub/control/network/GameJoinControlTest.java5
-rw-r--r--test/jrummikub/control/network/GameOfferControlTest.java7
-rw-r--r--test/jrummikub/control/network/NetworkControlTest.java7
-rw-r--r--test/jrummikub/control/network/NetworkRoundControlTest.java4
-rw-r--r--test/jrummikub/control/network/NetworkSettingsControlTest.java7
-rw-r--r--test/jrummikub/model/RoundStateTest.java2
8 files changed, 21 insertions, 32 deletions
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java
index d37a370..4eefe2e 100644
--- a/test/jrummikub/control/RoundControlTest.java
+++ b/test/jrummikub/control/RoundControlTest.java
@@ -51,7 +51,7 @@ public class RoundControlTest {
private boolean roundEnded;
private Score roundScore;
protected boolean roundRestarted;
-
+
Stone blueFour = new Stone(4, BLUE);
Stone blackFour = new Stone(4, BLACK);
Stone redFour = new Stone(4, RED);
@@ -67,15 +67,15 @@ public class RoundControlTest {
Stone blueOne = new Stone(1, BLUE);
Stone blueTwo = new Stone(2, BLUE);
Stone blueThree = new Stone(3, BLUE);
-
+
Stone blueTen = new Stone(10, BLUE);
Stone redTen = new Stone(10, RED);
Stone blueEleven = new Stone(11, BLUE);
-
+
Stone redEight = new Stone(8, RED);
Stone redNine = new Stone(9, RED);
Stone redEleven = new Stone(11, RED);
-
+
Stone blueEight = new Stone(8, BLUE);
Stone blackEight = new Stone(8, BLACK);
Stone orangeEight = new Stone(8, ORANGE);
@@ -105,7 +105,7 @@ public class RoundControlTest {
new PlayerSettings("Matthias", Color.YELLOW));
gameSettings.getPlayerList().add(new PlayerSettings("Jannis", Color.GREEN));
gameSettings.getPlayerList().add(new PlayerSettings("Bennet", Color.BLACK));
- roundState = new RoundState(gameSettings);
+ roundState = new RoundState(gameSettings, null);
roundControl = new RoundControl(roundState, view);
}
diff --git a/test/jrummikub/control/SaveControlTest.java b/test/jrummikub/control/SaveControlTest.java
index 72dba75..66a57cd 100644
--- a/test/jrummikub/control/SaveControlTest.java
+++ b/test/jrummikub/control/SaveControlTest.java
@@ -24,7 +24,7 @@ import org.junit.Test;
public class SaveControlTest {
/**
* @throws IOException
- * if input cannot be saved/loaded
+ * if input cannot be saved/loaded
*/
@Test
public void testSaveLoad() throws IOException {
@@ -33,7 +33,7 @@ public class SaveControlTest {
settings.getPlayerList().add(new PlayerSettings("Ida", Color.PINK));
GameState gameState = new GameState();
- RoundState roundState = new RoundState(settings);
+ RoundState roundState = new RoundState(settings, null);
Stone stone1 = new Stone(1, RED);
Stone stone2 = new Stone(5, RED);
@@ -57,12 +57,11 @@ public class SaveControlTest {
new IListener3<GameSettings, GameState, IRoundState>() {
@Override
- public void handle(GameSettings settings,
- GameState gameState, IRoundState roundState) {
+ public void handle(GameSettings settings, GameState gameState,
+ IRoundState roundState) {
assertEquals(2, settings.getPlayerList().size());
assertEquals(1, roundState.getTable().getSize());
- assertEquals(2, roundState.getActivePlayer().getHand()
- .getSize());
+ assertEquals(2, roundState.getActivePlayer().getHand().getSize());
}
});
diff --git a/test/jrummikub/control/network/GameJoinControlTest.java b/test/jrummikub/control/network/GameJoinControlTest.java
index d2f3f9c..179c583 100644
--- a/test/jrummikub/control/network/GameJoinControlTest.java
+++ b/test/jrummikub/control/network/GameJoinControlTest.java
@@ -1,7 +1,6 @@
package jrummikub.control.network;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.awt.Color;
import java.util.UUID;
@@ -37,7 +36,7 @@ public class GameJoinControlTest {
mockConnection.nickname = "Karl";
view = new MockView();
loginData = new LoginData("Karl", "server", "password", "channel");
- networkControl = new NetworkControl(loginData, mockConnection, view);
+ networkControl = new NetworkControl(loginData, mockConnection, null, view);
networkControl.startNetwork();
mockConnection.connectedEvent.emit();
diff --git a/test/jrummikub/control/network/GameOfferControlTest.java b/test/jrummikub/control/network/GameOfferControlTest.java
index a922967..635ea57 100644
--- a/test/jrummikub/control/network/GameOfferControlTest.java
+++ b/test/jrummikub/control/network/GameOfferControlTest.java
@@ -1,9 +1,6 @@
package jrummikub.control.network;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.awt.Color;
import java.util.UUID;
@@ -36,7 +33,7 @@ public class GameOfferControlTest {
mockConnection.nickname = "Karl";
view = new MockView();
loginData = new LoginData("Karl", "server", "password", "channel");
- networkControl = new NetworkControl(loginData, mockConnection, view);
+ networkControl = new NetworkControl(loginData, mockConnection, null, view);
networkControl.startNetwork();
mockConnection.connectedEvent.emit();
diff --git a/test/jrummikub/control/network/NetworkControlTest.java b/test/jrummikub/control/network/NetworkControlTest.java
index f805c73..2be4da0 100644
--- a/test/jrummikub/control/network/NetworkControlTest.java
+++ b/test/jrummikub/control/network/NetworkControlTest.java
@@ -1,9 +1,6 @@
package jrummikub.control.network;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.awt.Color;
import java.util.UUID;
@@ -38,7 +35,7 @@ public class NetworkControlTest {
mockConnection.nickname = "Karl";
view = new MockView();
loginData = new LoginData("Karl", "server", "password", "channel");
- networkControl = new NetworkControl(loginData, mockConnection, view);
+ networkControl = new NetworkControl(loginData, mockConnection, null, view);
networkControl.startNetwork();
}
diff --git a/test/jrummikub/control/network/NetworkRoundControlTest.java b/test/jrummikub/control/network/NetworkRoundControlTest.java
index d13287b..b388998 100644
--- a/test/jrummikub/control/network/NetworkRoundControlTest.java
+++ b/test/jrummikub/control/network/NetworkRoundControlTest.java
@@ -47,7 +47,7 @@ public class NetworkRoundControlTest {
gameSettings.getPlayerList().get(1).setType(Type.COMPUTER);
gameSettings.getPlayerList().get(2).setType(Type.NETWORK);
gameSettings.getPlayerList().get(3).setType(Type.COMPUTER);
- testRoundState = new RoundState(gameSettings);
+ testRoundState = new RoundState(gameSettings, null);
testRound = new NetworkRoundControl(testRoundState, view,
connectionControl, true);
@@ -122,7 +122,7 @@ public class NetworkRoundControlTest {
gameSettings.getPlayerList().get(0).setType(Type.NETWORK);
gameSettings.getPlayerList().get(1).setType(Type.COMPUTER);
gameSettings.getPlayerList().get(3).setType(Type.COMPUTER);
- testRoundState = new RoundState(gameSettings);
+ testRoundState = new RoundState(gameSettings, null);
for (int i = 0; i < 4; ++i) {
IPlayer player = testRoundState.getNthPlayer(i);
diff --git a/test/jrummikub/control/network/NetworkSettingsControlTest.java b/test/jrummikub/control/network/NetworkSettingsControlTest.java
index c8bb7af..bacbd6a 100644
--- a/test/jrummikub/control/network/NetworkSettingsControlTest.java
+++ b/test/jrummikub/control/network/NetworkSettingsControlTest.java
@@ -1,9 +1,6 @@
package jrummikub.control.network;
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertFalse;
-import static org.junit.Assert.assertSame;
-import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.*;
import java.util.UUID;
@@ -35,7 +32,7 @@ public class NetworkSettingsControlTest {
mockConnection.nickname = "Karl";
view = new MockView();
loginData = new LoginData("Karl", "server", "password", "channel");
- networkControl = new NetworkControl(loginData, mockConnection, view);
+ networkControl = new NetworkControl(loginData, mockConnection, null, view);
networkControl.startNetwork();
mockConnection.connectedEvent.emit();
diff --git a/test/jrummikub/model/RoundStateTest.java b/test/jrummikub/model/RoundStateTest.java
index bfbe857..515161b 100644
--- a/test/jrummikub/model/RoundStateTest.java
+++ b/test/jrummikub/model/RoundStateTest.java
@@ -21,7 +21,7 @@ public class RoundStateTest {
settings.getPlayerList().add(new PlayerSettings("Player 2", Color.YELLOW));
settings.getPlayerList().add(new PlayerSettings("Player 3", Color.BLUE));
- testRound = new RoundState(settings);
+ testRound = new RoundState(settings, null);
}
/** */