aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2013-04-26 20:45:17 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2013-04-26 20:45:17 +1200
commit1e1e738dbf3f72e3c06aa7e89f980aaf50740625 (patch)
tree74386a4cd232cfb6648c5635d14ab451c2bcb3c2 /test/org/traccar/protocol
parent1cd60e56770fd3643be9e3dd163198e8b84992a7 (diff)
downloadtrackermap-server-1e1e738dbf3f72e3c06aa7e89f980aaf50740625.tar.gz
trackermap-server-1e1e738dbf3f72e3c06aa7e89f980aaf50740625.tar.bz2
trackermap-server-1e1e738dbf3f72e3c06aa7e89f980aaf50740625.zip
Add XT7 protocol support
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/Xt7ProtocolDecoderTest.java22
1 files changed, 22 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java
new file mode 100644
index 000000000..0f1194c73
--- /dev/null
+++ b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java
@@ -0,0 +1,22 @@
+package org.traccar.protocol;
+
+import org.jboss.netty.buffer.ChannelBufferFactory;
+import org.jboss.netty.buffer.HeapChannelBufferFactory;
+import static org.junit.Assert.assertNotNull;
+import org.junit.Test;
+
+public class Xt7ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ Xt7ProtocolDecoder decoder = new Xt7ProtocolDecoder(null);
+ decoder.setDataManager(new TestDataManager());
+ ChannelBufferFactory factory = new HeapChannelBufferFactory();
+
+ byte[] buf1 = {0x53,0x54,0x58,0x32,0x30,0x31,0x30,0x31,0x30,0x31,0x38,0x30,0x31,0x20,0x20,0x20,0x20,0x20,0x20,0x02,0x6A,0x24,0x47,0x50,0x52,0x4D,0x43,0x2C,0x31,0x30,0x31,0x30,0x35,0x33,0x2E,0x30,0x30,0x30,0x2C,0x41,0x2C,0x32,0x32,0x33,0x32,0x2E,0x37,0x36,0x30,0x37,0x2C,0x4E,0x2C,0x31,0x31,0x34,0x30,0x34,0x2E,0x37,0x36,0x36,0x39,0x2C,0x45,0x2C,0x30,0x2E,0x30,0x30,0x2C,0x2C,0x32,0x33,0x31,0x31,0x31,0x30,0x2C,0x2C,0x2C,0x41,0x2A,0x37,0x46,0x2C,0x34,0x36,0x30,0x2C,0x30,0x30,0x2C,0x32,0x37,0x39,0x35,0x2C,0x30,0x45,0x36,0x41,0x2C,0x31,0x34,0x2C,0x39,0x34,0x2C,0x31,0x30,0x30,0x30,0x2C,0x30,0x30,0x30,0x30,0x2C,0x39,0x31,0x2C,0x54,0x69,0x6D,0x65,0x72,0x3B,0x31,0x44,0x0D,0x0A};
+ assertNotNull(decoder.decode(null, null, factory.getBuffer(buf1, 0, buf1.length)));
+
+ }
+
+}