diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-01-27 12:23:35 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-01-27 12:23:35 +1300 |
commit | 75aa9f8ba896fe88f7842126081b367872a26c46 (patch) | |
tree | 26390c9a42fb2324b525083dab9c28df4e368298 /test/org/traccar/protocol/Xt7ProtocolDecoderTest.java | |
parent | 0a7bfdfbcec8dbb587882c63919456a3855930b4 (diff) | |
download | trackermap-server-75aa9f8ba896fe88f7842126081b367872a26c46.tar.gz trackermap-server-75aa9f8ba896fe88f7842126081b367872a26c46.tar.bz2 trackermap-server-75aa9f8ba896fe88f7842126081b367872a26c46.zip |
Update binary test cases
Diffstat (limited to 'test/org/traccar/protocol/Xt7ProtocolDecoderTest.java')
-rw-r--r-- | test/org/traccar/protocol/Xt7ProtocolDecoderTest.java | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java index 1207743ed..e786cd4da 100644 --- a/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java +++ b/test/org/traccar/protocol/Xt7ProtocolDecoderTest.java @@ -1,5 +1,7 @@ package org.traccar.protocol; +import org.jboss.netty.buffer.ChannelBuffers; +import org.traccar.helper.ChannelBufferTools; import org.traccar.helper.TestDataManager; import org.jboss.netty.buffer.ChannelBufferFactory; import org.jboss.netty.buffer.HeapChannelBufferFactory; @@ -12,10 +14,9 @@ public class Xt7ProtocolDecoderTest { public void testDecode() throws Exception { Xt7ProtocolDecoder decoder = new Xt7ProtocolDecoder(new TestDataManager(), null, null); - ChannelBufferFactory factory = new HeapChannelBufferFactory(); - byte[] buf1 = {0x53,0x54,0x58,0x32,0x30,0x31,0x30,0x31,0x30,0x31,0x38,0x30,0x31,0x20,0x20,0x20,0x20,0x20,0x20,0x02,0x6A,0x24,0x47,0x50,0x52,0x4D,0x43,0x2C,0x31,0x30,0x31,0x30,0x35,0x33,0x2E,0x30,0x30,0x30,0x2C,0x41,0x2C,0x32,0x32,0x33,0x32,0x2E,0x37,0x36,0x30,0x37,0x2C,0x4E,0x2C,0x31,0x31,0x34,0x30,0x34,0x2E,0x37,0x36,0x36,0x39,0x2C,0x45,0x2C,0x30,0x2E,0x30,0x30,0x2C,0x2C,0x32,0x33,0x31,0x31,0x31,0x30,0x2C,0x2C,0x2C,0x41,0x2A,0x37,0x46,0x2C,0x34,0x36,0x30,0x2C,0x30,0x30,0x2C,0x32,0x37,0x39,0x35,0x2C,0x30,0x45,0x36,0x41,0x2C,0x31,0x34,0x2C,0x39,0x34,0x2C,0x31,0x30,0x30,0x30,0x2C,0x30,0x30,0x30,0x30,0x2C,0x39,0x31,0x2C,0x54,0x69,0x6D,0x65,0x72,0x3B,0x31,0x44,0x0D,0x0A}; - verify(decoder.decode(null, null, factory.getBuffer(buf1, 0, buf1.length))); + verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString( + "53545832303130313031383031202020202020026A244750524D432C3130313035332E3030302C412C323233322E373630372C4E2C31313430342E373636392C452C302E30302C2C3233313131302C2C2C412A37462C3436302C30302C323739352C304536412C31342C39342C313030302C303030302C39312C54696D65723B31440D0A")))); } |