From 3d9b8bdd2a4df0ef055e3dd064209fc5c3e8401d Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 25 Apr 2016 12:30:44 +1200 Subject: Start implementing watch commands --- .../traccar/protocol/WatchProtocolEncoderTest.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/org/traccar/protocol/WatchProtocolEncoderTest.java (limited to 'test/org/traccar') 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)); + + } + +} -- cgit v1.2.3