From 7185a24a275dd9f17b364480d4a3641c2cc05bc8 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 25 Apr 2016 19:02:31 +1200 Subject: Finish watch commands implementation --- .../traccar/protocol/WatchProtocolEncoderTest.java | 23 +++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) (limited to 'test/org') diff --git a/test/org/traccar/protocol/WatchProtocolEncoderTest.java b/test/org/traccar/protocol/WatchProtocolEncoderTest.java index 3f9e8328c..4e707a47b 100644 --- a/test/org/traccar/protocol/WatchProtocolEncoderTest.java +++ b/test/org/traccar/protocol/WatchProtocolEncoderTest.java @@ -12,12 +12,25 @@ public class WatchProtocolEncoderTest extends ProtocolTest { WatchProtocolEncoder encoder = new WatchProtocolEncoder(); - Command command = new Command(); + Command 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)); + command.setType(Command.TYPE_REBOOT_DEVICE); + Assert.assertEquals("[CS*123456789012345*0005*RESET]", encoder.encodeCommand(command)); + + command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_SOS_NUMBER); + command.set(Command.KEY_INDEX, 1); + command.set(Command.KEY_PHONE, "123456789"); + Assert.assertEquals("[CS*123456789012345*000e*SOS1,123456789]", encoder.encodeCommand(command)); + + command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_VOICE_MESSAGE); + command.set(Command.KEY_DATA, "3333"); + Assert.assertEquals("[CS*123456789012345*0005*TK,33]", encoder.encodeCommand(command)); } -- cgit v1.2.3