diff options
author | Hans van den Elsen <hans.elsen@esds.nl> | 2016-03-11 22:16:25 +0100 |
---|---|---|
committer | Hans van den Elsen <hans.elsen@esds.nl> | 2016-03-11 22:16:25 +0100 |
commit | 4606737cc07b736f9c8f98ae680b928c94c082c8 (patch) | |
tree | bdd29b24a16403b1e8a3d7cd4325391063b34b8a /test/org/traccar/protocol/TelicFrameDecoderTest.java | |
parent | 3ced99384b1967f5cde9abdf30c1c0184a5ae3f6 (diff) | |
parent | ab5d21e16ac44957e04da0f06daf148af95e96be (diff) | |
download | trackermap-server-4606737cc07b736f9c8f98ae680b928c94c082c8.tar.gz trackermap-server-4606737cc07b736f9c8f98ae680b928c94c082c8.tar.bz2 trackermap-server-4606737cc07b736f9c8f98ae680b928c94c082c8.zip |
Merge remote-tracking branch 'refs/remotes/tananaev/master'
Diffstat (limited to 'test/org/traccar/protocol/TelicFrameDecoderTest.java')
-rw-r--r-- | test/org/traccar/protocol/TelicFrameDecoderTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/TelicFrameDecoderTest.java b/test/org/traccar/protocol/TelicFrameDecoderTest.java new file mode 100644 index 000000000..64f8b55e6 --- /dev/null +++ b/test/org/traccar/protocol/TelicFrameDecoderTest.java @@ -0,0 +1,30 @@ +package org.traccar.protocol; + +import org.jboss.netty.buffer.ChannelBuffer; +import org.junit.Assert; +import org.junit.Test; +import org.traccar.ProtocolTest; + +import java.nio.ByteOrder; + +public class TelicFrameDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + TelicFrameDecoder decoder = new TelicFrameDecoder(); + + Assert.assertNull( + decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "00303032363937393238317c3233327c30337c30303230303430313000"))); + + Assert.assertEquals( + binary(ByteOrder.LITTLE_ENDIAN, "303032363937393238317c3233327c30337c303032303034303130"), + decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "303032363937393238317c3233327c30337c30303230303430313000"))); + + Assert.assertEquals( + binary(ByteOrder.LITTLE_ENDIAN, "3030323039373932383139392c3231303231363038313930302c302c3231303231363038313835392c3031333839333338352c34363635383639352c332c302c302c382c2c2c3534312c36313239382c2c303030302c30302c302c3139362c302c30343037"), + decoder.decode(null, null, binary(ByteOrder.LITTLE_ENDIAN, "650000003030323039373932383139392c3231303231363038313930302c302c3231303231363038313835392c3031333839333338352c34363635383639352c332c302c302c382c2c2c3534312c36313239382c2c303030302c30302c302c3139362c302c3034303700"))); + + } + +} |