aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-06-16 00:55:14 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-06-16 00:55:14 +1200
commite6cea680c6d4ae362e120e6537e84428507b4781 (patch)
treec9feae942a9035860057f154d688324019ca3611 /test/org/traccar/protocol
parent27c605fc6fb1e4cf71ae1ab800ef47fd06ca3af7 (diff)
downloadtrackermap-server-e6cea680c6d4ae362e120e6537e84428507b4781.tar.gz
trackermap-server-e6cea680c6d4ae362e120e6537e84428507b4781.tar.bz2
trackermap-server-e6cea680c6d4ae362e120e6537e84428507b4781.zip
Update Atrack frame decoder
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/AtrackFrameDecoderTest.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/AtrackFrameDecoderTest.java b/test/org/traccar/protocol/AtrackFrameDecoderTest.java
new file mode 100644
index 000000000..60b338cca
--- /dev/null
+++ b/test/org/traccar/protocol/AtrackFrameDecoderTest.java
@@ -0,0 +1,28 @@
+package org.traccar.protocol;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class AtrackFrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ AtrackFrameDecoder decoder = new AtrackFrameDecoder();
+
+ Assert.assertEquals(
+ binary("244F4B"),
+ decoder.decode(null, null, binary("244F4B0D0A")));
+
+ Assert.assertEquals(
+ binary("fe0200014104d8f196820001"),
+ decoder.decode(null, null, binary("fe0200014104d8f196820001")));
+
+ Assert.assertEquals(
+ binary("40501e58003301e000014104d8f19682525ecd5d525ee344525ee35effc88815026ab4d70000020000104403de01000b0000000007d007d000"),
+ decoder.decode(null, null, binary("40501e58003301e000014104d8f19682525ecd5d525ee344525ee35effc88815026ab4d70000020000104403de01000b0000000007d007d000")));
+
+ }
+
+}