aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/Pt502ProtocolEncoderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar/protocol/Pt502ProtocolEncoderTest.java')
-rw-r--r--test/org/traccar/protocol/Pt502ProtocolEncoderTest.java14
1 files changed, 14 insertions, 0 deletions
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
@@ -8,6 +8,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 {
Pt502ProtocolEncoder encoder = new Pt502ProtocolEncoder();