aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol/EnforaProtocolDecoderTest.java
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar/protocol/EnforaProtocolDecoderTest.java')
-rw-r--r--test/org/traccar/protocol/EnforaProtocolDecoderTest.java21
1 files changed, 10 insertions, 11 deletions
diff --git a/test/org/traccar/protocol/EnforaProtocolDecoderTest.java b/test/org/traccar/protocol/EnforaProtocolDecoderTest.java
index 4dd559d42..5c1a015be 100644
--- a/test/org/traccar/protocol/EnforaProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/EnforaProtocolDecoderTest.java
@@ -15,22 +15,21 @@ public class EnforaProtocolDecoderTest {
public void testDecode() throws Exception {
EnforaProtocolDecoder decoder = new EnforaProtocolDecoder(new TestDataManager(), null, null);
- ChannelBufferFactory factory = new HeapChannelBufferFactory();
- assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(
- new int[] {0x00,0x0A,0x08,0x00,0x20,0x20,0x20,0x20,0x20,0x30,0x31,0x31,0x30,0x37,0x30,0x30,0x30,0x30,0x35,0x37,0x30,0x32,0x36,0x37}))));
+ assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "000A08002020202020303131303730303030353730323637"))));
- assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(
- new int[] {0x00,0x3B,0x00,0x05,0x02,0x00,0x00,0x00,0x00,0x08,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x31,0x31,0x30,0x37,0x30,0x30,0x30,0x30,0x35,0x37,0x30,0x32,0x36,0x37,0x20,0x38,0x3A,0x00,0x00,0x00,0x00,0x0D,0x00,0x50,0x84,0x01,0x35,0x8E,0x64,0x00,0x32,0xB3,0x77,0x00,0x00,0x03,0x67,0xB0,0x00,0x00,0xA8,0x04}))));
+ assertNull(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "003B000502000000000820202020202030313130373030303035373032363720383A000000000D00508401358E640032B37700000367B00000A804"))));
- verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(
- new int[] {0x00,0x71,0x00,0x04,0x02,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x31,0x32,0x33,0x34,0x35,0x36,0x37,0x38,0x39,0x30,0x31,0x32,0x33,0x34,0x35,0x20,0x31,0x33,0x20,0x24,0x47,0x50,0x52,0x4D,0x43,0x2C,0x32,0x32,0x33,0x31,0x35,0x32,0x2E,0x30,0x30,0x2C,0x41,0x2C,0x33,0x35,0x30,0x39,0x2E,0x38,0x36,0x30,0x35,0x39,0x34,0x2C,0x4E,0x2C,0x30,0x33,0x33,0x32,0x32,0x2E,0x37,0x34,0x33,0x38,0x38,0x37,0x2C,0x45,0x2C,0x30,0x2E,0x30,0x2C,0x30,0x2E,0x30,0x2C,0x30,0x32,0x30,0x36,0x31,0x32,0x2C,0x2C,0x2C,0x41,0x2A,0x35,0x32,0x0D,0x0A}))));
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "007100040200202020202020202020382020202020202031323334353637383930313233343520313320244750524D432C3232333135322E30302C412C333530392E3836303539342C4E2C30333332322E3734333838372C452C302E302C302E302C3032303631322C2C2C412A35320D0A"))));
- verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(
- new int[] {0x00,0x76,0x00,0x04,0x02,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x30,0x31,0x31,0x38,0x39,0x32,0x30,0x30,0x30,0x36,0x30,0x38,0x31,0x38,0x39,0x20,0x31,0x33,0x20,0x24,0x47,0x50,0x52,0x4D,0x43,0x2C,0x31,0x37,0x31,0x38,0x34,0x31,0x2E,0x30,0x30,0x2C,0x41,0x2C,0x33,0x35,0x30,0x39,0x2E,0x38,0x35,0x32,0x34,0x31,0x30,0x2C,0x4E,0x2C,0x30,0x33,0x33,0x32,0x32,0x2E,0x37,0x35,0x39,0x31,0x31,0x33,0x2C,0x45,0x2C,0x30,0x2E,0x30,0x2C,0x30,0x2E,0x30,0x2C,0x31,0x37,0x30,0x37,0x31,0x32,0x2C,0x33,0x2E,0x34,0x2C,0x57,0x2C,0x41,0x2A,0x32,0x35,0x0D,0x0A,0x00}))));
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "007600040200202020202020202020382020202020202030313138393230303036303831383920313320244750524D432C3137313834312E30302C412C333530392E3835323431302C4E2C30333332322E3735393131332C452C302E302C302E302C3137303731322C332E342C572C412A32350D0A00"))));
- verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertArray(
- new int[] {0x00,0x6a,0x00,0x0a,0x08,0x10,0x00,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x20,0x33,0x33,0x20,0x20,0x20,0x20,0x20,0x20,0x38,0x36,0x31,0x30,0x37,0x34,0x30,0x32,0x31,0x37,0x31,0x39,0x36,0x35,0x36,0x20,0x20,0x47,0x50,0x52,0x4d,0x43,0x2c,0x31,0x36,0x31,0x32,0x34,0x38,0x2e,0x30,0x30,0x2c,0x41,0x2c,0x33,0x34,0x33,0x32,0x2e,0x36,0x39,0x32,0x31,0x31,0x2c,0x53,0x2c,0x30,0x35,0x38,0x33,0x31,0x2e,0x30,0x32,0x32,0x31,0x37,0x2c,0x57,0x2c,0x30,0x2e,0x30,0x34,0x38,0x2c,0x2c,0x32,0x32,0x30,0x38,0x31,0x34,0x2c,0x2c,0x2c,0x41,0x2a,0x37,0x34}))));
+ verify(decoder.decode(null, null, ChannelBuffers.wrappedBuffer(ChannelBufferTools.convertHexString(
+ "006a000a081000202020202020202020333320202020202038363130373430323137313936353620204750524d432c3136313234382e30302c412c333433322e36393231312c532c30353833312e30323231372c572c302e3034382c2c3232303831342c2c2c412a3734"))));
}