aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 12:22:23 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 12:22:23 +1300
commit96f529e32083d916883c3757ac88012758fdc90c (patch)
tree9e5eed13666d3f5ecb5c15cfc6d9c3c69971a472 /test/org/traccar/protocol
parentd227bf37681dcfad55a9365e166b1a71742d3ae1 (diff)
downloadtrackermap-server-96f529e32083d916883c3757ac88012758fdc90c.tar.gz
trackermap-server-96f529e32083d916883c3757ac88012758fdc90c.tar.bz2
trackermap-server-96f529e32083d916883c3757ac88012758fdc90c.zip
Modify H02 frame decoder
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/H02FrameDecoderTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/H02FrameDecoderTest.java b/test/org/traccar/protocol/H02FrameDecoderTest.java
new file mode 100644
index 000000000..967aff027
--- /dev/null
+++ b/test/org/traccar/protocol/H02FrameDecoderTest.java
@@ -0,0 +1,26 @@
+package org.traccar.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffer;
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolDecoderTest;
+
+public class H02FrameDecoderTest extends ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ H02FrameDecoder decoder = new H02FrameDecoder();
+
+ Assert.assertEquals(
+ binary("2a48512c3335333538383036303031353536382c56312c3139333530352c412c3830392e303031302c532c333435342e383939372c572c302e30302c302e30302c3239313031332c65666666666266662c3030303264342c3030303030622c3030353338352c3030353261612c323523"),
+ decoder.decode(null, null, binary("2a48512c3335333538383036303031353536382c56312c3139333530352c412c3830392e303031302c532c333435342e383939372c572c302e30302c302e30302c3239313031332c65666666666266662c3030303264342c3030303030622c3030353338352c3030353261612c323523")));
+
+ Assert.assertEquals(
+ binary("24430025645511183817091319355128000465632432000100ffe7fbffff0000"),
+ decoder.decode(null, null, binary("24430025645511183817091319355128000465632432000100ffe7fbffff0000")));
+
+ }
+
+}