aboutsummaryrefslogtreecommitdiff
path: root/test/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-04-25 19:02:31 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2016-04-25 19:02:31 +1200
commit7185a24a275dd9f17b364480d4a3641c2cc05bc8 (patch)
treeeb5356cd32068528df32fbab9225bc88bb02308e /test/org
parent0f04b2a8355cb25071d4f01c2e2abc2858636c36 (diff)
downloadtraccar-server-7185a24a275dd9f17b364480d4a3641c2cc05bc8.tar.gz
traccar-server-7185a24a275dd9f17b364480d4a3641c2cc05bc8.tar.bz2
traccar-server-7185a24a275dd9f17b364480d4a3641c2cc05bc8.zip
Finish watch commands implementation
Diffstat (limited to 'test/org')
-rw-r--r--test/org/traccar/protocol/WatchProtocolEncoderTest.java23
1 files changed, 18 insertions, 5 deletions
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));
}