summaryrefslogtreecommitdiffstats
path: root/mock
diff options
context:
space:
mode:
authorIda Massow <massow@informatik.uni-luebeck.de>2011-06-19 00:28:23 +0200
committerIda Massow <massow@informatik.uni-luebeck.de>2011-06-19 00:28:23 +0200
commitd47e291d19dfc2c3a351c0ba94469e3d50637411 (patch)
treeb54027e861277fdc8205a6b7dc4c44f63dfb3242 /mock
parent80f0c0d43faab53ec30333529d748bdd725a72df (diff)
downloadJRummikub-d47e291d19dfc2c3a351c0ba94469e3d50637411.tar
JRummikub-d47e291d19dfc2c3a351c0ba94469e3d50637411.zip
Tests für NetworkControl
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@473 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'mock')
-rw-r--r--mock/jrummikub/control/network/MockConnectionControl.java12
-rw-r--r--mock/jrummikub/view/MockGameListPanel.java11
-rw-r--r--mock/jrummikub/view/MockSettingsPanel.java4
3 files changed, 15 insertions, 12 deletions
diff --git a/mock/jrummikub/control/network/MockConnectionControl.java b/mock/jrummikub/control/network/MockConnectionControl.java
index 6ecfe75..7d97c78 100644
--- a/mock/jrummikub/control/network/MockConnectionControl.java
+++ b/mock/jrummikub/control/network/MockConnectionControl.java
@@ -39,6 +39,8 @@ public class MockConnectionControl implements IConnectionControl {
public boolean connected;
/** */
public boolean failOnConnect;
+ /** */
+ public GameData joinedGame;
@Override
public String getNickname() {
@@ -112,20 +114,18 @@ public class MockConnectionControl implements IConnectionControl {
@Override
public GameData getCurrentGame() {
- // TODO Auto-generated method stub
- return null;
+ return currentGame;
}
@Override
public void setCurrentGame(GameData game) {
- // TODO Auto-generated method stub
-
+ currentGame = game;
}
@Override
public void joinGame(GameData game) {
- // TODO Auto-generated method stub
-
+ currentGame = game;
+ joinedGame = game;
}
@Override
diff --git a/mock/jrummikub/view/MockGameListPanel.java b/mock/jrummikub/view/MockGameListPanel.java
index d578df3..58af553 100644
--- a/mock/jrummikub/view/MockGameListPanel.java
+++ b/mock/jrummikub/view/MockGameListPanel.java
@@ -1,5 +1,6 @@
package jrummikub.view;
+import java.util.ArrayList;
import java.util.List;
import jrummikub.util.GameData;
@@ -16,6 +17,10 @@ public class MockGameListPanel implements IGameListPanel {
public MockEvent openNewGameEvent = new MockEvent();
/** */
public MockEvent cancelEvent = new MockEvent();
+ /** */
+ public List<GameData> gameList = new ArrayList<GameData>();
+ /** */
+ public String channelName;
@Override
public IEvent getOpenNewGameEvent() {
@@ -34,14 +39,12 @@ public class MockGameListPanel implements IGameListPanel {
@Override
public void setChannelName(String name) {
- // TODO Auto-generated method stub
-
+ channelName = name;
}
@Override
public void setGameList(List<GameData> games) {
- // TODO Auto-generated method stub
-
+ gameList = games;
}
}
diff --git a/mock/jrummikub/view/MockSettingsPanel.java b/mock/jrummikub/view/MockSettingsPanel.java
index 0948d9e..594a3b3 100644
--- a/mock/jrummikub/view/MockSettingsPanel.java
+++ b/mock/jrummikub/view/MockSettingsPanel.java
@@ -77,6 +77,7 @@ public class MockSettingsPanel implements ISettingsPanel {
/** */
public Set<StoneColor> stoneColors;
private MockEvent backEvent = new MockEvent();
+ public SettingsMode settingsMode;
@Override
public IEvent getAddPlayerEvent() {
@@ -216,8 +217,7 @@ public class MockSettingsPanel implements ISettingsPanel {
@Override
public void setSettingsMode(SettingsMode mode) {
- // TODO Auto-generated method stub
-
+ settingsMode = mode;
}
@Override