From 3ac49cd8e224887e9a5f8b7a1787183fbdb0e73f Mon Sep 17 00:00:00 2001 From: Valerii Vyshniak Date: Sat, 18 Nov 2017 00:56:52 +0100 Subject: T580W: Commands --- .../traccar/protocol/Tk103ProtocolEncoderTest.java | 52 ++++++++++++++++++++++ 1 file changed, 52 insertions(+) (limited to 'test/org/traccar/protocol') diff --git a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java index afc3b2387..8439f8d48 100644 --- a/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Tk103ProtocolEncoderTest.java @@ -99,4 +99,56 @@ public class Tk103ProtocolEncoderTest extends ProtocolTest { } + @Test + public void testEncodeT580WRebootDevice() throws Exception { + + Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType("T580W_rebootDevice"); + + Assert.assertEquals("[begin]sms2,88888888,[end]", encoder.encodeCommand(command)); + + } + + @Test + public void testEncodeT580WSosOn() throws Exception { + + Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType("T580W_alarmSosOn"); + + Assert.assertEquals("[begin]sms2,*soson*,[end]", encoder.encodeCommand(command)); + + } + + @Test + public void testEncodeT580WSosOff() throws Exception { + + Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType("T580W_alarmSosOff"); + + Assert.assertEquals("[begin]sms2,*sosoff*,[end]", encoder.encodeCommand(command)); + + } + + @Test + public void testEncodeT580WRouteTrack() throws Exception { + + Tk103ProtocolEncoder encoder = new Tk103ProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType("T580W_positionRealtime"); + + Assert.assertEquals("[begin]sms2,*routetrack*99*,[end]", encoder.encodeCommand(command)); + + } + } -- cgit v1.2.3