summaryrefslogtreecommitdiffstats
path: root/test/jrummikub/control
diff options
context:
space:
mode:
authorJannis Harder <harder@informatik.uni-luebeck.de>2011-05-29 19:46:50 +0200
committerJannis Harder <harder@informatik.uni-luebeck.de>2011-05-29 19:46:50 +0200
commit73f6fb9c1b12e70896ee431af326bef0a7235b4f (patch)
tree3333ac2d1c5f0d47f6f9403f8ad2c521d008948a /test/jrummikub/control
parentf62b953c9e66e622087bdcaf873614b07e89c761 (diff)
downloadJRummikub-73f6fb9c1b12e70896ee431af326bef0a7235b4f.tar
JRummikub-73f6fb9c1b12e70896ee431af326bef0a7235b4f.zip
Created interface and abstract base class for turn control
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@307 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test/jrummikub/control')
-rw-r--r--test/jrummikub/control/turn/TurnControlTest.java (renamed from test/jrummikub/control/TurnControlTest.java)22
1 files changed, 12 insertions, 10 deletions
diff --git a/test/jrummikub/control/TurnControlTest.java b/test/jrummikub/control/turn/TurnControlTest.java
index edace0a..150f3e9 100644
--- a/test/jrummikub/control/TurnControlTest.java
+++ b/test/jrummikub/control/turn/TurnControlTest.java
@@ -1,4 +1,4 @@
-package jrummikub.control;
+package jrummikub.control.turn;
import static jrummikub.model.StoneColor.BLACK;
import static jrummikub.model.StoneColor.BLUE;
@@ -16,6 +16,8 @@ import java.util.Iterator;
import java.util.List;
import java.util.Set;
+import jrummikub.control.ITurnTimer;
+import jrummikub.control.turn.HumanTurnControl;
import jrummikub.model.IHand;
import jrummikub.model.ITable;
import jrummikub.model.MockHand;
@@ -35,7 +37,7 @@ import org.junit.Before;
import org.junit.Test;
/**
- * Tests for {@link TurnControl}
+ * Tests for {@link HumanTurnControl}
*/
public class TurnControlTest {
static class AccessibleTable extends Table {
@@ -65,7 +67,7 @@ public class TurnControlTest {
}
- TurnControl testControl;
+ HumanTurnControl testControl;
MockView mockView;
MockTimer mockTimer;
MockTable mockTable;
@@ -103,7 +105,7 @@ public class TurnControlTest {
mockTimer = new MockTimer();
mockTable = new MockTable();
mockHand = new MockHand();
- testControl = new TurnControl(mockHand, mockTable, mockView, mockTimer);
+ testControl = new HumanTurnControl(mockHand, mockTable, mockView, mockTimer);
}
/** */
@@ -126,7 +128,7 @@ public class TurnControlTest {
mockHand.iterable = stones;
- testControl = new TurnControl(mockHand, mockTable, mockView, mockTimer);
+ testControl = new HumanTurnControl(mockHand, mockTable, mockView, mockTimer);
testControl.startTurn();
@@ -619,7 +621,7 @@ public class TurnControlTest {
@Test
public void testAddLeft() {
AccessibleTable table = new AccessibleTable();
- TurnControl turnControl = new TurnControl(mockHand, table, mockView,
+ HumanTurnControl turnControl = new HumanTurnControl(mockHand, table, mockView,
mockTimer);
turnControl.startTurn();
Stone blueOne = new Stone(1, BLUE);
@@ -736,7 +738,7 @@ public class TurnControlTest {
@Test
public void testAddRight() {
AccessibleTable table = new AccessibleTable();
- TurnControl turnControl = new TurnControl(mockHand, table, mockView,
+ HumanTurnControl turnControl = new HumanTurnControl(mockHand, table, mockView,
mockTimer);
turnControl.startTurn();
Stone blueOne = new Stone(1, BLUE);
@@ -853,7 +855,7 @@ public class TurnControlTest {
@Test
public void testAddNewSet() {
AccessibleTable table = new AccessibleTable();
- TurnControl turnControl = new TurnControl(mockHand, table, mockView,
+ HumanTurnControl turnControl = new HumanTurnControl(mockHand, table, mockView,
mockTimer);
turnControl.startTurn();
Stone blueOne = new Stone(1, BLUE);
@@ -976,7 +978,7 @@ public class TurnControlTest {
List<Pair<Stone, Position>> stones = new ArrayList<Pair<Stone, Position>>(
mockHand.stones);
- Collections.sort(stones, new TurnControl.HandStonePositionComparator());
+ Collections.sort(stones, new HumanTurnControl.HandStonePositionComparator());
assertEquals(stones.size(), 13);
@@ -1037,7 +1039,7 @@ public class TurnControlTest {
List<Pair<Stone, Position>> stones = new ArrayList<Pair<Stone, Position>>(
mockHand.stones);
- Collections.sort(stones, new TurnControl.HandStonePositionComparator());
+ Collections.sort(stones, new HumanTurnControl.HandStonePositionComparator());
assertEquals(stones.size(), 13);