diff options
Diffstat (limited to 'test/org/traccar')
-rw-r--r-- | test/org/traccar/protocol/Gps103ProtocolEncoderTest.java | 16 |
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)); + + } + } |