diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2016-04-25 12:30:44 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2016-04-25 12:30:44 +1200 |
commit | 3d9b8bdd2a4df0ef055e3dd064209fc5c3e8401d (patch) | |
tree | 03759d24808581f8234c8d1f62d3d22e75d37499 /test/org/traccar | |
parent | dceebc4430b3df2f4033b6d9cace29e58d94cefa (diff) | |
download | traccar-server-3d9b8bdd2a4df0ef055e3dd064209fc5c3e8401d.tar.gz traccar-server-3d9b8bdd2a4df0ef055e3dd064209fc5c3e8401d.tar.bz2 traccar-server-3d9b8bdd2a4df0ef055e3dd064209fc5c3e8401d.zip |
Start implementing watch commands
Diffstat (limited to 'test/org/traccar')
-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)); + + } + +} |