diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-17 22:51:09 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-07-17 22:51:09 +1200 |
commit | 466e704934894ed44458bec798fa9fad0532bb4c (patch) | |
tree | eaf48175234c9d4d1b0456a542887a90c1377d00 /test/org/traccar/protocol | |
parent | 6bfaa4bdedcf6719de75afa905a309296aa1bd9d (diff) | |
parent | ff640cf8eb19cfeb3c8475ffd9b0aeccbd769f96 (diff) | |
download | trackermap-server-466e704934894ed44458bec798fa9fad0532bb4c.tar.gz trackermap-server-466e704934894ed44458bec798fa9fad0532bb4c.tar.bz2 trackermap-server-466e704934894ed44458bec798fa9fad0532bb4c.zip |
Merge commands implementation (fix #7)
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r-- | test/org/traccar/protocol/Gps103ProtocolEncoderTest.java | 29 |
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)); + + } + +} |