aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/LaipacProtocolDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-13 22:25:23 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-13 22:25:23 +1200
commit56aa4d2251c357a1d3b936b29f283d42ede40459 (patch)
tree946394be9e31f4bca605b229acd13d28d1813930 /test/org/traccar/protocol/LaipacProtocolDecoderTest.java
parentc42b05ceffcf56c696b20b34cacb80f7ce690497 (diff)
downloadtrackermap-server-56aa4d2251c357a1d3b936b29f283d42ede40459.tar.gz
trackermap-server-56aa4d2251c357a1d3b936b29f283d42ede40459.tar.bz2
trackermap-server-56aa4d2251c357a1d3b936b29f283d42ede40459.zip
Add Laipac protocol
Diffstat (limited to 'test/org/traccar/protocol/LaipacProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/LaipacProtocolDecoderTest.java48
1 files changed, 48 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/LaipacProtocolDecoderTest.java b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java
new file mode 100644
index 000000000..bd8059ea5
--- /dev/null
+++ b/test/org/traccar/protocol/LaipacProtocolDecoderTest.java
@@ -0,0 +1,48 @@
+package org.traccar.protocol;
+
+import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
+import org.junit.Test;
+
+public class LaipacProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ LaipacProtocolDecoder decoder = new LaipacProtocolDecoder(null);
+ decoder.setDataManager(new TestDataManager());
+
+ assertNull(decoder.decode(null, null, "$AVSYS,99999999,V1.50,SN0000103,32768*15"));
+
+ assertNull(decoder.decode(null, null, "$ECHK,99999999,0*35"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,A,4351.0542,N,07923.5445,W,0.29,78.66,180703,0,3.727,17,1,0,0*37"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,a,4351.0542,N,07923.5445,W,0.29,78.66,180703,0,3.727,17,1,0,0*17"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,v,4351.0542,N,07923.5445,W,0.29,78.66,180703,0,3.727,17,1,0,0*00"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,r,4351.0542,N,07923.5445,W,0.29,78.66,180703,0,3.727,17,1,0,0*04"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,A,4351.0542,N,07923.5445,W,0.29,78.66,180703,S,3.727,17,1,0,0*54"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,A,4351.0542,N,07923.5445,W,0.29,78.66,180703,T,3.727,17,1,0,0*53"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,A,4351.0542,N,07923.5445,W,0.29,78.66,180703,3,3.727,17,1,0,0*34"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,A,4351.0542,N,07923.5445,W,0.29,78.66,180703,X,3.727,17,1,0,0*5F"));
+
+ assertNotNull(decoder.decode(null, null,
+ "$AVRMC,99999999,164339,A,4351.0542,N,07923.5445,W,0.29,78.66,180703,4,3.727,17,1,0,0*33"));
+
+ }
+
+}