diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-13 22:25:50 -0700 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2019-04-13 22:25:50 -0700 |
commit | b595ec1bede3e30447b49bb7340f88c9b3a3f97f (patch) | |
tree | 7fa7a21fe803d68032a9ad3301ffb12eb3733b1f /src/test/java/org/traccar/protocol/ItsFrameDecoderTest.java | |
parent | a3269fda8b77c6af0e810222dae4aff6faf1df3f (diff) | |
download | trackermap-server-b595ec1bede3e30447b49bb7340f88c9b3a3f97f.tar.gz trackermap-server-b595ec1bede3e30447b49bb7340f88c9b3a3f97f.tar.bz2 trackermap-server-b595ec1bede3e30447b49bb7340f88c9b3a3f97f.zip |
Support ITS binary checksum
Diffstat (limited to 'src/test/java/org/traccar/protocol/ItsFrameDecoderTest.java')
-rw-r--r-- | src/test/java/org/traccar/protocol/ItsFrameDecoderTest.java | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/ItsFrameDecoderTest.java b/src/test/java/org/traccar/protocol/ItsFrameDecoderTest.java new file mode 100644 index 000000000..d7bd7d483 --- /dev/null +++ b/src/test/java/org/traccar/protocol/ItsFrameDecoderTest.java @@ -0,0 +1,27 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class ItsFrameDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + ItsFrameDecoder decoder = new ItsFrameDecoder(); + + verifyFrame( + binary("242c43502c41544c2c312e3444335f4149533134305f312e302c45412c31302c482c3836383732383033373731373434312c2c312c32393033323031392c3232353931332c32382e3533343031362c4e2c37372e3236383933362c452c302e302c34382e30302c302c302e302c312e322c302e372c216465612c302c312c31322e362c332e392c312c4f2c32322c3430342c20342c3161612c346230622c643433642c3161612c31352c643433622c3161612c31352c346230632c3161612c31342c346136322c3161612c31322c303131312c30302c3232313333322c"), + decoder.decode(null, null, binary("242c43502c41544c2c312e3444335f4149533134305f312e302c45412c31302c482c3836383732383033373731373434312c2c312c32393033323031392c3232353931332c32382e3533343031362c4e2c37372e3236383933362c452c302e302c34382e30302c302c302e302c312e322c302e372c216465612c302c312c31322e362c332e392c312c4f2c32322c3430342c20342c3161612c346230622c643433642c3161612c31352c643433622c3161612c31352c346230632c3161612c31342c346136322c3161612c31322c303131312c30302c3232313333322cbc2a"))); + + verifyFrame( + binary("242c43502c41544c2c312e3444335f4149533134305f312e302c45412c31302c482c3836383732383033373731373434312c2c312c32393033323031392c3232353931332c32382e3533343031362c4e2c37372e3236383933362c452c302e302c34382e30302c302c302e302c312e322c302e372c216465612c302c312c31322e362c332e392c312c4f2c32322c3430342c20342c3161612c346230622c643433642c3161612c31352c643433622c3161612c31352c346230632c3161612c31342c346136322c3161612c31322c303131312c30302c3232313333322c"), + decoder.decode(null, null, binary("242c43502c41544c2c312e3444335f4149533134305f312e302c45412c31302c482c3836383732383033373731373434312c2c312c32393033323031392c3232353931332c32382e3533343031362c4e2c37372e3236383933362c452c302e302c34382e30302c302c302e302c312e322c302e372c216465612c302c312c31322e362c332e392c312c4f2c32322c3430342c20342c3161612c346230622c643433642c3161612c31352c643433622c3161612c31352c346230632c3161612c31342c346136322c3161612c31322c303131312c30302c3232313333322c2a2a"))); + + verifyFrame( + binary("244e524d2c524f41445250412c312e394149532c4e522c30312c4c2c3836393836373033363031353636392c2c312c30383034323031392c3230303530362c32362e39303634353636372c4e2c37352e37383936323333332c452c302e302c3238302e37342c31342c3437312e322c302e38302c302e36302c566f6461666f6e65202d2052616a61737468616e2c302c312c31322e392c342e322c302c4f2c32302c3430342c36302c303746352c333939462c31302c303746352c324434372c31302c303746352c333941312c31302c303746352c324136452c30382c303746352c333536382c303030302c30302c3030333838342c3936443446373031"), + decoder.decode(null, null, binary("244e524d2c524f41445250412c312e394149532c4e522c30312c4c2c3836393836373033363031353636392c2c312c30383034323031392c3230303530362c32362e39303634353636372c4e2c37352e37383936323333332c452c302e302c3238302e37342c31342c3437312e322c302e38302c302e36302c566f6461666f6e65202d2052616a61737468616e2c302c312c31322e392c342e322c302c4f2c32302c3430342c36302c303746352c333939462c31302c303746352c324434372c31302c303746352c333941312c31302c303746352c324136452c30382c303746352c333536382c303030302c30302c3030333838342c39364434463730312a"))); + + } + +} |