From 9a57e0aaedb24afd3123177e9be931b2ea6ee20f Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Mon, 4 Jul 2016 16:37:49 +1200 Subject: Implement custom HuaSheng frame decoder --- .../traccar/protocol/HuaShengFrameDecoderTest.java | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 test/org/traccar/protocol/HuaShengFrameDecoderTest.java (limited to 'test/org') diff --git a/test/org/traccar/protocol/HuaShengFrameDecoderTest.java b/test/org/traccar/protocol/HuaShengFrameDecoderTest.java new file mode 100644 index 000000000..56b8f210c --- /dev/null +++ b/test/org/traccar/protocol/HuaShengFrameDecoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.junit.Assert; +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class HuaShengFrameDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + HuaShengFrameDecoder decoder = new HuaShengFrameDecoder(); + + Assert.assertEquals( + binary("c0010c00120060000000000004000600010100c0"), + decoder.decode(null, null, binary("c0010c00120060000000000004000600010100c0"))); + + Assert.assertEquals( + binary("c0010c003e0002000000000010020012a0014f42445f3347315f56312e302e330013a0043335353835353035303434303635380006a08701000006a0a1035fc0"), + decoder.decode(null, null, binary("c0010c003e0002000000000010020012a0014f42445f3347315f56312e302e330013a0043335353835353035303434303635380006a08701000006a0a1035fc0"))); + + } + +} -- cgit v1.2.3