diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-18 22:47:15 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-03-18 22:47:15 +1300 |
commit | d4f33f724b82154e3dd6f8fb8546cbc37b164ba5 (patch) | |
tree | 44dd18b5b9903e8623f55891c75eaec52d8cf07b /test/org | |
parent | 91436e6a790b6c01c7af7d6c73c8783896c6cd87 (diff) | |
download | trackermap-server-d4f33f724b82154e3dd6f8fb8546cbc37b164ba5.tar.gz trackermap-server-d4f33f724b82154e3dd6f8fb8546cbc37b164ba5.tar.bz2 trackermap-server-d4f33f724b82154e3dd6f8fb8546cbc37b164ba5.zip |
Add Cellocator protocol
Diffstat (limited to 'test/org')
-rw-r--r-- | test/org/traccar/protocol/CellocatorProtocolDecoderTest.java | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java new file mode 100644 index 000000000..f1128a93a --- /dev/null +++ b/test/org/traccar/protocol/CellocatorProtocolDecoderTest.java @@ -0,0 +1,21 @@ +package org.traccar.protocol; + +import java.nio.ByteOrder; +import org.jboss.netty.buffer.ChannelBuffers; +import static org.junit.Assert.assertNotNull; +import org.junit.Test; + +public class CellocatorProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + CellocatorProtocolDecoder decoder = new CellocatorProtocolDecoder(null); + decoder.setDataManager(new TestDataManager()); + + byte[] buf1 = {0x4D,0x43,0x47,0x50,0x00,0x06,0x00,0x00,0x00,0x08,0x1A,0x02,0x02,0x12,0x04,0x00,0x00,0x00,0x21,0x00,0x62,0x30,0x00,0x00,0x00,0x6B,0x00,(byte)0xE1,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,(byte)0xE5,(byte)0xA1,0x00,0x04,0x02,0x06,0x61,0x4E,(byte)0xA3,0x03,0x18,0x1A,0x57,0x03,0x4E,0x12,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x15,0x25,0x07,0x14,0x03,(byte)0xD6,0x07,0x49}; + assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, buf1))); + + } + +} |