aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/WatchFrameDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2017-05-31 21:21:20 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2017-05-31 21:21:20 +1200
commitea8730325866dbe61e873adcfc8d5875bf7b9be1 (patch)
treede006b7e2b206918a98c5d0d9b850ef3809ce0df /test/org/traccar/protocol/WatchFrameDecoderTest.java
parentc3be37febe85bbaa69b7112f6d9a04b19b8b9253 (diff)
downloadtraccar-server-ea8730325866dbe61e873adcfc8d5875bf7b9be1.tar.gz
traccar-server-ea8730325866dbe61e873adcfc8d5875bf7b9be1.tar.bz2
traccar-server-ea8730325866dbe61e873adcfc8d5875bf7b9be1.zip
Implement custom Watch frame decoder
Diffstat (limited to 'test/org/traccar/protocol/WatchFrameDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/WatchFrameDecoderTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/WatchFrameDecoderTest.java b/test/org/traccar/protocol/WatchFrameDecoderTest.java
new file mode 100644
index 000000000..c705b24b3
--- /dev/null
+++ b/test/org/traccar/protocol/WatchFrameDecoderTest.java
@@ -0,0 +1,24 @@
+package org.traccar.protocol;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class WatchFrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ WatchFrameDecoder decoder = new WatchFrameDecoder();
+
+ Assert.assertEquals(
+ binary("5b33472a383330383430363237392a303030382a72636170747572655d"),
+ decoder.decode(null, null, binary("5b33472a383330383430363237392a303030382a72636170747572655d")));
+
+ Assert.assertEquals(
+ binary("5b33472a383330383430363237392a303030392a4c4b2c302c302c38345d"),
+ decoder.decode(null, null, binary("5b33472a383330383430363237392a303030392a4c4b2c302c302c38345d")));
+
+ }
+
+}