aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/CastelProtocolDecoderTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-05-31 20:07:39 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-05-31 20:07:39 +1200
commit57672030502b403fddd6a8f6b0a5dde35202c9c3 (patch)
treea3f7623a0035202acfe5ba9855ee3ae391104e26 /test/org/traccar/protocol/CastelProtocolDecoderTest.java
parent70863c500e4cba47eb09b08848a2105ebb108e31 (diff)
downloadtrackermap-server-57672030502b403fddd6a8f6b0a5dde35202c9c3.tar.gz
trackermap-server-57672030502b403fddd6a8f6b0a5dde35202c9c3.tar.bz2
trackermap-server-57672030502b403fddd6a8f6b0a5dde35202c9c3.zip
Implement Castel protocol
Diffstat (limited to 'test/org/traccar/protocol/CastelProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/CastelProtocolDecoderTest.java28
1 files changed, 28 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/CastelProtocolDecoderTest.java b/test/org/traccar/protocol/CastelProtocolDecoderTest.java
new file mode 100644
index 000000000..71d34bc5e
--- /dev/null
+++ b/test/org/traccar/protocol/CastelProtocolDecoderTest.java
@@ -0,0 +1,28 @@
+package org.traccar.protocol;
+
+import java.nio.ByteOrder;
+import org.jboss.netty.buffer.ChannelBuffers;
+import static org.junit.Assert.assertNull;
+import org.junit.Test;
+import org.traccar.helper.ChannelBufferTools;
+import static org.traccar.helper.DecoderVerifier.verify;
+
+public class CastelProtocolDecoderTest extends ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ CastelProtocolDecoder decoder = new CastelProtocolDecoder(null);
+
+ assertNull(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
+ "40401F00043130303131313235323939383700000000000000100303320D0A"))));
+
+ verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
+ "40407F000431303031313132353239393837000000000000001001C1F06952FDF069529C91110000000000698300000C0000000000036401014C00030001190A0D04121A1480D60488C5721800000000AF4944445F3231364730325F532056312E322E31004944445F3231364730325F482056312E322E31000000DF640D0A"))));
+
+ //verify(decoder.decode(null, null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertHexString(
+ // "404057000431303031313132353239393837000000000000004002C1F06952F0F169529C9111000000000069830000470000000400036401014C01030078000505210C210D210F21102101073BE8030064280AEB930D0A"))));
+
+ }
+
+}