aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/ProtocolTest.java5
-rw-r--r--test/org/traccar/protocol/Gt06ProtocolDecoderTest.java3
-rw-r--r--test/org/traccar/protocol/T800xProtocolEncoderTest.java23
3 files changed, 31 insertions, 0 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java
index 503bc4c00..07a19b691 100644
--- a/test/org/traccar/ProtocolTest.java
+++ b/test/org/traccar/ProtocolTest.java
@@ -44,6 +44,11 @@ public class ProtocolTest {
public Device getDeviceByUniqueId(String uniqueId) {
return createDevice();
}
+
+ @Override
+ public Position getLastPosition(long deviceId) {
+ return null;
+ }
});
}
diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 94d665478..9201caac6 100644
--- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -13,6 +13,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyNothing(decoder, binary(
"787805120099abec0d0a"));
+ verifyAttributes(decoder, binary(
+ "797900089400000002e852d70d0a"));
+
verifyNothing(decoder, binary(
"78780D01086471700328358100093F040D0A"));
diff --git a/test/org/traccar/protocol/T800xProtocolEncoderTest.java b/test/org/traccar/protocol/T800xProtocolEncoderTest.java
new file mode 100644
index 000000000..af3700225
--- /dev/null
+++ b/test/org/traccar/protocol/T800xProtocolEncoderTest.java
@@ -0,0 +1,23 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+import org.traccar.model.Command;
+
+public class T800xProtocolEncoderTest extends ProtocolTest {
+
+ @Test
+ public void testEncode() throws Exception {
+
+ T800xProtocolEncoder encoder = new T800xProtocolEncoder();
+
+ Command command = new Command();
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_CUSTOM);
+ command.set(Command.KEY_DATA, "RELAY,0000,On#");
+
+ verifyCommand(encoder, command, binary("232381001e000101234567890123450152454c41592c303030302c4f6e23"));
+
+ }
+
+}