From f19b688112598273ab5e1147c185c4ab2a3fe749 Mon Sep 17 00:00:00 2001 From: Pacien TRAN-GIRARD Date: Sun, 8 May 2016 20:26:28 +0200 Subject: Refactor deserialization --- test/ch/epfl/xblast/GameStateDeserializerTest.java | 26 --------------------- .../xblast/client/GameStateDeserializerTest.java | 27 ++++++++++++++++++++++ test/ch/epfl/xblast/server/BlockTest.java | 2 +- 3 files changed, 28 insertions(+), 27 deletions(-) delete mode 100644 test/ch/epfl/xblast/GameStateDeserializerTest.java create mode 100644 test/ch/epfl/xblast/client/GameStateDeserializerTest.java (limited to 'test') diff --git a/test/ch/epfl/xblast/GameStateDeserializerTest.java b/test/ch/epfl/xblast/GameStateDeserializerTest.java deleted file mode 100644 index 4f4fac1..0000000 --- a/test/ch/epfl/xblast/GameStateDeserializerTest.java +++ /dev/null @@ -1,26 +0,0 @@ -package ch.epfl.xblast; - -import ch.epfl.xblast.client.*; -import ch.epfl.xblast.server.*; -import ch.epfl.xblast.server.Level; -import org.junit.Assert; -import org.junit.Test; - -import java.lang.reflect.Array; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.List; -import java.util.stream.Collectors; - -/** - * @author Timothée FLOURE (257420) - */ -public class GameStateDeserializerTest { - /** - * Check if we can deserialize the initial GameState... - */ - @Test - public void InitialGameStateDeserializationTest() { - GameStateDeserializer.deserialize(GameStateSerializerTest.getInitialValues()); - } -} diff --git a/test/ch/epfl/xblast/client/GameStateDeserializerTest.java b/test/ch/epfl/xblast/client/GameStateDeserializerTest.java new file mode 100644 index 0000000..e74728e --- /dev/null +++ b/test/ch/epfl/xblast/client/GameStateDeserializerTest.java @@ -0,0 +1,27 @@ +package ch.epfl.xblast.client; + +import ch.epfl.xblast.GameStateSerializerTest; +import org.junit.Test; + +import java.util.List; + +import static org.junit.Assert.fail; + +/** + * @author Timothée FLOURE (257420) + * @author Pacien TRAN-GIRARD (261948) + */ +public class GameStateDeserializerTest { + + private static final List SERIALIZED_INITIAL_GAME_STATE = GameStateSerializerTest.getInitialValues(); + + @Test + public void deserializationTerminates() { + try { + GameStateDeserializer.deserialize(SERIALIZED_INITIAL_GAME_STATE); + } catch (Exception e) { + fail(e.getMessage()); + } + } + +} diff --git a/test/ch/epfl/xblast/server/BlockTest.java b/test/ch/epfl/xblast/server/BlockTest.java index 31fd08a..9938299 100644 --- a/test/ch/epfl/xblast/server/BlockTest.java +++ b/test/ch/epfl/xblast/server/BlockTest.java @@ -7,7 +7,7 @@ import static org.junit.Assert.assertTrue; /** * @author Timothée FLOURE (257420) - * @author pacien TRAN-GIRARD (261948) + * @author Pacien TRAN-GIRARD (261948) */ public class BlockTest { -- cgit v1.2.3