aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 12:38:54 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-26 12:38:54 +1300
commit0d064e99c1078fe9deb1658d1daa6802ff4685e5 (patch)
treec822be74eb691a361b7ee33dec79eca024e5e4c1 /test/org/traccar
parent4acc359d664db81242f6c3a1a7a6dedcf2ab465a (diff)
downloadtrackermap-server-0d064e99c1078fe9deb1658d1daa6802ff4685e5.tar.gz
trackermap-server-0d064e99c1078fe9deb1658d1daa6802ff4685e5.tar.bz2
trackermap-server-0d064e99c1078fe9deb1658d1daa6802ff4685e5.zip
Modify PT502 frame decoder
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/protocol/Pt502FrameDecoderTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/Pt502FrameDecoderTest.java b/test/org/traccar/protocol/Pt502FrameDecoderTest.java
new file mode 100644
index 000000000..54bff5484
--- /dev/null
+++ b/test/org/traccar/protocol/Pt502FrameDecoderTest.java
@@ -0,0 +1,26 @@
+package org.traccar.protocol;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolDecoderTest;
+
+import java.nio.ByteOrder;
+
+public class Pt502FrameDecoderTest extends ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ Pt502FrameDecoder decoder = new Pt502FrameDecoder();
+
+ Assert.assertEquals(
+ binary("24504f532c3335333435313030303136342c3038323430352e3030302c412c313235342e383530312c4e2c31303035312e363735322c452c302e30302c3233372e39392c3136303531332c2c2c412f303030302c302f302f35353030302f2f6137312f"),
+ decoder.decode(null, null, binary("24504f532c3335333435313030303136342c3038323430352e3030302c412c313235342e383530312c4e2c31303035312e363735322c452c302e30302c3233372e39392c3136303531332c2c2c412f303030302c302f302f35353030302f2f6137312f0d0a")));
+
+ Assert.assertEquals(
+ binary("24504f532c3335333435313030303136342c3038323430352e3030302c412c313235342e383530312c4e2c31303035312e363735322c452c302e30302c3233372e39392c3136303531332c2c2c412f303030302c302f302f35353030302f2f6137312f"),
+ decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "bffb1b6a0024504f532c3335333435313030303136342c3038323430352e3030302c412c313235342e383530312c4e2c31303035312e363735322c452c302e30302c3233372e39392c3136303531332c2c2c412f303030302c302f302f35353030302f2f6137312f0d0a")));
+
+ }
+
+}