aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-04-11 09:56:59 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-04-11 09:56:59 +1200
commit662b552ba75c874ca1f1d67310f7004eb5da1991 (patch)
tree9ded9ac15160cd90a3d816b393eaceebf78ba10f /test
parent956e0c36b779ebe5b4cd753d6eca2d47caae9670 (diff)
downloadtrackermap-server-662b552ba75c874ca1f1d67310f7004eb5da1991.tar.gz
trackermap-server-662b552ba75c874ca1f1d67310f7004eb5da1991.tar.bz2
trackermap-server-662b552ba75c874ca1f1d67310f7004eb5da1991.zip
Add support for CalAmp protocol
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/protocol/CalAmpProtocolDecoderTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java
new file mode 100644
index 000000000..31336a66c
--- /dev/null
+++ b/test/org/traccar/protocol/CalAmpProtocolDecoderTest.java
@@ -0,0 +1,26 @@
+package org.traccar.protocol;
+
+import org.jboss.netty.buffer.ChannelBuffers;
+import org.junit.Test;
+import org.traccar.helper.ChannelBufferTools;
+import org.traccar.helper.TestDataManager;
+
+import static org.junit.Assert.assertNull;
+import static org.traccar.helper.DecoderVerifier.verify;
+
+public class CalAmpProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ CalAmpProtocolDecoder decoder = new CalAmpProtocolDecoder(new TestDataManager(), null, null);
+
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "830545420185450101010200075517fb335516c5c40fb1aea4cf4cbf250000000000000000008900260015ffb10f001108110a0000")), null));
+
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "830543321494750101010A00085492798A0EC4F9E71BDA3B81005600040F1F33050000030000000076000000000000000000000000")), null));
+
+ }
+
+}