diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-15 00:19:39 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2013-01-15 00:19:39 +1300 |
commit | b5bd3e35f563825c9d40eaa04c02bc6397029219 (patch) | |
tree | 05684875856d3908fdec3c582ecbf2153a5bdfb8 /test/org/traccar/protocol/Jt600ProtocolDecoderTest.java | |
parent | 38fbc3e872717a1179abd00a48b600b489f9fead (diff) | |
download | trackermap-server-b5bd3e35f563825c9d40eaa04c02bc6397029219.tar.gz trackermap-server-b5bd3e35f563825c9d40eaa04c02bc6397029219.tar.bz2 trackermap-server-b5bd3e35f563825c9d40eaa04c02bc6397029219.zip |
Pass ServerManager to every protocol decoder
Diffstat (limited to 'test/org/traccar/protocol/Jt600ProtocolDecoderTest.java')
-rw-r--r-- | test/org/traccar/protocol/Jt600ProtocolDecoderTest.java | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java index 3e214832e..0419c024c 100644 --- a/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Jt600ProtocolDecoderTest.java @@ -9,18 +9,19 @@ public class Jt600ProtocolDecoderTest { @Test public void testDecode() throws Exception { - - Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(new TestDataManager()); - + + Jt600ProtocolDecoder decoder = new Jt600ProtocolDecoder(null); + decoder.setDataManager(new TestDataManager()); + byte[] buf1 = {0x24,0x31,0x10,0x21,0x60,0x01,0x11,0x00,0x1B,0x16,0x02,0x11,0x05,0x59,0x10,0x22,0x32,(byte)0x98,0x62,0x11,0x40,0x46,0x22,0x7B,0x05,(byte)0x98,0x09,0x50,(byte)0x80,0x01,0x23,0x27,(byte)0x95,0x14,0x35,0x16,0x1F}; assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(buf1))); - + byte[] buf2 = {0x24,0x31,0x20,(byte)0x82,0x00,0x29,0x11,0x00,0x1B,0x17,0x10,0x12,0x05,0x28,0x31,0x24,0x38,0x10,0x12,0x02,0x55,0x33,0x64,0x25,0x00,0x19,0x07,0x19,0x00,0x03,(byte)0xFD,0x2B,(byte)0x91,0x04,0x4D,0x1F,(byte)0xA0}; assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(buf2))); byte[] buf3 = {0x24,0x31,0x20,(byte)0x82,0x00,0x29,0x11,0x00,0x1B,0x17,0x10,0x12,0x05,0x33,0x05,0x24,0x38,0x09,(byte)0x97,0x02,0x55,0x33,0x58,0x45,0x00,0x04,0x06,0x1E,0x00,0x03,(byte)0xEE,0x00,0x00,0x00,0x00,0x0C,0x00}; assertNotNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(buf2))); - + assertNotNull(decoder.decode(null, null, ChannelBuffers.copiedBuffer("(3110312099,W01,11404.6204,E,2232.9961,N,A,040511,063736,4,7,100,4,17,1,1,company)", Charset.defaultCharset()))); |