From 3593df6595cb1af169098ea2e7594fc3480648d0 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 30 Nov 2016 03:09:20 +1300 Subject: Implement GPS103 custom command --- test/org/traccar/protocol/Gps103ProtocolEncoderTest.java | 16 +++++++++++++++- 1 file changed, 15 insertions(+), 1 deletion(-) (limited to 'test/org') 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)); + + } + } -- cgit v1.2.3