diff options
Diffstat (limited to 'src/test/java/org')
-rw-r--r-- | src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java | 3 | ||||
-rw-r--r-- | src/test/java/org/traccar/protocol/HuabaoFrameEncoderTest.java | 21 |
2 files changed, 24 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java index feec3ebfb..26132eb4e 100644 --- a/src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java +++ b/src/test/java/org/traccar/protocol/EskyProtocolDecoderTest.java @@ -11,6 +11,9 @@ public class EskyProtocolDecoderTest extends ProtocolTest { var decoder = inject(new EskyProtocolDecoder(null)); + verifyPosition(decoder, text( + "ET;1;864431045310325;R;0+240303180628+-33.40958+149.56797+0.00+63+0xb+0+17814846+1168+0+0+WVWZZZ6RZFY242201+135+DTCNULL")); + verifyAttribute(decoder, text( "ET;0;860337031066546;R;9+200717114059+41.32053+19.80761+0.30+0+0x2+8+40381744+0+1409+11"), Position.KEY_BATTERY, 14.09); diff --git a/src/test/java/org/traccar/protocol/HuabaoFrameEncoderTest.java b/src/test/java/org/traccar/protocol/HuabaoFrameEncoderTest.java new file mode 100644 index 000000000..a2799e9a8 --- /dev/null +++ b/src/test/java/org/traccar/protocol/HuabaoFrameEncoderTest.java @@ -0,0 +1,21 @@ +package org.traccar.protocol; + +import io.netty.buffer.ByteBuf; +import io.netty.buffer.Unpooled; +import org.junit.jupiter.api.Test; +import org.traccar.ProtocolTest; + +public class HuabaoFrameEncoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + var encoder = new HuabaoFrameEncoder(); + + ByteBuf buf = Unpooled.buffer(); + encoder.encode(null, binary("7e307e087d557e"), buf); + verifyFrame(binary("7e307d02087d01557e"), buf); + + } + +} |