aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2019-05-27 07:56:50 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2019-05-27 07:56:50 -0700
commit437503927cdc7100fd31db5e9313d9f61bd24874 (patch)
tree1ea953ffb8fa597f1332920733f7dd4dddfbee3a /src/test/java/org/traccar/protocol
parentdd6a607b66d0a0f794448e8ac148288a7bba484d (diff)
downloadtraccar-server-437503927cdc7100fd31db5e9313d9f61bd24874.tar.gz
traccar-server-437503927cdc7100fd31db5e9313d9f61bd24874.tar.bz2
traccar-server-437503927cdc7100fd31db5e9313d9f61bd24874.zip
Implement new Mictrack protocol
Diffstat (limited to 'src/test/java/org/traccar/protocol')
-rw-r--r--src/test/java/org/traccar/protocol/MictrackProtocolDecoderTest.java37
1 files changed, 37 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/MictrackProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MictrackProtocolDecoderTest.java
new file mode 100644
index 000000000..d388d935b
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/MictrackProtocolDecoderTest.java
@@ -0,0 +1,37 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class MictrackProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ MictrackProtocolDecoder decoder = new MictrackProtocolDecoder(null);
+
+ verifyPosition(decoder, text(
+ "MT;6;866425031361423;R0;10+190109091803+22.63827+114.02922+2.14+69+2+3744+113"),
+ position("2019-01-09 17:18:03.000", true, 22.63827, 114.02922));
+
+ verifyAttributes(decoder, text(
+ "MT;6;866425031377981;R1;190108024848+6a:db:54:5a:79:6d,-91,00:9a:cd:a2:e6:21,-94+3+3831+0"));
+
+ verifyAttributes(decoder, text(
+ "MT;1;866425031379169;R2;181129081017+0,21681,20616,460+4+3976+0"));
+
+ verifyAttributes(decoder, text(
+ "MT;1;866425031379169;R3;181129081017+0,1030,168267587,460,406+4+3976+0"));
+
+ verifyAttributes(decoder, text(
+ "MT;6;866425031377981;R12;190108024848+6a:db:54:5a:79:6d,-91,00:9a:cd:a2:e6:21,-94+0,21681,20616,460+3+3831+0"));
+
+ verifyAttributes(decoder, text(
+ "MT;6;866425031377981;R13;190108024848+6a:db:54:5a:79:6d,-91,00:9a:cd:a2:e6:21,-94+0,1030,168267587,460,406+3+3831+0"));
+
+ verifyAttributes(decoder, text(
+ "MT;5;866425031379169;RH;5+190116112648+0+0+0+0+11+3954+1"));
+
+ }
+
+}