aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/TotemFrameDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 11:38:04 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 11:38:04 +1300
commit511b1807da62c225afc70d45f6eb047382d242a9 (patch)
tree1a7bd7776d34ab65e8608bbec6ba4f4793c6660f /test/org/traccar/protocol/TotemFrameDecoderTest.java
parenta1081fad2f0b4fa1668ee2eb175d7c71fcc8ae8c (diff)
downloadtrackermap-server-511b1807da62c225afc70d45f6eb047382d242a9.tar.gz
trackermap-server-511b1807da62c225afc70d45f6eb047382d242a9.tar.bz2
trackermap-server-511b1807da62c225afc70d45f6eb047382d242a9.zip
Modify Totem frame decoder
Diffstat (limited to 'test/org/traccar/protocol/TotemFrameDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/TotemFrameDecoderTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/TotemFrameDecoderTest.java b/test/org/traccar/protocol/TotemFrameDecoderTest.java
new file mode 100644
index 000000000..4979f430a
--- /dev/null
+++ b/test/org/traccar/protocol/TotemFrameDecoderTest.java
@@ -0,0 +1,24 @@
+package org.traccar.protocol;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolDecoderTest;
+
+public class TotemFrameDecoderTest extends ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ TotemFrameDecoder decoder = new TotemFrameDecoder();
+
+ Assert.assertEquals(
+ binary("242442393335363839353033373537383531387c4141244750524d432c3036313730382e3030302c412c333734302e323033332c4e2c30323132382e383132312c452c33382e38352c3237322e33362c3132313131332c2c2c412a35327c30322e337c30312e337c30312e397c3030303030303030303030307c32303133313131323036313730387c31343034313430327c30303030303030307c30303245323137317c303030307c302e323137327c383930327c34463945"),
+ decoder.decode(null, null, binary("242442393335363839353033373537383531387c4141244750524d432c3036313730382e3030302c412c333734302e323033332c4e2c30323132382e383132312c452c33382e38352c3237322e33362c3132313131332c2c2c412a35327c30322e337c30312e337c30312e397c3030303030303030303030307c32303133313131323036313730387c31343034313430327c30303030303030307c30303245323137317c303030307c302e323137327c383930327c344639450d0a")));
+
+ Assert.assertEquals(
+ binary("242442393335363839353033373537383531387c4141244750524d432c3036313730382e3030302c412c333734302e323033332c4e2c30323132382e383132312c452c33382e38352c3237322e33362c3132313131332c2c2c412a35327c30322e337c30312e337c30312e397c3030303030303030303030307c32303133313131323036313730387c31343034313430327c30303030303030307c30303245323137317c303030307c302e323137327c383930327c34463945"),
+ decoder.decode(null, null, binary("0d0a242442393335363839353033373537383531387c4141244750524d432c3036313730382e3030302c412c333734302e323033332c4e2c30323132382e383132312c452c33382e38352c3237322e33362c3132313131332c2c2c412a35327c30322e337c30312e337c30312e397c3030303030303030303030307c32303133313131323036313730387c31343034313430327c30303030303030307c30303245323137317c303030307c302e323137327c383930327c344639450d0a")));
+
+ }
+
+}