diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-09-27 00:49:33 +1300 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-09-27 00:49:33 +1300 |
commit | 17d5fbb60d859abe366d52137ae2c3cea2de1f5a (patch) | |
tree | c957116ab5bf8098034c44617970a22a24528f6a /test/org/traccar | |
parent | b5fc7e0899475547da99c06319ede5cc68f647e4 (diff) | |
parent | 5a515b9e2995602a686436106922362910b8a5c1 (diff) | |
download | trackermap-server-17d5fbb60d859abe366d52137ae2c3cea2de1f5a.tar.gz trackermap-server-17d5fbb60d859abe366d52137ae2c3cea2de1f5a.tar.bz2 trackermap-server-17d5fbb60d859abe366d52137ae2c3cea2de1f5a.zip |
Merge pull request #3547 from Abyss777/teltonika_io
Improve Teltonika IO decoding
Diffstat (limited to 'test/org/traccar')
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 8 | ||||
-rw-r--r-- | test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 7bff41acd..1daefabd6 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -257,6 +257,14 @@ public class ProtocolTest extends BaseTest { Assert.assertTrue(attributes.get(Position.KEY_DRIVER_UNIQUE_ID) instanceof String); } + if (attributes.containsKey(Position.KEY_STEPS)) { + Assert.assertTrue(attributes.get(Position.KEY_STEPS) instanceof Number); + } + + if (attributes.containsKey(Position.KEY_ROAMING)) { + Assert.assertTrue(attributes.get(Position.KEY_ROAMING) instanceof Boolean); + } + if (position.getNetwork() != null && position.getNetwork().getCellTowers() != null) { for (CellTower cellTower : position.getNetwork().getCellTowers()) { checkInteger(cellTower.getMobileCountryCode(), 0, 999); diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java index a945178a1..beae48d67 100644 --- a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java +++ b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java @@ -59,6 +59,12 @@ public class TeltonikaProtocolDecoderTest extends ProtocolTest { verifyPositions(decoder, binary( "00000000000000a608010000013f14a1d1ce000f0eb790209a778000ab010c0500000000000000000100003390")); + verifyPositions(decoder, binary( + "000000000000004508010000015eb70a86d00024089d4d21dee3860137005f12005f000e06ef01f00150011503c800450108b5000bb6000642382718005fcd057ace19d3430f57440000000001000002bf")); + + verifyPositions(decoder, binary( + "000000000000004a08010000015ebc1da508002411926621f15246010b00b913005e000f06ef01f00150011505c800450108b5000bb6000642381b18005ecd0318ce19cd430f5844000001f1000061a900010000c8e1")); + decoder.setExtended(true); verifyPositions(decoder, false, binary( |