From cd1909c6a4117a65feb0a2f6e62bfcd9a4aa837b Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Mon, 9 May 2016 11:47:52 +0200 Subject: Fix random test by resetting static state --- test/ch/epfl/xblast/etape6/RandomTestGame.java | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) (limited to 'test') diff --git a/test/ch/epfl/xblast/etape6/RandomTestGame.java b/test/ch/epfl/xblast/etape6/RandomTestGame.java index 8192956..90435c8 100644 --- a/test/ch/epfl/xblast/etape6/RandomTestGame.java +++ b/test/ch/epfl/xblast/etape6/RandomTestGame.java @@ -9,6 +9,7 @@ import ch.epfl.xblast.server.GameState; import ch.epfl.xblast.server.Player; import ch.epfl.xblast.server.Player.DirectedPosition; import ch.epfl.xblast.server.debug.RandomEventGenerator; +import org.junit.Before; import org.junit.Test; import java.io.IOException; @@ -26,6 +27,7 @@ import static org.junit.Assert.assertTrue; * Checks that the player move as in the example for the random game provided as example * * @author EPFL + * @author Pacien TRAN-GIRARD (261948) */ public class RandomTestGame { @@ -56,7 +58,6 @@ public class RandomTestGame { new Player(PlayerID.PLAYER_4, lives, p4, maxBombs, bombRange)); } - @Test public void testPositionsRandomGame() throws InterruptedException, IOException, URISyntaxException { String fileName = getClass().getResource("/stage6files/randomgame_positions.txt").toURI().getPath(); @@ -83,4 +84,12 @@ public class RandomTestGame { player_positions.close(); } + /** + * Resets the random bonus generator. + */ + @Before + public void resetRandomSource() { + Block.resetRandomGenerator(); + } + } -- cgit v1.2.3