From 70810f8205e725d0ca8faf9f322723182b1b49fe Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Sat, 26 Oct 2013 21:27:16 +1300 Subject: New meiligao test case --- test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'test') diff --git a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java index c822b0758..f053061e3 100644 --- a/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java +++ b/test/org/traccar/protocol/MeiligaoProtocolDecoderTest.java @@ -1,10 +1,12 @@ package org.traccar.protocol; import org.jboss.netty.buffer.ChannelBufferFactory; +import org.jboss.netty.buffer.ChannelBuffers; import org.jboss.netty.buffer.HeapChannelBufferFactory; import static org.junit.Assert.assertNotNull; import static org.junit.Assert.assertNull; import org.junit.Test; +import org.traccar.helper.ChannelBufferTools; public class MeiligaoProtocolDecoderTest { @@ -48,6 +50,9 @@ public class MeiligaoProtocolDecoderTest { byte[] buf11 = {0x26,0x01,0x61,0x00,(byte)0x90,0x1f,(byte)0xff,(byte)0x99,0x55,0x31,0x36,0x35,0x38,0x35,0x33,0x2c,0x41,0x2c,0x34,0x31,0x30,0x39,0x2e,0x36,0x30,0x32,0x31,0x32,0x2c,0x4e,0x2c,0x38,0x33,0x38,0x2e,0x35,0x39,0x31,0x31,0x39,0x2c,0x57,0x2c,0x33,0x2e,0x38,0x38,0x33,0x2c,0x31,0x32,0x2e,0x30,0x30,0x2c,0x30,0x34,0x30,0x37,0x31,0x33,0x2c,0x2c,0x2a,0x34,0x46,0x7c,0x32,0x2e,0x35,0x7c,0x31,0x31,0x30,0x7c,0x00,0x06,0x00,0x00,0x7c,0x00,0x00,0x01,0x0f,0x7c,0x30,0x32,0x42,0x30,0x2c,0x30,0x42,0x33,0x36,(byte)0x97,0x74,0x0d,0x0a}; assertNotNull(decoder.decode(null, null, factory.getBuffer(buf11, 0, buf11.length))); + int[] buf12 = {0x67,0x62,0x20,0x10,0x05,0x35,0x62,0xaa,0x00,0x00,0x01,0x00,0x01,0xae,0x4f,0x00,0x00,0x00,0x07,0x80,0x00,0x00,0x00,0x30,0x39,0x35,0x31,0x35,0x36,0x2e,0x30,0x30,0x30,0x2c,0x41,0x2c,0x32,0x36,0x32,0x33,0x2e,0x38,0x39,0x36,0x36,0x2c,0x4e,0x2c,0x30,0x35,0x30,0x30,0x35,0x2e,0x30,0x36,0x38,0x30,0x2c,0x45,0x2c,0x32,0x34,0x2e,0x35,0x2c,0x32,0x34,0x31,0x2e,0x30,0x2c,0x32,0x32,0x31,0x30,0x31,0x33,0x59,0x9c,0x0d,0x0a}; + assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(buf12)))); + } } -- cgit v1.2.3