aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-04-24 21:37:47 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-04-24 21:38:05 -0700
commitbec490817a2251dc37f727f3a755a20411761993 (patch)
treeccbfd93aa45f181a9d71ef37d2a2fdc1d50c7f1f /src/test/java/org/traccar
parente944d60ea05ba527eee3d663c2ec88c9335ae1fb (diff)
downloadtrackermap-server-bec490817a2251dc37f727f3a755a20411761993.tar.gz
trackermap-server-bec490817a2251dc37f727f3a755a20411761993.tar.bz2
trackermap-server-bec490817a2251dc37f727f3a755a20411761993.zip
Implement Suntech frame decoder
Diffstat (limited to 'src/test/java/org/traccar')
-rw-r--r--src/test/java/org/traccar/protocol/SuntechFrameDecoderTest.java23
1 files changed, 23 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/SuntechFrameDecoderTest.java b/src/test/java/org/traccar/protocol/SuntechFrameDecoderTest.java
new file mode 100644
index 000000000..ccd9139f4
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/SuntechFrameDecoderTest.java
@@ -0,0 +1,23 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class SuntechFrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ SuntechFrameDecoder decoder = new SuntechFrameDecoder();
+
+ verifyFrame(
+ binary("5354363030414c563b303038373238333237"),
+ decoder.decode(null, null, binary("5354363030414c563b3030383732383332370d")));
+
+ verifyFrame(
+ binary("53543630305545583b3030383732383332373b32303b3536383b32303139303432343b30383a33333a31313b30626631323833623b3333343b32303b326631393b31383b2b32302e3531343134353b2d3130302e3734333731303b3030302e3030343b3030302e30303b31303b313b31303337373836313b31322e39363b3030303030303b34343b745f303d31333b4e5f303d303839442e303b745f313d31423b4e5f313d304537342e303b515f443d30420d0a3b42343b3032383439383b342e313b31"),
+ decoder.decode(null, null, binary("53543630305545583b3030383732383332373b32303b3536383b32303139303432343b30383a33333a31313b30626631323833623b3333343b32303b326631393b31383b2b32302e3531343134353b2d3130302e3734333731303b3030302e3030343b3030302e30303b31303b313b31303337373836313b31322e39363b3030303030303b34343b745f303d31333b4e5f303d303839442e303b745f313d31423b4e5f313d304537342e303b515f443d30420d0a3b42343b3032383439383b342e313b310d")));
+
+ }
+
+}