aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2011-11-18 13:48:09 +0000
committerAnton Tananaev <anton.tananaev@gmail.com>2011-11-18 13:48:09 +0000
commit8b6816289e5c7a4db1cb7ddda5e49e4ace050fa1 (patch)
tree12a69c8f0791d1333aa220e1a2cce02901dd72e3 /test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java
parent91a8d2558644293758c93d2c1df21487cd387993 (diff)
downloadtrackermap-server-8b6816289e5c7a4db1cb7ddda5e49e4ace050fa1.tar.gz
trackermap-server-8b6816289e5c7a4db1cb7ddda5e49e4ace050fa1.tar.bz2
trackermap-server-8b6816289e5c7a4db1cb7ddda5e49e4ace050fa1.zip
Diffstat (limited to 'test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java57
1 files changed, 57 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java b/test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java
new file mode 100644
index 000000000..614eb3478
--- /dev/null
+++ b/test/org/traccar/protocol/gl100/Gl100ProtocolDecoderTest.java
@@ -0,0 +1,57 @@
+package org.traccar.protocol.gl100;
+
+import java.util.List;
+import org.junit.Test;
+import org.traccar.Device;
+import org.traccar.Position;
+import org.traccar.DataManager;
+import static org.junit.Assert.*;
+
+public class Gl100ProtocolDecoderTest {
+
+ private class TestDataManager implements DataManager {
+ public List getDevices() {
+ return null;
+ }
+
+ public Device getDeviceByImei(String imei) {
+ Device device = new Device();
+ device.setId(new Long(1));
+ device.setImei("10000000000000");
+ return device;
+ }
+
+ public void setPosition(Position position) {
+ }
+ }
+
+ @Test
+ public void testDecode() throws Exception {
+
+ Gl100ProtocolDecoder decoder = new Gl100ProtocolDecoder(new TestDataManager(), 0);
+
+ assertNotNull(decoder.decode(null, null,
+ "+RESP:GTSOS,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204"));
+
+ assertNotNull(decoder.decode(null, null,
+ "+RESP:GTRTL,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204"));
+
+ assertNotNull(decoder.decode(null, null,
+ "+RESP:GTEST,359231030000010,0,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204"));
+
+ assertNotNull(decoder.decode(null, null,
+ "+RESP:GTSZI,359231030000010,0,3,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204"));
+
+ assertNotNull(decoder.decode(null, null,
+ "+RESP:GTLBC,359231030000010,02132523415,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204"));
+
+ assertNotNull(decoder.decode(null, null,
+ "+RESP:GTTRI,359231030000010,1,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,11F0,0102120204"));
+
+ assertNotNull(decoder.decode(null, null,
+ "+RESP:GTTRI,359231030000010,2,0,0,1,4.3,92,70.0,1,121.354335,31.222073,20090101000000,0460,0000,18d8,6141,00,0,0,1,-3.6,145,30.0,2,121.354442,31.221940,20090101000100,0460,0000,18d8,6141,00,11F0,0102120204"));
+
+
+ }
+
+}