aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-01-25 10:47:06 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-01-25 10:47:06 +1300
commitf40140e60895e99c6933926496ae792561df17a3 (patch)
treee557de599b497dbdd580e99091a6f8081cfe4a0a /test
parentad7bdd5a5fe04841c941860a98501eef2a00207b (diff)
downloadtraccar-server-f40140e60895e99c6933926496ae792561df17a3.tar.gz
traccar-server-f40140e60895e99c6933926496ae792561df17a3.tar.bz2
traccar-server-f40140e60895e99c6933926496ae792561df17a3.zip
Add unit tests for GT06 frame decoder
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/protocol/Gt06FrameDecoderTest.java24
1 files changed, 24 insertions, 0 deletions
diff --git a/test/org/traccar/protocol/Gt06FrameDecoderTest.java b/test/org/traccar/protocol/Gt06FrameDecoderTest.java
new file mode 100644
index 000000000..9a4c709e8
--- /dev/null
+++ b/test/org/traccar/protocol/Gt06FrameDecoderTest.java
@@ -0,0 +1,24 @@
+package org.traccar.protocol;
+
+import org.junit.Assert;
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+
+public class Gt06FrameDecoderTest extends ProtocolTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ Gt06FrameDecoder decoder = new Gt06FrameDecoder();
+
+ Assert.assertEquals(
+ binary("78780d010352887071911998000479d00d0a"),
+ decoder.decode(null, null, binary("78780d010352887071911998000479d00d0a")));
+
+ Assert.assertEquals(
+ binary("78782516000000000000c000000000000000000020000900fa0210ef00fb620006640301000468030d0a"),
+ decoder.decode(null, null, binary("78782516000000000000c000000000000000000020000900fa0210ef00fb620006640301000468030d0a")));
+
+ }
+
+}