aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-30 03:09:20 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-30 03:09:20 +1300
commit3593df6595cb1af169098ea2e7594fc3480648d0 (patch)
tree4f808bca061e8d9f62061bf4d1f81d70d1c66fdb /test/org/traccar/protocol
parent9ed41321dd9617ccae4c4e338817eeff74876be9 (diff)
downloadtrackermap-server-3593df6595cb1af169098ea2e7594fc3480648d0.tar.gz
trackermap-server-3593df6595cb1af169098ea2e7594fc3480648d0.tar.bz2
trackermap-server-3593df6595cb1af169098ea2e7594fc3480648d0.zip
Implement GPS103 custom command
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/Gps103ProtocolEncoderTest.java16
1 files changed, 15 insertions, 1 deletions
diff --git a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java
index f8652bc9a..54c520c21 100644
--- a/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/Gps103ProtocolEncoderTest.java
@@ -8,7 +8,7 @@ import org.traccar.model.Command;
public class Gps103ProtocolEncoderTest extends ProtocolTest {
@Test
- public void testEncode() throws Exception {
+ public void testEncodePositionPeriodic() throws Exception {
Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder();
@@ -21,4 +21,18 @@ public class Gps103ProtocolEncoderTest extends ProtocolTest {
}
+ @Test
+ public void testEncodeCustom() throws Exception {
+
+ Gps103ProtocolEncoder encoder = new Gps103ProtocolEncoder();
+
+ Command command = new Command();
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_CUSTOM);
+ command.set(Command.KEY_DATA, "H,080");
+
+ Assert.assertEquals("**,imei:123456789012345,H,080", encoder.encodeCommand(command));
+
+ }
+
}