From a92c5786ce74994ad20aee12affd75737a565ba2 Mon Sep 17 00:00:00 2001 From: Anton Tananaev Date: Thu, 16 Jul 2020 20:25:20 -0700 Subject: Decode more data --- src/test/java/org/traccar/protocol/HuabaoFrameDecoderTest.java | 8 +++++--- src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java | 7 +++++++ 2 files changed, 12 insertions(+), 3 deletions(-) (limited to 'src/test/java/org') diff --git a/src/test/java/org/traccar/protocol/HuabaoFrameDecoderTest.java b/src/test/java/org/traccar/protocol/HuabaoFrameDecoderTest.java index 2d3937903..3b32be8dd 100644 --- a/src/test/java/org/traccar/protocol/HuabaoFrameDecoderTest.java +++ b/src/test/java/org/traccar/protocol/HuabaoFrameDecoderTest.java @@ -3,8 +3,6 @@ package org.traccar.protocol; import org.junit.Test; import org.traccar.ProtocolTest; -import static org.junit.Assert.assertEquals; - public class HuabaoFrameDecoderTest extends ProtocolTest { @Test @@ -12,7 +10,11 @@ public class HuabaoFrameDecoderTest extends ProtocolTest { HuabaoFrameDecoder decoder = new HuabaoFrameDecoder(); - assertEquals( + verifyFrame( + binary("283734303139303331313138352c312c3030312c454c4f434b2c332c35323934333929"), + decoder.decode(null, null, binary("283734303139303331313138352c312c3030312c454c4f434b2c332c35323934333929"))); + + verifyFrame( binary("7e307e087d557e"), decoder.decode(null, null, binary("7e307d02087d01557e"))); diff --git a/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java index 97a77eb28..8c4a0278d 100644 --- a/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java @@ -14,6 +14,13 @@ public class HuabaoProtocolDecoderTest extends ProtocolTest { verifyNull(decoder, binary( "7E01000021013345678906000F002C012F373031313142534A2D4D3742203030303030303001D4C1423838383838B47E")); + verifyAttribute(decoder, binary( + "283734303139303331313138352c312c3030312c454c4f434b2c332c35323934333929"), + Position.KEY_RESULT, "(740190311185,1,001,ELOCK,3,529439)"); + + verifyPosition(decoder, binary( + "7e55028436740190311185091607200239270613212607536108630000170a000000014600005ded05e203000000000b010d0c06005b003e00ab0a0302dc65100100a37e")); + verifyPosition(decoder, binary( "7E550100287001608180000127061008045322332880113555602E050031010000000608000010931435010002000300030100051B7E")); -- cgit v1.2.3