diff options
author | Pacien TRAN-GIRARD | 2016-05-08 20:26:28 +0200 |
---|---|---|
committer | Pacien TRAN-GIRARD | 2016-05-08 20:26:28 +0200 |
commit | f19b688112598273ab5e1147c185c4ab2a3fe749 (patch) | |
tree | 4890e5c880e8861c3e979c1eee98159f72637a4d /test | |
parent | 085610b35b7e85cfbec43a1ceb7c38a4b15fe3c2 (diff) | |
download | xblast-f19b688112598273ab5e1147c185c4ab2a3fe749.tar.gz |
Refactor deserialization
Diffstat (limited to 'test')
-rw-r--r-- | test/ch/epfl/xblast/GameStateDeserializerTest.java | 26 | ||||
-rw-r--r-- | test/ch/epfl/xblast/client/GameStateDeserializerTest.java | 27 | ||||
-rw-r--r-- | test/ch/epfl/xblast/server/BlockTest.java | 2 |
3 files changed, 28 insertions, 27 deletions
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 @@ | |||
1 | package ch.epfl.xblast; | ||
2 | |||
3 | import ch.epfl.xblast.client.*; | ||
4 | import ch.epfl.xblast.server.*; | ||
5 | import ch.epfl.xblast.server.Level; | ||
6 | import org.junit.Assert; | ||
7 | import org.junit.Test; | ||
8 | |||
9 | import java.lang.reflect.Array; | ||
10 | import java.util.ArrayList; | ||
11 | import java.util.Arrays; | ||
12 | import java.util.List; | ||
13 | import java.util.stream.Collectors; | ||
14 | |||
15 | /** | ||
16 | * @author Timothée FLOURE (257420) | ||
17 | */ | ||
18 | public class GameStateDeserializerTest { | ||
19 | /** | ||
20 | * Check if we can deserialize the initial GameState... | ||
21 | */ | ||
22 | @Test | ||
23 | public void InitialGameStateDeserializationTest() { | ||
24 | GameStateDeserializer.deserialize(GameStateSerializerTest.getInitialValues()); | ||
25 | } | ||
26 | } | ||
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 @@ | |||
1 | package ch.epfl.xblast.client; | ||
2 | |||
3 | import ch.epfl.xblast.GameStateSerializerTest; | ||
4 | import org.junit.Test; | ||
5 | |||
6 | import java.util.List; | ||
7 | |||
8 | import static org.junit.Assert.fail; | ||
9 | |||
10 | /** | ||
11 | * @author Timothée FLOURE (257420) | ||
12 | * @author Pacien TRAN-GIRARD (261948) | ||
13 | */ | ||
14 | public class GameStateDeserializerTest { | ||
15 | |||
16 | private static final List<Byte> SERIALIZED_INITIAL_GAME_STATE = GameStateSerializerTest.getInitialValues(); | ||
17 | |||
18 | @Test | ||
19 | public void deserializationTerminates() { | ||
20 | try { | ||
21 | GameStateDeserializer.deserialize(SERIALIZED_INITIAL_GAME_STATE); | ||
22 | } catch (Exception e) { | ||
23 | fail(e.getMessage()); | ||
24 | } | ||
25 | } | ||
26 | |||
27 | } | ||
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; | |||
7 | 7 | ||
8 | /** | 8 | /** |
9 | * @author Timothée FLOURE (257420) | 9 | * @author Timothée FLOURE (257420) |
10 | * @author pacien TRAN-GIRARD (261948) | 10 | * @author Pacien TRAN-GIRARD (261948) |
11 | */ | 11 | */ |
12 | public class BlockTest { | 12 | public class BlockTest { |
13 | 13 | ||