diff options
author | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-06-22 01:54:00 +0200 |
---|---|---|
committer | Ida Massow <massow@informatik.uni-luebeck.de> | 2011-06-22 01:54:00 +0200 |
commit | ea8a675cee038eba98de3eefc0f7f0d0290392d7 (patch) | |
tree | 5c1a65e52a0e1f4b9854c4fb51a75b38f95793fc /test/jrummikub/control/RoundControlTest.java | |
parent | 61a5d322ba22615a18198b5b0b663fca5b04bf5a (diff) | |
download | JRummikub-ea8a675cee038eba98de3eefc0f7f0d0290392d7.tar JRummikub-ea8a675cee038eba98de3eefc0f7f0d0290392d7.zip |
Fix some warnings in tests
git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@567 72836036-5685-4462-b002-a69064685172
Diffstat (limited to 'test/jrummikub/control/RoundControlTest.java')
-rw-r--r-- | test/jrummikub/control/RoundControlTest.java | 42 |
1 files changed, 16 insertions, 26 deletions
diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java index a6279ba..6b4cb23 100644 --- a/test/jrummikub/control/RoundControlTest.java +++ b/test/jrummikub/control/RoundControlTest.java @@ -6,6 +6,7 @@ import static org.junit.Assert.*; import java.awt.Color; import java.util.Arrays; import java.util.Iterator; +import java.util.List; import jrummikub.control.turn.TurnMode; import jrummikub.model.GameSettings; @@ -223,12 +224,8 @@ public class RoundControlTest { } IHand hand = roundState.getActivePlayer().getHand(); - hand.drop(blueOne, new Position(0, 0)); - hand.drop(blueTwo, new Position(0, 0)); - hand.drop(blueThree, new Position(0, 0)); - hand.drop(blueTen, new Position(0, 0)); - hand.drop(redTen, new Position(0, 0)); - hand.drop(blueEleven, new Position(0, 0)); + dropStonesOnHand(hand, Arrays.asList(blueOne, blueTwo, blueThree, + blueTen, redTen, blueEleven)); view.startTurnEvent.emit(); view.handPanel.stoneClickEvent.emit(blueOne, false); @@ -255,6 +252,12 @@ public class RoundControlTest { .getSize()); } + private void dropStonesOnHand(IHand hand, List<Stone> stones) { + for (int i = 0; i < stones.size(); i++) { + hand.drop(stones.get(i), new Position(0, 0)); + } + } + /** Threshold=30 */ @Test public void laidOutTooFewChangedTable() { @@ -265,14 +268,8 @@ public class RoundControlTest { } // Fake Turn to put stones on the table IHand hand = roundState.getActivePlayer().getHand(); - hand.drop(blueOne, new Position(0, 0)); - hand.drop(blueTwo, new Position(0, 0)); - hand.drop(blueThree, new Position(0, 0)); - - hand.drop(redSeven, new Position(0, 0)); - hand.drop(blueSeven, new Position(0, 0)); - hand.drop(blackSeven, new Position(0, 0)); - hand.drop(orangeSeven, new Position(0, 0)); + dropStonesOnHand(hand, Arrays.asList(blueOne, blueTwo, blueThree, + blueSeven, redSeven, blackSeven, orangeSeven)); view.startTurnEvent.emit(); view.handPanel.stoneClickEvent.emit(redSeven, false); @@ -292,6 +289,7 @@ public class RoundControlTest { assertEquals(2, roundState.getTable().getSize()); hand = roundState.getActivePlayer().getHand(); + dropStonesOnHand(hand, Arrays.asList(redEight, redNine, redTen)); hand.drop(redEight, new Position(0, 0)); hand.drop(redNine, new Position(0, 0)); hand.drop(redTen, new Position(0, 0)); @@ -324,14 +322,8 @@ public class RoundControlTest { } // Fake Turn to put stones on the table IHand hand = roundState.getActivePlayer().getHand(); - hand.drop(blueOne, new Position(0, 0)); - hand.drop(blueTwo, new Position(0, 0)); - hand.drop(blueThree, new Position(0, 0)); - - hand.drop(redSeven, new Position(0, 0)); - hand.drop(blueSeven, new Position(0, 0)); - hand.drop(blackSeven, new Position(0, 0)); - hand.drop(orangeSeven, new Position(0, 0)); + dropStonesOnHand(hand, Arrays.asList(blueOne, blueTwo, blueThree, + blueSeven, redSeven, blackSeven, orangeSeven)); view.startTurnEvent.emit(); view.handPanel.stoneClickEvent.emit(redSeven, false); @@ -351,10 +343,8 @@ public class RoundControlTest { assertEquals(2, roundState.getTable().getSize()); hand = roundState.getActivePlayer().getHand(); - hand.drop(redEight, new Position(0, 0)); - hand.drop(redNine, new Position(0, 0)); - hand.drop(redTen, new Position(0, 0)); - hand.drop(redEleven, new Position(0, 0)); + dropStonesOnHand(hand, + Arrays.asList(redEight, redNine, redTen, redEleven)); view.startTurnEvent.emit(); view.tablePanel.stoneClickEvent.emit(redSeven, false); |