aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-11-24 15:52:52 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-11-24 15:53:10 +1300
commit04f33e6ba29b3a73a65b081d2a8b6ac3e0e0ebee (patch)
tree5051340b36b3370ede71d84208189c9aee23f901 /test
parent7269b9b32ef8f75fc0fbd1c64d4d4748c731ce04 (diff)
downloadtrackermap-server-04f33e6ba29b3a73a65b081d2a8b6ac3e0e0ebee.tar.gz
trackermap-server-04f33e6ba29b3a73a65b081d2a8b6ac3e0e0ebee.tar.bz2
trackermap-server-04f33e6ba29b3a73a65b081d2a8b6ac3e0e0ebee.zip
Implement Teltonika AT200 protocol
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/protocol/At2000FrameDecoderTest.java26
-rw-r--r--test/org/traccar/protocol/At2000ProtocolDecoderTest.java24
2 files changed, 50 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/At2000FrameDecoderTest.java b/test/org/traccar/protocol/At2000FrameDecoderTest.java
new file mode 100644
index 000000000..c7a3dc0b1
--- /dev/null
+++ b/test/org/traccar/protocol/At2000FrameDecoderTest.java
@@ -0,0 +1,26 @@
+package org.traccar.protocol;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+import java.nio.ByteOrder;
+
+public class At2000FrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ At2000FrameDecoder decoder = new At2000FrameDecoder();
+
+ Assert.assertEquals(
+ binary(ByteOrder.LITTLE_ENDIAN, "01012f00000000000000000000000000003335363137333036343430373439320fad981997ae8e031fe10c0ea7641903ca32c0331df467233d2a9cd886fbeef8"),
+ decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "01012f00000000000000000000000000003335363137333036343430373439320fad981997ae8e031fe10c0ea7641903ca32c0331df467233d2a9cd886fbeef8")));
+
+ Assert.assertEquals(
+ binary(ByteOrder.LITTLE_ENDIAN, "893f0000000000000000000000000000e048b1a31deba3f5dbe8877f574877e6ed4d022b6611a10d80dfc4c0c11fa8aacf4a9de61528327e2b66843dd9c5d3a7cc9ee1d9c71a34bb482145d88b4fda3e"),
+ decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "893f0000000000000000000000000000e048b1a31deba3f5dbe8877f574877e6ed4d022b6611a10d80dfc4c0c11fa8aacf4a9de61528327e2b66843dd9c5d3a7cc9ee1d9c71a34bb482145d88b4fda3e")));
+
+ }
+
+}
diff --git a/test/org/traccar/protocol/At2000ProtocolDecoderTest.java b/test/org/traccar/protocol/At2000ProtocolDecoderTest.java
new file mode 100644
index 000000000..14c6920d0
--- /dev/null
+++ b/test/org/traccar/protocol/At2000ProtocolDecoderTest.java
@@ -0,0 +1,24 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class At2000ProtocolDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ At2000ProtocolDecoder decoder = new At2000ProtocolDecoder(new At2000Protocol());
+
+ verifyNothing(decoder, binary(
+ "01012f00000000000000000000000000003335363137333036343430373439320fad981997ae8e031fe10c0ea7641903ca32c0331df467233d2a9cd886fbeef8"));
+
+ verifyPosition(decoder, binary(
+ "893f0000000000000000000000000000e048b1a31deba3f5dbe8877f574877e6ed4d022b6611a10d80dfc4c0c11fa8aacf4a9de61528327e2b66843dd9c5d3a7cc9ee1d9c71a34bb482145d88b4fda3e"));
+
+ verifyNothing(decoder, binary(
+ "01012f00000000000000000000000000003335373435343037313632363831345612da3748bede02ea4faf04ac02f420c0ff37719eccf2864fa2b8191abf8242"));
+
+ }
+
+}