aboutsummaryrefslogtreecommitdiff
path: root/test/org
diff options
context:
space:
mode:
authorninioe <ninioe@gmail.com>2016-07-19 09:07:23 +0300
committerninioe <ninioe@gmail.com>2016-07-19 09:07:23 +0300
commitef40f3317392068692606b484c6782b95b554cbf (patch)
tree41c48e6c87620a6444aed0ad5706a94e26b1662d /test/org
parent04627d7473e4ea21d6ecd950cbb3fdd6fa249429 (diff)
parentd3e063cf9de8a45bed4dfe87b73aadfd8d2edeab (diff)
downloadtrackermap-server-ef40f3317392068692606b484c6782b95b554cbf.tar.gz
trackermap-server-ef40f3317392068692606b484c6782b95b554cbf.tar.bz2
trackermap-server-ef40f3317392068692606b484c6782b95b554cbf.zip
Merge remote-tracking branch 'refs/remotes/tananaev/master'
Diffstat (limited to 'test/org')
-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"));
+
+ }
+
+}