From cac3ddae39938a0d25c9b2a1f7fa87ecb9dd2b77 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 11 Jun 2018 21:27:36 +1200 Subject: Implement eSeal commands --- .../traccar/protocol/EsealProtocolEncoderTest.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/org/traccar/protocol/EsealProtocolEncoderTest.java (limited to 'test') diff --git a/test/org/traccar/protocol/EsealProtocolEncoderTest.java b/test/org/traccar/protocol/EsealProtocolEncoderTest.java new file mode 100644 index 000000000..16f00d69b --- /dev/null +++ b/test/org/traccar/protocol/EsealProtocolEncoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; +import org.traccar.model.Command; + +import static org.junit.Assert.assertEquals; + +public class EsealProtocolEncoderTest extends ProtocolTest { + + @Test + public void testEncode() throws Exception { + + EsealProtocolEncoder encoder = new EsealProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_ALARM_DISARM); + + assertEquals("##S,eSeal,123456789012345,256,3.0.8,RC-Unlock,E##", encoder.encodeCommand(command)); + + } + +} -- cgit v1.2.3