diff options
author | namo <namo@gurtam.com> | 2017-10-20 18:50:16 +0300 |
---|---|---|
committer | namo <namo@gurtam.com> | 2017-10-20 18:50:16 +0300 |
commit | ad8ee1702e02e02533e9f20e06af960b2cf3c647 (patch) | |
tree | 106cad3733014585424ae1dce0ab693ee02520f3 /test/org/traccar/ProtocolTest.java | |
parent | cf1f0c95cb2f948abfffc5cb207926c916e636c0 (diff) | |
download | trackermap-server-ad8ee1702e02e02533e9f20e06af960b2cf3c647.tar.gz trackermap-server-ad8ee1702e02e02533e9f20e06af960b2cf3c647.tar.bz2 trackermap-server-ad8ee1702e02e02533e9f20e06af960b2cf3c647.zip |
flespi integration: listening messages (rev.5): unit test added
Diffstat (limited to 'test/org/traccar/ProtocolTest.java')
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 14 |
1 files changed, 9 insertions, 5 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 1daefabd6..daff777a6 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -98,6 +98,10 @@ public class ProtocolTest extends BaseTest { verifyDecodedPosition(decoder.decode(null, null, object), false, true, null); } + protected void verifyAttributesList(BaseProtocolDecoder decoder, Object object) throws Exception { + verifyDecodedList(decoder.decode(null, null, object), false, true, null); + } + protected void verifyPosition(BaseProtocolDecoder decoder, Object object) throws Exception { verifyDecodedPosition(decoder.decode(null, null, object), true, false, null); } @@ -107,25 +111,25 @@ public class ProtocolTest extends BaseTest { } protected void verifyPositions(BaseProtocolDecoder decoder, Object object) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), true, null); + verifyDecodedList(decoder.decode(null, null, object), true, false, null); } protected void verifyPositions(BaseProtocolDecoder decoder, boolean checkLocation, Object object) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), checkLocation, null); + verifyDecodedList(decoder.decode(null, null, object), checkLocation, false, null); } protected void verifyPositions(BaseProtocolDecoder decoder, Object object, Position position) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), true, position); + verifyDecodedList(decoder.decode(null, null, object), true, false, position); } - private void verifyDecodedList(Object decodedObject, boolean checkLocation, Position expected) { + private void verifyDecodedList(Object decodedObject, boolean checkLocation, boolean checkAttributes, Position expected) { Assert.assertNotNull("list is null", decodedObject); Assert.assertTrue("not a list", decodedObject instanceof List); Assert.assertFalse("list is empty", ((List) decodedObject).isEmpty()); for (Object item : (List) decodedObject) { - verifyDecodedPosition(item, checkLocation, false, expected); + verifyDecodedPosition(item, checkLocation, checkAttributes, expected); } } |