diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2014-05-25 12:08:46 +1200 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2014-05-25 12:08:46 +1200 |
commit | 36f9cfdee90a4fad82a3e23186fd3d19e01dc025 (patch) | |
tree | 59996484c7a7ad5e6bfae38c30791a7d6b1f600d /test | |
parent | 31884de2de46e689b57c81997d14c6c538f88dde (diff) | |
download | trackermap-server-36f9cfdee90a4fad82a3e23186fd3d19e01dc025.tar.gz trackermap-server-36f9cfdee90a4fad82a3e23186fd3d19e01dc025.tar.bz2 trackermap-server-36f9cfdee90a4fad82a3e23186fd3d19e01dc025.zip |
Implement eeLink protocol
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/protocol/EelinkProtocolDecoderTest.java | 29 |
1 files changed, 29 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/EelinkProtocolDecoderTest.java b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java new file mode 100644 index 000000000..121ce3214 --- /dev/null +++ b/test/org/traccar/protocol/EelinkProtocolDecoderTest.java @@ -0,0 +1,29 @@ +package org.traccar.protocol; + +import org.traccar.helper.TestDataManager; +import org.jboss.netty.buffer.ChannelBuffers; +import static org.traccar.helper.DecoderVerifier.verify; +import static org.junit.Assert.assertNull; +import org.junit.Test; +import org.traccar.helper.ChannelBufferTools; + +public class EelinkProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + EelinkProtocolDecoder decoder = new EelinkProtocolDecoder(null); + decoder.setDataManager(new TestDataManager()); + + assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( + new int[] {0x67,0x67,0x01,0x00,0x0b,0x00,0x1b,0x03,0x54,0x18,0x80,0x46,0x61,0x83,0x49,0x01})))); + + assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( + new int[] {0x67,0x67,0x03,0x00,0x04,0x00,0x1A,0x00,0x01})))); + + assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray( + new int[] {0x67,0x67,0x07,0x00,0x88,0x00,0x10,0x50,0xE2,0x28,0x14,0x00,0xFF,0xFF,0xFF,0xFF,0x02,0x33,0x44,0x55,0x66,0x03,0x33,0x44,0x55,0x66,0x04,0x33,0x44,0x55,0x66,0x05,0xAA,0x00,0x00,0x00,0x07,0x33,0x44,0x55,0x66,0x0A,0x33,0x44,0x55,0x66,0x0B,0x33,0x44,0x55,0x66,0x0C,0x4E,0x20,0x00,0x00,0x0D,0xAA,0x00,0x00,0x00,0x0E,0x33,0x44,0x55,0x66,0x0F,0x33,0x44,0x55,0x66,0x10,0xAA,0xAA,0x00,0x00,0x11,0x33,0x44,0x55,0x66,0x1C,0x33,0x44,0x55,0x66,0x1F,0x33,0x44,0x55,0x66,0x21,0x33,0x44,0x55,0x66,0x42,0x33,0x44,0x55,0x66,0x46,0x33,0x44,0x55,0x66,0x4D,0x33,0x44,0x55,0x66,0x5C,0x33,0x44,0x55,0x66,0x5E,0x33,0x44,0x55,0x66,0x88,0x00,0x00,0x00,0x00,0x89,0x00,0x00,0x00,0x00,0x8A,0x00,0x00,0x00,0x00,0x8B,0x00,0x00,0x00,0x00})))); + + } + +} |