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:
@@ -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");
|
||||
|
||||
Reference in New Issue
Block a user