aboutsummaryrefslogtreecommitdiff
path: root/test/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-08-11 01:38:22 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-08-11 01:38:22 +1200
commitc72c0b15ea8cfd0d2642e05af94a876fe525e447 (patch)
treeb9d39e8597e1d9f672f27d06fdb8a2b2ec3b77fb /test/org
parent4c315abb231562bd90ccd97c8db945dde9ee80c9 (diff)
downloadtrackermap-server-c72c0b15ea8cfd0d2642e05af94a876fe525e447.tar.gz
trackermap-server-c72c0b15ea8cfd0d2642e05af94a876fe525e447.tar.bz2
trackermap-server-c72c0b15ea8cfd0d2642e05af94a876fe525e447.zip
Implement Aplicom protocol (fix #202)
Diffstat (limited to 'test/org')
-rw-r--r--test/org/traccar/protocol/AplicomProtocolDecoderTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/AplicomProtocolDecoderTest.java b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java
new file mode 100644
index 000000000..a9f53c4c4
--- /dev/null
+++ b/test/org/traccar/protocol/AplicomProtocolDecoderTest.java
@@ -0,0 +1,24 @@
+package org.traccar.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffers;
+import static org.junit.Assert.assertNotNull;
+import org.junit.Test;
+import org.traccar.helper.ChannelBufferTools;
+
+public class AplicomProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ AplicomProtocolDecoder decoder = new AplicomProtocolDecoder(null);
+ decoder.setDataManager(new TestDataManager());
+
+ int[] buf1 = {0x44,0xC2,0x01,0x43,0x72,0x07,0x29,0xD6,0x84,0x00,0x43,0x03,0x1f,0xff,0x71,0x91,0xC0,0x45,0x0e,0xf9,0x06,0x45,0x0e,0xf9,0x06,0x03,0xb2,0x0b,0x80,0x03,0xb2,0x0b,0x80,0x06,0x64,0x65,0xb3,0x87,0x0c,0xe3,0x0f,0x01,0x0c,0xe3,0x0c,0xe3,0x00,0x32,0x00,0x00,0x15,0x20,0x00,0x00,0x00,0x03,0x0a,0xa2,0x00,0x00,0x3b,0x13,0x00,0x00,0x00,0x32,0x03,0x00,0x00,0x0b,0xcb,0x17,0xac,0xff,0x00,0x99,0x00,0x01,0x86,0xa0,0x02};
+ assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf1))));
+
+ int[] buf2 = {0x44,0x01,0x29,0xD6,0x84,0x00,0x2b,0x07,0x00,0xC0,0x45,0x0e,0xf9,0x06,0x45,0x0e,0xf9,0x06,0x03,0xb2,0x0b,0x80,0x03,0xb2,0x0b,0x80,0x06,0x64,0x65,0xb3,0x87,0x0c,0xe3,0x0f,0x01,0x0c,0xe3,0x0c,0xe3,0x00,0x00,0x3b,0x13,0x03,0x00,0x00,0x0b,0xcb,0x17,0xa};
+ assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf2))));
+
+ }
+
+}