aboutsummaryrefslogtreecommitdiff
path: root/test/org
diff options
context:
space:
mode:
Diffstat (limited to 'test/org')
-rw-r--r--test/org/traccar/ProtocolDecoderTest.java12
-rw-r--r--test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java3
2 files changed, 11 insertions, 4 deletions
diff --git a/test/org/traccar/ProtocolDecoderTest.java b/test/org/traccar/ProtocolDecoderTest.java
index 8f7ed628b..5d2acdda1 100644
--- a/test/org/traccar/ProtocolDecoderTest.java
+++ b/test/org/traccar/ProtocolDecoderTest.java
@@ -119,21 +119,25 @@ public class ProtocolDecoderTest {
}
protected void verifyPositions(BaseProtocolDecoder decoder, Object object) throws Exception {
- verifyDecodedList(decoder.decode(null, null, object), null);
+ verifyDecodedList(decoder.decode(null, null, object), true, null);
+ }
+
+ protected void verifyPositions(BaseProtocolDecoder decoder, boolean checkLocation, Object object) throws Exception {
+ verifyDecodedList(decoder.decode(null, null, object), checkLocation, null);
}
protected void verifyPositions(BaseProtocolDecoder decoder, Object object, Position position) throws Exception {
- verifyDecodedList(decoder.decode(null, null, object), position);
+ verifyDecodedList(decoder.decode(null, null, object), true, position);
}
- private void verifyDecodedList(Object decodedObject, Position expected) {
+ private void verifyDecodedList(Object decodedObject, boolean checkLocation, Position expected) {
Assert.assertNotNull("list is null", decodedObject);
Assert.assertTrue("not a list", decodedObject instanceof List);
Assert.assertFalse("list if empty", ((List) decodedObject).isEmpty());
for (Object item : (List) decodedObject) {
- verifyDecodedPosition(item, true, false, expected);
+ verifyDecodedPosition(item, checkLocation, false, expected);
}
}
diff --git a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
index 7e3f7cb35..9e3c9a377 100644
--- a/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
@@ -16,6 +16,9 @@ public class TeltonikaProtocolDecoderTest extends ProtocolDecoderTest {
verifyNothing(decoder, binary(
"000F313233343536373839303132333435"));
+ verifyPositions(decoder, false, binary(
+ "0000000000000055070450aa14320201f00150aa17f3031f42332a4c4193d68c008d00020901f00150aa1b6a031f423383f54193624f009d00000a01f00150aa1c230fc01a0000552b040164f400dd00f0010143100c0105000000050400006846"));
+
verifyPositions(decoder, binary(
"000000000000003508010000014f8e016420002141bbaf0f4e96a7fffa0000120000000602010047030242669c92000002c7000000009100000000000100002df3"));