aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/protocol/BoxProtocolDecoderTest.java36
-rw-r--r--test/org/traccar/protocol/CarTrackProtocolDecoderTest.java4
-rw-r--r--test/org/traccar/protocol/FreedomProtocolDecoderTest.java21
3 files changed, 61 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/BoxProtocolDecoderTest.java b/test/org/traccar/protocol/BoxProtocolDecoderTest.java
new file mode 100644
index 000000000..897b5071c
--- /dev/null
+++ b/test/org/traccar/protocol/BoxProtocolDecoderTest.java
@@ -0,0 +1,36 @@
+package org.traccar.protocol;
+
+import static org.junit.Assert.assertNull;
+import org.traccar.helper.TestDataManager;
+import static org.traccar.helper.DecoderVerifier.verify;
+import org.junit.Test;
+
+public class BoxProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ BoxProtocolDecoder decoder = new BoxProtocolDecoder(null);
+ decoder.setDataManager(new TestDataManager());
+
+ assertNull(decoder.decode(null, null,
+ "H,BT,358281002435893,081028142432,F5813D19,6D6E6DC2"));
+
+ assertNull(decoder.decode(null, null,
+ "H,BT,N878123,080415081234,D63E6DD9,6D6E6DC2,8944100300825505377"));
+
+ verify(decoder.decode(null, null,
+ "L,081028142429,G,52.51084,-1.70849,0,170,0,1,0"));
+
+ verify(decoder.decode(null, null,
+ "L,081028142432,G,52.51081,-1.70849,0,203,0,16,0"));
+
+ assertNull(decoder.decode(null, null,
+ "L,080528112501,AI1,145.56"));
+
+ assertNull(decoder.decode(null, null,
+ "E,1"));
+
+ }
+
+}
diff --git a/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java b/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java
index f40b45e01..96a8e4b74 100644
--- a/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/CarTrackProtocolDecoderTest.java
@@ -14,6 +14,10 @@ public class CarTrackProtocolDecoderTest {
verify(decoder.decode(null, null,
"$$2222234???????&A9955&B102904.000,A,2233.0655,N,11404.9440,E,0.00,,030109,,*17|6.3|&C0100000100&D000024?>&E10000000&Y00100020"));
+
+ verify(decoder.decode(null, null,
+ "$$2222234???????&A9955&B102904.000,A,2233.0655,N,11404.9440,E,0.00,,030109,,*17|6.3|&C0100000100&D000024?>&E10000000"));
+
}
diff --git a/test/org/traccar/protocol/FreedomProtocolDecoderTest.java b/test/org/traccar/protocol/FreedomProtocolDecoderTest.java
new file mode 100644
index 000000000..ead8c980b
--- /dev/null
+++ b/test/org/traccar/protocol/FreedomProtocolDecoderTest.java
@@ -0,0 +1,21 @@
+package org.traccar.protocol;
+
+import org.traccar.helper.TestDataManager;
+import static org.traccar.helper.DecoderVerifier.verify;
+import static org.junit.Assert.assertNull;
+import org.junit.Test;
+
+public class FreedomProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ FreedomProtocolDecoder decoder = new FreedomProtocolDecoder(null);
+ decoder.setDataManager(new TestDataManager());
+
+ verify(decoder.decode(null, null,
+ "IMEI,353358011714362,2014/05/22, 20:49:32, N, Lat:4725.9624, E, Lon:01912.5483, Spd:5.05"));
+
+ }
+
+}