aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2012-09-05 22:28:14 +0400
committerAnton Tananaev <anton.tananaev@gmail.com>2012-09-05 22:28:14 +0400
commit54927aef2dec0bb540699f9c1cfc5e2554f0abf1 (patch)
tree7e0aa317aa05f79c1c448ac7f083ad7fa775c7d9 /test/org/traccar/protocol
parent6060bff2be43a704926f4673acc71eb507518193 (diff)
downloadtrackermap-server-54927aef2dec0bb540699f9c1cfc5e2554f0abf1.tar.gz
trackermap-server-54927aef2dec0bb540699f9c1cfc5e2554f0abf1.tar.bz2
trackermap-server-54927aef2dec0bb540699f9c1cfc5e2554f0abf1.zip
Added additional tests
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/Gps103ProtocolDecoderTest.java32
1 files changed, 30 insertions, 2 deletions
diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
index 7a90e4fbd..8cd25514f 100644
--- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
@@ -1,6 +1,7 @@
package org.traccar.protocol;
import static org.junit.Assert.assertNotNull;
+import static org.junit.Assert.assertNull;
import org.junit.Test;
public class Gps103ProtocolDecoderTest {
@@ -9,11 +10,18 @@ public class Gps103ProtocolDecoderTest {
public void testDecode() throws Exception {
Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new TestDataManager(), 0);
+
+ // Log on request
+ //assertNull(decoder.decode(null, null, "##,imei:359586015829802,A"));
- // assertNull(decoder.decode(null, null, "##,imei:10000000000000,A"));
+ // Heartbeat package
+ //assertNull(decoder.decode(null, null, "359586015829802"));
+
+ // No GPS signal
+ //assertNull(decoder.decode(null, null, "imei:359586015829802,tracker,000000000,13554900601,L,;"));
assertNotNull(decoder.decode(null, null,
- "imei:10000000000000,help me,1004171910,,F,010203.000,A,0102.0003,N,00102.0003,E,1.02,"));
+ "imei:100000000000000,help me,1004171910,,F,010203.000,A,0102.0003,N,00102.0003,E,1.02,"));
assertNotNull(decoder.decode(null, null,
"imei:353451040164707,tracker,1105182344,+36304665439,F,214418.000,A,4804.2222,N,01916.7593,E,0.37,"));
@@ -27,6 +35,26 @@ public class Gps103ProtocolDecoderTest {
assertNotNull(decoder.decode(null, null,
"imei:353451049926460,tracker,1208042043,123456 99008026,F,124336.000,A,3509.8668,N,03322.7636,E,0.00,,"));
+ // SOS alarm
+ assertNotNull(decoder.decode(null, null,
+ "imei:359586015829802,help me,0809231429,13554900601,F,062947.294,A,2234.4026,N,11354.3277,E,0.00,"));
+
+ // Low battery alarm
+ assertNotNull(decoder.decode(null, null,
+ "imei:359586015829802,low battery,0809231429,13554900601,F,062947.294,A,2234.4026,N,11354.3277,E,0.00,"));
+
+ // Geo-fence alarm
+ assertNotNull(decoder.decode(null, null,
+ "imei:359586015829802,stockade,0809231429,13554900601,F,062947.294,A,2234.4026,N,11354.3277,E,0.00,"));
+
+ // Move alarm
+ assertNotNull(decoder.decode(null, null,
+ "imei:359586015829802,move,0809231429,13554900601,F,062947.294,A,2234.4026,N,11354.3277,E,0.00,"));
+
+ // Over speed alarm
+ assertNotNull(decoder.decode(null, null,
+ "imei:359586015829802,speed,0809231429,13554900601,F,062947.294,A,2234.4026,N,11354.3277,E,0.00,"));
+
}
}