From 4f01c0906b74a9926d83befca46f8f6512730ec9 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Wed, 10 Sep 2014 22:49:18 +1200 Subject: Implement Riti protocol --- .../traccar/protocol/RitiProtocolDecoderTest.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/org/traccar/protocol/RitiProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/test/org/traccar/protocol/RitiProtocolDecoderTest.java b/test/org/traccar/protocol/RitiProtocolDecoderTest.java new file mode 100644 index 000000000..2f77a4fc1 --- /dev/null +++ b/test/org/traccar/protocol/RitiProtocolDecoderTest.java @@ -0,0 +1,24 @@ +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; +import org.traccar.helper.TestDataManager; + +public class RitiProtocolDecoderTest { + + @Test + public void testDecode() throws Exception { + + RitiProtocolDecoder decoder = new RitiProtocolDecoder(null); + decoder.setDataManager(new TestDataManager()); + + verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ByteOrder.LITTLE_ENDIAN, ChannelBufferTools.convertArray( + new int[] {0x3b,0x28,0x64,0xa3,0x05,0x63,0x00,0x00,0x6d,0x40,0x00,0x00,0x03,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x24,0x47,0x50,0x52,0x4d,0x43,0x2c,0x32,0x31,0x31,0x37,0x34,0x33,0x2e,0x30,0x30,0x30,0x2c,0x41,0x2c,0x31,0x33,0x35,0x37,0x2e,0x33,0x36,0x37,0x35,0x2c,0x4e,0x2c,0x31,0x30,0x30,0x33,0x36,0x2e,0x36,0x39,0x39,0x32,0x2c,0x45,0x2c,0x30,0x2e,0x30,0x30,0x2c,0x2c,0x30,0x31,0x30,0x39,0x31,0x34,0x2c,0x2c,0x2c,0x41,0x2a,0x37,0x38,0x0d,0x0a,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x00,0x04,0x04,0x04})))); + + } + +} -- cgit v1.2.3