From 80f0c0d43faab53ec30333529d748bdd725a72df Mon Sep 17 00:00:00 2001 From: Ida Massow Date: Sun, 19 Jun 2011 00:28:19 +0200 Subject: =?UTF-8?q?Tests=20verk=C3=BCrzt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: svn://sunsvr01.isp.uni-luebeck.de/swproj13/trunk@472 72836036-5685-4462-b002-a69064685172 --- test/jrummikub/control/RoundControlTest.java | 99 +++++++++------------------- 1 file changed, 31 insertions(+), 68 deletions(-) (limited to 'test') diff --git a/test/jrummikub/control/RoundControlTest.java b/test/jrummikub/control/RoundControlTest.java index a6d29c2..02eb3b8 100644 --- a/test/jrummikub/control/RoundControlTest.java +++ b/test/jrummikub/control/RoundControlTest.java @@ -51,6 +51,37 @@ 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); + Stone orangeFour = new Stone(4, ORANGE); + + Stone blueFive = new Stone(5, BLUE); + Stone blueSix = new Stone(6, BLUE); + Stone blueSeven = new Stone(7, BLUE); + Stone blackSeven = new Stone(7, BLACK); + Stone redSeven = new Stone(7, RED); + Stone orangeSeven = new Stone(7, ORANGE); + + 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); + + Stone redOne = new Stone(1, RED); + Stone blackOne = new Stone(1, BLACK); /** * For each test create a round control initialized by a mock model and view @@ -143,10 +174,6 @@ public class RoundControlTest { } view.startTurnEvent.emit(); - Stone blueOne = new Stone(1, BLUE); - Stone blueTwo = new Stone(2, BLUE); - Stone blueThree = new Stone(3, BLUE); - IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); @@ -198,10 +225,6 @@ public class RoundControlTest { } view.startTurnEvent.emit(); - Stone blueOne = new Stone(1, BLUE); - Stone blueTwo = new Stone(2, BLUE); - Stone blueThree = new Stone(3, BLUE); - IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); @@ -213,10 +236,6 @@ public class RoundControlTest { view.tablePanel.clickEvent.emit(new Position(0, 0)); - Stone blueTen = new Stone(10, BLUE); - Stone redTen = new Stone(10, RED); - Stone blueEleven = new Stone(11, BLUE); - assertFalse(roundState.getActivePlayer().getLaidOut()); hand.drop(blueTen, new Position(0, 0)); @@ -246,15 +265,6 @@ public class RoundControlTest { } view.startTurnEvent.emit(); // Fake Turn to put stones on the table - Stone blueSeven = new Stone(7, BLUE); - Stone blackSeven = new Stone(7, BLACK); - Stone redSeven = new Stone(7, RED); - Stone orangeSeven = new Stone(7, ORANGE); - - Stone blueOne = new Stone(1, BLUE); - Stone blueTwo = new Stone(2, BLUE); - Stone blueThree = new Stone(3, BLUE); - IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); @@ -282,10 +292,6 @@ public class RoundControlTest { assertEquals(2, roundState.getTable().getSize()); view.startTurnEvent.emit(); - Stone redEight = new Stone(8, RED); - Stone redNine = new Stone(9, RED); - Stone redTen = new Stone(10, RED); - hand = roundControl.clonedHand; hand.drop(redEight, new Position(0, 0)); hand.drop(redNine, new Position(0, 0)); @@ -318,15 +324,6 @@ public class RoundControlTest { } view.startTurnEvent.emit(); // Fake Turn to put stones on the table - Stone blueSeven = new Stone(7, BLUE); - Stone blackSeven = new Stone(7, BLACK); - Stone redSeven = new Stone(7, RED); - Stone orangeSeven = new Stone(7, ORANGE); - - Stone blueOne = new Stone(1, BLUE); - Stone blueTwo = new Stone(2, BLUE); - Stone blueThree = new Stone(3, BLUE); - IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); @@ -354,11 +351,6 @@ public class RoundControlTest { assertEquals(2, roundState.getTable().getSize()); view.startTurnEvent.emit(); - Stone redEight = new Stone(8, RED); - Stone redNine = new Stone(9, RED); - Stone redTen = new Stone(10, RED); - Stone redEleven = new Stone(11, RED); - hand = roundControl.clonedHand; hand.drop(redEight, new Position(0, 0)); hand.drop(redNine, new Position(0, 0)); @@ -393,15 +385,6 @@ public class RoundControlTest { } view.startTurnEvent.emit(); // Fake Turn to put stones on the table - Stone blueFour = new Stone(4, BLUE); - Stone blackFour = new Stone(4, BLACK); - Stone redFour = new Stone(4, RED); - Stone orangeFour = new Stone(4, ORANGE); - - Stone blueFive = new Stone(5, BLUE); - Stone blueSix = new Stone(6, BLUE); - Stone blueSeven = new Stone(7, BLUE); - IHand hand = roundControl.clonedHand; hand.drop(blueFive, new Position(0, 0)); hand.drop(blueSix, new Position(0, 0)); @@ -458,15 +441,6 @@ public class RoundControlTest { } view.startTurnEvent.emit(); // Fake Turn to put stones on the table - Stone blueSeven = new Stone(7, BLUE); - Stone blackSeven = new Stone(7, BLACK); - Stone redSeven = new Stone(7, RED); - Stone orangeSeven = new Stone(7, ORANGE); - - Stone blueOne = new Stone(1, BLUE); - Stone blueTwo = new Stone(2, BLUE); - Stone blueThree = new Stone(3, BLUE); - IHand hand = roundControl.clonedHand; hand.drop(blueOne, new Position(0, 0)); hand.drop(blueTwo, new Position(0, 0)); @@ -665,11 +639,6 @@ public class RoundControlTest { assertSame(BottomPanelType.HUMAN_HAND_PANEL, view.bottomPanelType); IHand hand = testRound.clonedHand; - Stone blueEight = new Stone(8, BLUE); - Stone blackEight = new Stone(8, BLACK); - Stone redEight = new Stone(8, RED); - Stone orangeEight = new Stone(8, ORANGE); - hand.drop(redEight, new Position(0, 0)); hand.drop(blueEight, new Position(0, 0)); hand.drop(blackEight, new Position(0, 0)); @@ -698,12 +667,6 @@ public class RoundControlTest { public void testTableDifference() { MockTable oldTable = new MockTable(); MockTable newTable = new MockTable(); - Stone blueOne = new Stone(1, BLUE); - Stone redOne = new Stone(1, RED); - Stone blackOne = new Stone(1, BLACK); - Stone blueTwo = new Stone(2, BLUE); - Stone blueThree = new Stone(3, BLUE); - Stone blueFour = new Stone(4, BLUE); StoneSet oldSet1 = new StoneSet(Arrays.asList(blueOne, redOne, blackOne)); StoneSet oldSet2 = new StoneSet(blueTwo); oldTable.drop(oldSet1, new Position(0, 0)); -- cgit v1.2.3