aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-09-24 14:56:35 +1200
committerAnton Tananaev <anton.tananaev@gmail.com>2015-09-24 14:56:35 +1200
commit85bb659197cc2395f2ff2511573af3b90292f535 (patch)
tree9436ef268071327e2fee89a1b7102e9645cb9de7 /test/org/traccar
parenta3f912fc98ce333045ed72c1942412505b039a20 (diff)
downloadtraccar-server-85bb659197cc2395f2ff2511573af3b90292f535.tar.gz
traccar-server-85bb659197cc2395f2ff2511573af3b90292f535.tar.bz2
traccar-server-85bb659197cc2395f2ff2511573af3b90292f535.zip
Implement Aquila track protocol
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/helper/PatternUtilTest.java16
-rw-r--r--test/org/traccar/protocol/AquilaProtocolDecoderTest.java25
2 files changed, 41 insertions, 0 deletions
diff --git a/test/org/traccar/helper/PatternUtilTest.java b/test/org/traccar/helper/PatternUtilTest.java
new file mode 100644
index 000000000..25a540291
--- /dev/null
+++ b/test/org/traccar/helper/PatternUtilTest.java
@@ -0,0 +1,16 @@
+package org.traccar.helper;
+
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+
+public class PatternUtilTest {
+
+ @Test
+ public void testCheckPattern() {
+
+ assertEquals("ab", PatternUtil.checkPattern("abc", "abd"));
+
+ }
+
+}
diff --git a/test/org/traccar/protocol/AquilaProtocolDecoderTest.java b/test/org/traccar/protocol/AquilaProtocolDecoderTest.java
new file mode 100644
index 000000000..5ecd80dae
--- /dev/null
+++ b/test/org/traccar/protocol/AquilaProtocolDecoderTest.java
@@ -0,0 +1,25 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+
+import static org.traccar.helper.DecoderVerifier.verify;
+
+public class AquilaProtocolDecoderTest extends ProtocolDecoderTest {
+
+ @Test
+ public void testDecode() throws Exception {
+
+ AquilaProtocolDecoder decoder = new AquilaProtocolDecoder(new AquilaProtocol());
+
+ verify(decoder.decode(null, null,
+ "$$CLIENT_1ZF,130329214,1,12.962985,77.576484,140127165433,A,22,0,0,1,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,*26"));
+
+ verify(decoder.decode(null, null,
+ "$$CLIENT_1WP,141216511,3,12.963123,77.534012,150908163534,A,31,0,0,0,7,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,*28"));
+
+ verify(decoder.decode(null, null,
+ "$$CLIENT_1WP,141216511,3,12.963212,77.533989,150908164041,V,31,0,0,0,8,0,0,0,0,0,0,0,1,0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,1,1,1,0,*2A"));
+
+ }
+
+}