aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-07-17 22:41:03 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-07-17 22:41:03 +1200
commitfaaf63abdd81d1d4b6e7c7a8ef36e049fdc8000a (patch)
tree66f1b1522dda364281824be8f35b899b3f36ee16 /test/org/traccar/protocol
parent51d4e557703a0322b983a8b294f2a8c6920718c5 (diff)
downloadtrackermap-server-faaf63abdd81d1d4b6e7c7a8ef36e049fdc8000a.tar.gz
trackermap-server-faaf63abdd81d1d4b6e7c7a8ef36e049fdc8000a.tar.bz2
trackermap-server-faaf63abdd81d1d4b6e7c7a8ef36e049fdc8000a.zip
Finish with GPS103 commands
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/Gps103ProtocolEncoderTest.java29
1 files changed, 29 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java
new file mode 100644
index 000000000..74091d0e0
--- /dev/null
+++ b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java
@@ -0,0 +1,29 @@
+package org.traccar.protocol;
+
+import java.util.HashMap;
+import java.util.Map;
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.model.Command;
+
+public class Gps103ProtocolEncoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder();
+
+ Command command = new Command();
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_POSITION_FIX);
+
+ Map<String, Object> other = new HashMap<>();
+ other.put(Command.KEY_FREQUENCY, 300l);
+
+ command.setOther(other);
+
+ Assert.assertEquals("**,imei:123456789012345,C,05m", encoder.encodeCommand(command));
+
+ }
+
+}