diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-21 19:31:39 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-09-21 19:31:39 +1200 |
commit | 19b17695867e00861c719292aad7ae48f33a8eeb (patch) | |
tree | 5750d52229635a923b609b8259e18aad401d5dba /test | |
parent | 208b66427643d50d2a5fd0dd29b73abe086ce9db (diff) | |
download | trackermap-server-19b17695867e00861c719292aad7ae48f33a8eeb.tar.gz trackermap-server-19b17695867e00861c719292aad7ae48f33a8eeb.tar.bz2 trackermap-server-19b17695867e00861c719292aad7ae48f33a8eeb.zip |
Implement cGuard communication protocol
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/protocol/CguardProtocolDecoderTest.java | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/CguardProtocolDecoderTest.java b/test/org/traccar/protocol/CguardProtocolDecoderTest.java new file mode 100644 index 000000000..49d037f8f --- /dev/null +++ b/test/org/traccar/protocol/CguardProtocolDecoderTest.java @@ -0,0 +1,54 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class CguardProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + CguardProtocolDecoder decoder = new CguardProtocolDecoder(new CguardProtocol()); + + verifyNothing(decoder, text( + "IDRO:354868050655283")); + + verifyPosition(decoder, text( + "NV:160711 044023:54.342907:48.582590:0:NAN:0:110.1")); + + verifyPosition(decoder, text( + "NV:160711 044023:54.342907:-148.582590:0:NAN:0:110.1")); + + verifyNothing(decoder, text( + "BC:160711 044023:CSQ1:48:NSQ1:7:NSQ2:1:BAT1:98:PWR1:11.7:CLG1:NAN")); + + verifyNothing(decoder, text( + "BC:160711 044524:CSQ1:61:NSQ1:18:BAT1:98:PWR1:11.7:CLG1:NAN")); + + verifyNothing(decoder, text( + "VERSION:3.3")); + + verifyPosition(decoder, text( + "NV:160420 101902:55.799425:37.674033:0.94:NAN:213.59:156.6")); + + verifyNothing(decoder, text( + "BC:160628 081024:CSQ1:32:NSQ1:10:BAT1:100")); + + verifyNothing(decoder, text( + "BC:160628 081033:NSQ2:0")); + + verifyPosition(decoder, text( + "NV:160630 151537:55.799913:37.674267:0.7:NAN:10.21:174.9")); + + verifyNothing(decoder, text( + "BC:160630 153316:BAT1:76")); + + verifyNothing(decoder, text( + "BC:160630 153543:NSQ2:0")); + + verifyNothing(decoder, text( + "PING")); + + } + +} |