Renamed Heartbeat to HeartBeat.

Added HeartBeatDecoder.
Added HeartBeatEncoder.
BinaryMessageDecoder now uses HeartBeatDecoder.
MockOutput now logs a warning if a heartBeat cannot be encoded.
Added HeartBeatDecoderTest.
issue #35 #36
#story[1095]
This commit is contained in:
fjc40
2017-08-05 23:27:28 +12:00
parent c3ed30019c
commit 8ef906472b
9 changed files with 192 additions and 44 deletions
@@ -133,9 +133,8 @@ public class BinaryMessageDecoder {
switch(mType) {
case HEARTBEAT:
//System.out.println("Decoding HeartBeat Message!");
//TODO maybe use HeartbeatDecoder.decode(message).
//TODO also, decoders for each message type should encapsulate the constructing of the object. E.g., return HeartbeatDecoder.decode(message);.
return new Heartbeat(bytesToLong(messageBody));
HeartBeatDecoder heartBeatDecoder = new HeartBeatDecoder(messageBody);
return heartBeatDecoder.getMessage();
case RACESTATUS:
//System.out.println("Race Status Message");