diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-04 16:37:49 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-07-04 16:37:49 +1200 |
commit | 9a57e0aaedb24afd3123177e9be931b2ea6ee20f (patch) | |
tree | 78610351faf05d5924cc03227e19ebd135006e37 /test/org/traccar | |
parent | bd21690b702b6aeae07b53ac255b8157d07e8f40 (diff) | |
download | trackermap-server-9a57e0aaedb24afd3123177e9be931b2ea6ee20f.tar.gz trackermap-server-9a57e0aaedb24afd3123177e9be931b2ea6ee20f.tar.bz2 trackermap-server-9a57e0aaedb24afd3123177e9be931b2ea6ee20f.zip |
Implement custom HuaSheng frame decoder
Diffstat (limited to 'test/org/traccar')
-rw-r--r-- | test/org/traccar/protocol/HuaShengFrameDecoderTest.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/HuaShengFrameDecoderTest.java b/test/org/traccar/protocol/HuaShengFrameDecoderTest.java new file mode 100644 index 000000000..56b8f210c --- /dev/null +++ b/test/org/traccar/protocol/HuaShengFrameDecoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Assert; +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class HuaShengFrameDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + HuaShengFrameDecoder decoder = new HuaShengFrameDecoder(); + + Assert.assertEquals( + binary("c0010c00120060000000000004000600010100c0"), + decoder.decode(null, null, binary("c0010c00120060000000000004000600010100c0"))); + + Assert.assertEquals( + binary("c0010c003e0002000000000010020012a0014f42445f3347315f56312e302e330013a0043335353835353035303434303635380006a08701000006a0a1035fc0"), + decoder.decode(null, null, binary("c0010c003e0002000000000010020012a0014f42445f3347315f56312e302e330013a0043335353835353035303434303635380006a08701000006a0a1035fc0"))); + + } + +} |