aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/protocol/Gt06ProtocolDecoderTest.java3
-rw-r--r--test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java36
-rw-r--r--test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java12
3 files changed, 9 insertions, 42 deletions
diff --git a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 3bcd2ec3a..46ee223ad 100644
--- a/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -16,6 +16,9 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
verifyNothing(decoder, binary(
"78780D01086471700328358100093F040D0A"));
+ verifyNotNull(decoder, binary(
+ "787866150000000000416c726561647920696e20746865207374617465206f66206675656c20737570706c7920746f20726573756d652c74686520636f6d6d616e64206973206e6f742072756e6e696e672100000000000000000000000000000000000001001981e50d0a"));
+
verifyAttributes(decoder, binary(
"78782d152500000000437574206f666620746865206675656c20737570706c793a2053756363657373210002013b898a0d0a"));
diff --git a/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java b/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java
deleted file mode 100644
index 524152bb8..000000000
--- a/test/org/traccar/protocol/MiniFinderProtocolEncoderTest.java
+++ /dev/null
@@ -1,36 +0,0 @@
-package org.traccar.protocol;
-
-import org.junit.Before;
-import org.junit.Test;
-import org.traccar.ProtocolTest;
-import org.traccar.model.Command;
-
-public class MiniFinderProtocolEncoderTest extends ProtocolTest {
-
- private String prefix = "123456";
- private MiniFinderProtocolEncoder encoder;
-
- @Before
- public void setup() {
- encoder = new MiniFinderProtocolEncoder();
- }
-
- @Test
- public void testEncodeCustom() throws Exception {
- String expected = String.format("%sM,700", prefix);
- Command command = new Command();
- command.setType(Command.TYPE_CUSTOM);
- command.set("raw", expected);
- Object encoded = encoder.encodeCommand(command);
- assert expected.equals(encoded);
- }
-
- @Test
- public void testEncodeUnsupportedCommand() throws Exception {
- Command command = new Command();
- command.setType("UNSUPPORTED");
- Object o = encoder.encodeCommand(command);
- assert o == null;
- }
-
-}
diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
index afedf7489..7da61ffc2 100644
--- a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
@@ -14,6 +14,9 @@ public class TeltonikaProtocolDecoderTest extends ProtocolTest {
"000F313233343536373839303132333435"));
verifyPositions(decoder, false, binary(
+ "00000000000000710c0106000000694154244d5347534e443d342c225354474234302c50522c3335363630313036303236353035302c313630343232313531372c313630343232313531382c432c2b3032332e332c302c2b3032332e312c302c4445414354492c302c4445414354492c302c312c30220d0a010000d8db"));
+
+ verifyPositions(decoder, false, binary(
"0000000000000055070450aa14320201f00150aa17f3031f42332a4c4193d68c008d00020901f00150aa1b6a031f423383f54193624f009d00000a01f00150aa1c230fc01a0000552b040164f400dd00f0010143100c0105000000050400006846"));
verifyPositions(decoder, binary(
@@ -36,13 +39,10 @@ public class TeltonikaProtocolDecoderTest extends ProtocolTest {
verifyPositions(decoder, binary(
"000000000000002b080100000140d4e3ec6e000cc661d01674a5e0fffc00000900000004020100f0000242322318000000000100007a04"));
-
- verifyNothing(decoder, binary(
+
+ verifyPositions(decoder, false, binary(
"000000000000002d0c01060000002523464d323d3236323033323736313732313339362c32363230332c30372e30322e30350d0a0100009a2e"));
-
- verifyNothing(decoder, binary(
- "000000000000000a0c0206000000020d0a0200006f4e"));
-
+
verifyPositions(decoder, binary(
"00000000000000a608010000013f14a1d1ce000f0eb790209a778000ab010c0500000000000000000100003390"));