aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/GnxProtocolDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-03-18 10:19:33 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-03-18 10:19:33 +1300
commit1a34d34e216bb60025d972a57e668673c021f20a (patch)
tree474b24fe355fe99d0141f235ba52d967a5913881 /test/org/traccar/protocol/GnxProtocolDecoderTest.java
parent6c3ede1af193d4069fed71b19bccc33c5522acb0 (diff)
downloadtrackermap-server-1a34d34e216bb60025d972a57e668673c021f20a.tar.gz
trackermap-server-1a34d34e216bb60025d972a57e668673c021f20a.tar.bz2
trackermap-server-1a34d34e216bb60025d972a57e668673c021f20a.zip
Implement GNX communication protocol
Diffstat (limited to 'test/org/traccar/protocol/GnxProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/GnxProtocolDecoderTest.java27
1 files changed, 27 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/GnxProtocolDecoderTest.java b/test/org/traccar/protocol/GnxProtocolDecoderTest.java
new file mode 100644
index 000000000..c1b8860d8
--- /dev/null
+++ b/test/org/traccar/protocol/GnxProtocolDecoderTest.java
@@ -0,0 +1,27 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class GnxProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ GnxProtocolDecoder decoder = new GnxProtocolDecoder(new GnxProtocol());
+
+ verifyPosition(decoder, text(
+ "$GNX_LOC,865733022352132,095,0,102134,280914,102134,280914,1,18.765432,N,073.752811,W,032,165.32,12,25,0,A,E,2,000099.9,000099.5,GNX01001,12*"));
+
+ verifyNothing(decoder, text(
+ "$GNX_LOC,865733022354161,139,0,142838,160316,142825,160316,0,000000000,N,0000000000,E,000,0.00,00,48,0,e,C,2,000000.0,000000.0,GNX04008,BB*"));
+
+ verifyPosition(decoder, text(
+ "$GNX_DIO,863071015071563,110,1,155627,121214,151244,121214,1,08.878321,N,076.643154,E,0,0,0,0,0,0,GNX01001,B1*"));
+
+ verifyNothing(decoder, text(
+ "$GNX_DIO,865733022354161,112,1,142849,160316,142714,160316,0,000000000,N,0000000000,E,0,0,0,0,0,0,0,GNX04008,1A*"));
+
+ }
+
+}