From 9bc7deb97f2751ee0fd7e5ba198d2c030d149e01 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 28 Oct 2017 21:05:56 +1300 Subject: Extend Bofan PT600 support --- test/org/traccar/protocol/Pt502ProtocolEncoderTest.java | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'test') diff --git a/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java b/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java index 62406d3f2..39ca2fe65 100644 --- a/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java +++ b/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java @@ -7,6 +7,20 @@ import org.traccar.model.Command; public class Pt502ProtocolEncoderTest extends ProtocolTest { + @Test + public void testEncodeCustom() throws Exception { + + Pt502ProtocolEncoder encoder = new Pt502ProtocolEncoder(); + + Command command = new Command(); + command.setDeviceId(1); + command.setType(Command.TYPE_CUSTOM); + command.set(Command.KEY_DATA, "#PTI300"); + + Assert.assertEquals("#PTI300\r\n", encoder.encodeCommand(command)); + + } + @Test public void testEncodeOutputControl() throws Exception { -- cgit v1.2.3