diff options
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/protocol/WatchProtocolEncoderTest.java | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/WatchProtocolEncoderTest.java b/test/org/traccar/protocol/WatchProtocolEncoderTest.java new file mode 100644 index 000000000..c7cf584c4 --- /dev/null +++ b/test/org/traccar/protocol/WatchProtocolEncoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Assert; +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +public class WatchProtocolEncoderTest extends ProtocolTest { + + @Test + public void testEncode() throws Exception { + + WatchProtocolEncoder encoder = new WatchProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_POSITION_PERIODIC); + command.set(Command.KEY_FREQUENCY, 300); + + Assert.assertEquals("**,imei:123456789012345,C,05m", encoder.encodeCommand(command)); + + } + +} |