aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/protocol
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2021-11-25 17:52:29 -0800
committerAnton Tananaev <anton.tananaev@gmail.com>2021-11-25 17:52:29 -0800
commit610bd8d84705b5cfa43f2bcf50d6f0c841ecf260 (patch)
tree10d99dcd6409fb5dd774873d785a42d2c9eac3e3 /src/test/java/org/traccar/protocol
parent0fea1a39bea08a43771fc08becdf5d7f2f392531 (diff)
downloadtraccar-server-610bd8d84705b5cfa43f2bcf50d6f0c841ecf260.tar.gz
traccar-server-610bd8d84705b5cfa43f2bcf50d6f0c841ecf260.tar.bz2
traccar-server-610bd8d84705b5cfa43f2bcf50d6f0c841ecf260.zip
Add custom frame decoder
Diffstat (limited to 'src/test/java/org/traccar/protocol')
-rw-r--r--src/test/java/org/traccar/protocol/TechtoCruzFrameDecoderTest.java25
-rw-r--r--src/test/java/org/traccar/protocol/TechtoCruzProtocolDecoderTest.java3
2 files changed, 28 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/protocol/TechtoCruzFrameDecoderTest.java b/src/test/java/org/traccar/protocol/TechtoCruzFrameDecoderTest.java
new file mode 100644
index 000000000..dc4afb784
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/TechtoCruzFrameDecoderTest.java
@@ -0,0 +1,25 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+import static org.junit.Assert.assertEquals;
+
+public class TechtoCruzFrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ var decoder = new TechtoCruzFrameDecoder();
+
+ assertEquals(
+ buffer("$$A35,RESPO|G33|8612345678910|CRUZ,*E3"),
+ decoder.decode(null, null, buffer("$$A35,RESPO|G33|8612345678910|CRUZ,*E3")));
+
+ assertEquals(
+ buffer("$$A120,8612345678910,211005105836,A,FLEX,KCB 947C,000.0,0,-1.38047,S,36.93951,E,1648.4,243.140,21,28,12.1,3.7,0,1,0,0,0,*F6"),
+ decoder.decode(null, null, buffer("$$A120,8612345678910,211005105836,A,FLEX,KCB 947C,000.0,0,-1.38047,S,36.93951,E,1648.4,243.140,21,28,12.1,3.7,0,1,0,0,0,*F6")));
+
+ }
+
+}
diff --git a/src/test/java/org/traccar/protocol/TechtoCruzProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/TechtoCruzProtocolDecoderTest.java
index 8f4a7915d..4cef682b4 100644
--- a/src/test/java/org/traccar/protocol/TechtoCruzProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/TechtoCruzProtocolDecoderTest.java
@@ -13,6 +13,9 @@ public class TechtoCruzProtocolDecoderTest extends ProtocolTest {
verifyPosition(decoder, text(
"$$A120,8612345678910,211005105836,A,FLEX,KCB 947C,000.0,0,-1.38047,S,36.93951,E,1648.4,243.140,21,28,12.1,3.7,0,1,0,0,0,*F6"));
+ verifyNull(decoder, text(
+ "$$A35,RESPO|G33|8612345678910|CRUZ,*E3"));
+
}
}