aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/MegastekFrameDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-12-21 15:29:27 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-12-21 15:29:27 +1300
commitaff70bdec220c4fb0c2b6dd05a2e858db383cefc (patch)
treeef4d4d47cee8218abbfaf163a5452acb6521c9c4 /test/org/traccar/protocol/MegastekFrameDecoderTest.java
parent00ff8ce695d3a9baeaf999fd481bc2e897c84d7f (diff)
downloadtrackermap-server-aff70bdec220c4fb0c2b6dd05a2e858db383cefc.tar.gz
trackermap-server-aff70bdec220c4fb0c2b6dd05a2e858db383cefc.tar.bz2
trackermap-server-aff70bdec220c4fb0c2b6dd05a2e858db383cefc.zip
Implement new Megastek message format
Diffstat (limited to 'test/org/traccar/protocol/MegastekFrameDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/MegastekFrameDecoderTest.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/MegastekFrameDecoderTest.java b/test/org/traccar/protocol/MegastekFrameDecoderTest.java
new file mode 100644
index 000000000..c2a8f4ecd
--- /dev/null
+++ b/test/org/traccar/protocol/MegastekFrameDecoderTest.java
@@ -0,0 +1,28 @@
+package org.traccar.protocol;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class MegastekFrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ MegastekFrameDecoder decoder = new MegastekFrameDecoder();
+
+ Assert.assertEquals(
+ binary("30313337244d47563030322c3335343535303035303239323636392c4756543930302c522c3134313231352c3033313830342c412c2c532c2c452c30302c30332c30302c332e36372c302e3030302c302e30302c3131372e312c302e302c3531302c31302c2c2c2c303030302c303030302c32322c31322c302c202c202c2c312d312c39382c5057204f4e3b21"),
+ decoder.decode(null, null, binary("30313337244d47563030322c3335343535303035303239323636392c4756543930302c522c3134313231352c3033313830342c412c2c532c2c452c30302c30332c30302c332e36372c302e3030302c302e30302c3131372e312c302e302c3531302c31302c2c2c2c303030302c303030302c32322c31322c302c202c202c2c312d312c39382c5057204f4e3b21")));
+
+ Assert.assertEquals(
+ binary("244d47563030322c3031333737373030373533363433342c2c522c3031303131342c3030303035372c562c303030302e303030302c4e2c30303030302e303030302c452c30302c30302c30302c39392e392c302e3030302c302e30302c302e302c38302e3236332c3531302c38392c323334322c303330422c2c303030302c303030302c3230302c39362c302c202c202c2c2c2c54696d65723b21"),
+ decoder.decode(null, null, binary("244d47563030322c3031333737373030373533363433342c2c522c3031303131342c3030303035372c562c303030302e303030302c4e2c30303030302e303030302c452c30302c30302c30302c39392e392c302e3030302c302e30302c302e302c38302e3236332c3531302c38392c323334322c303330422c2c303030302c303030302c3230302c39362c302c202c202c2c2c2c54696d65723b210d0a")));
+
+ Assert.assertEquals(
+ binary("53545832363034373520202020202020202020024f244750524d432c3133313131302e30302c562c2c2c2c2c2c2c3036303931332c2c2c4e2a37362c3232322c30312c383135412c443435352c31312c39372c303030302c303030312c302c54696d65723b3735"),
+ decoder.decode(null, null, binary("53545832363034373520202020202020202020024f244750524d432c3133313131302e30302c562c2c2c2c2c2c2c3036303931332c2c2c4e2a37362c3232322c30312c383135412c443435352c31312c39372c303030302c303030312c302c54696d65723b37350d0a")));
+
+ }
+
+}