aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton@traccar.org>2022-10-18 06:34:48 -0700
committerAnton Tananaev <anton@traccar.org>2022-10-18 06:34:48 -0700
commitab6df268d8b22b1d99c1b6ee1770a50d56b784e3 (patch)
tree16d797459bf91772e836a2d16e888499ae9337c8 /src/test/java/org/traccar
parentdcecec13f6392980512e0ded566680c3dd657ab4 (diff)
downloadtrackermap-server-ab6df268d8b22b1d99c1b6ee1770a50d56b784e3.tar.gz
trackermap-server-ab6df268d8b22b1d99c1b6ee1770a50d56b784e3.tar.bz2
trackermap-server-ab6df268d8b22b1d99c1b6ee1770a50d56b784e3.zip
Add BCE frame tests
Diffstat (limited to 'src/test/java/org/traccar')
-rw-r--r--src/test/java/org/traccar/protocol/BceFrameDecoderTest.java26
1 files changed, 26 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/BceFrameDecoderTest.java b/src/test/java/org/traccar/protocol/BceFrameDecoderTest.java
new file mode 100644
index 000000000..e5a442f2f
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/BceFrameDecoderTest.java
@@ -0,0 +1,26 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class BceFrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ var decoder = inject(new BceFrameDecoder());
+
+ verifyNull(
+ decoder.decode(null, null, binary("23424345230d0a")));
+
+ verifyFrame(
+ binary("18ed450cf31403001501a5050a66207bde6442534451380a66207bde6440534451380a66207bde6414534451380a66207bde6416534451380a96207bde6415534451386247277bde03c0ffffc081400069f934418ce94b42001c88ee0000000000908c060103025d19ab004b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000017b5c40000000000000001010000000aa6277bde008f5344513862b7277bde03c0ffffc081400051f8344185e94b420c1c85fa0000000000d18c060103025d19ab00470000000000000000000000000000000000000000000000000000000000000000000000000000000000000017b5c40000000000000001010400000ab6277bde009153445138a0"),
+ decoder.decode(null, null, binary("18ed450cf31403001501a5050a66207bde6442534451380a66207bde6440534451380a66207bde6414534451380a66207bde6416534451380a96207bde6415534451386247277bde03c0ffffc081400069f934418ce94b42001c88ee0000000000908c060103025d19ab004b0000000000000000000000000000000000000000000000000000000000000000000000000000000000000017b5c40000000000000001010000000aa6277bde008f5344513862b7277bde03c0ffffc081400051f8344185e94b420c1c85fa0000000000d18c060103025d19ab00470000000000000000000000000000000000000000000000000000000000000000000000000000000000000017b5c40000000000000001010400000ab6277bde009153445138a0")));
+
+ verifyFrame(
+ binary("18ed450cf31403000200a5070e"),
+ decoder.decode(null, null, binary("18ed450cf31403000200a5070e")));
+
+ }
+
+}