From c524d170f3324ccf10944887faa3d9f35e99e31a Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Fri, 29 May 2020 23:11:19 -0700 Subject: Fix protocol decoding --- .../org/traccar/protocol/DingtekFrameDecoderTest.java | 19 +++++++++++++++++++ .../traccar/protocol/DingtekProtocolDecoderTest.java | 7 ++++--- 2 files changed, 23 insertions(+), 3 deletions(-) create mode 100644 src/test/java/org/traccar/protocol/DingtekFrameDecoderTest.java (limited to 'src/test') diff --git a/src/test/java/org/traccar/protocol/DingtekFrameDecoderTest.java b/src/test/java/org/traccar/protocol/DingtekFrameDecoderTest.java new file mode 100644 index 000000000..3bc2715db --- /dev/null +++ b/src/test/java/org/traccar/protocol/DingtekFrameDecoderTest.java @@ -0,0 +1,19 @@ +package org.traccar.protocol; + +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class DingtekFrameDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + DingtekFrameDecoder decoder = new DingtekFrameDecoder(); + + verifyFrame( + binary("383030303031303131453032383830303138303030303030303030313545303038303545433430303031313836383832323034303130343433303831"), + decoder.decode(null, null, binary("383030303031303131453032383830303138303030303030303030313545303038303545433430303031313836383832323034303130343433303831"))); + + } + +} diff --git a/src/test/java/org/traccar/protocol/DingtekProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/DingtekProtocolDecoderTest.java index ccf23a5c2..3a7567106 100644 --- a/src/test/java/org/traccar/protocol/DingtekProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/DingtekProtocolDecoderTest.java @@ -1,20 +1,21 @@ package org.traccar.protocol; -import org.junit.Ignore; import org.junit.Test; import org.traccar.ProtocolTest; public class DingtekProtocolDecoderTest extends ProtocolTest { - @Ignore @Test public void testDecode() throws Exception { DingtekProtocolDecoder decoder = new DingtekProtocolDecoder(null); - verifyPosition(decoder, binary( + verifyPosition(decoder, text( "800001011e0692001a00000000016e008027c40000186962703655111781")); + verifyNull(decoder, text( + "8000010333020E180A1E4B1E124801042015693400000000173.249.23.186;6181;159.138.4.6;8888;000000000000000081")); + } } -- cgit v1.2.3