aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/protocol
diff options
context:
space:
mode:
Diffstat (limited to 'test/org/traccar/protocol')
-rw-r--r--test/org/traccar/protocol/BoxProtocolDecoderTest.java5
-rw-r--r--test/org/traccar/protocol/CguardProtocolDecoderTest.java9
-rw-r--r--test/org/traccar/protocol/FifotrackProtocolDecoderTest.java3
-rw-r--r--test/org/traccar/protocol/ItsProtocolDecoderTest.java3
-rw-r--r--test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java3
-rw-r--r--test/org/traccar/protocol/SuntechProtocolDecoderTest.java6
6 files changed, 28 insertions, 1 deletions
diff --git a/test/org/traccar/protocol/BoxProtocolDecoderTest.java b/test/org/traccar/protocol/BoxProtocolDecoderTest.java
index f117d1ede..d661a10f2 100644
--- a/test/org/traccar/protocol/BoxProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/BoxProtocolDecoderTest.java
@@ -10,7 +10,7 @@ public class BoxProtocolDecoderTest extends ProtocolTest {
public void testDecode() throws Exception {
BoxProtocolDecoder decoder = new BoxProtocolDecoder(null);
-
+
verifyNull(decoder, text(
"H,BT,358281002435893,081028142432,F5813D19,6D6E6DC2"));
@@ -18,6 +18,9 @@ public class BoxProtocolDecoderTest extends ProtocolTest {
"H,BT,N878123,080415081234,D63E6DD9,6D6E6DC2,8944100300825505377"));
verifyPosition(decoder, text(
+ "L,190227043304,G,25.68773,48.59788,71,53,261.42,1,23;A,0.03;D,0.06;I,0"));
+
+ verifyPosition(decoder, text(
"L,081028142429,G,52.51084,-1.70849,0,170,0,1,0"));
verifyPosition(decoder, text(
diff --git a/test/org/traccar/protocol/CguardProtocolDecoderTest.java b/test/org/traccar/protocol/CguardProtocolDecoderTest.java
index 1be301069..a386b6b47 100644
--- a/test/org/traccar/protocol/CguardProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/CguardProtocolDecoderTest.java
@@ -14,6 +14,15 @@ public class CguardProtocolDecoderTest extends ProtocolTest {
"IDRO:354868050655283"));
verifyPosition(decoder, text(
+ "NV:190225 144543:55.776505:37.729000:0:10:0:0"));
+
+ verifyAttributes(decoder, text(
+ "BC:190225 144543:CSQ1:64:NSQ1:0:NSQ2:1:BAT1:100"));
+
+ verifyAttributes(decoder, text(
+ "BC:190225 142653:CSQ1:80:NSQ1:0:NSQ2:1:BAT1:3.53"));
+
+ verifyPosition(decoder, text(
"NV:170409 031456:56.808553:60.595476:0:NAN:0"));
verifyAttributes(decoder, text(
diff --git a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java
index 989b6b673..1dcfc89c4 100644
--- a/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/FifotrackProtocolDecoderTest.java
@@ -10,6 +10,9 @@ public class FifotrackProtocolDecoderTest extends ProtocolTest {
FifotrackProtocolDecoder decoder = new FifotrackProtocolDecoder(null);
+ verifyNull(decoder, text(
+ "$$79,868345037864709,382,D05,190220085833,22.643210,114.018176,1,1,1,13152,23FFD339*25"));
+
verifyPosition(decoder, text(
"$$105,866104023179743,AB,A00,,161007085534,A,54.738791,25.271918,0,350,151,0,17929,0000,0,,246|1|65|96DB,936|0*0B"));
diff --git a/test/org/traccar/protocol/ItsProtocolDecoderTest.java b/test/org/traccar/protocol/ItsProtocolDecoderTest.java
index 4cadfc996..0281320a9 100644
--- a/test/org/traccar/protocol/ItsProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/ItsProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class ItsProtocolDecoderTest extends ProtocolTest {
ItsProtocolDecoder decoder = new ItsProtocolDecoder(null);
verifyPosition(decoder, text(
+ "$NRM,ROADRPA,1.7AIS,NR,01,L,869867036345389,,1,25022019,051716,25.12891000,N,75.85587833,E,7.6,350.00,14,284.8,1.00,1.00,AIRTEL,1,1,28.0,4.2,0,C,13,404,70,4E3B,3C84,11,4E3B,39B8,08,4E3B,3965,07,4E3B,48B5,07,4E3B,3C85,0000,00,000551,71978C6B"));
+
+ verifyPosition(decoder, text(
"$,1,CHVTS,CHVTS1.0,DT,16,L,861359039868243,861359039868243,1,05022019,071225,19.965062,N,73.736088,E,0,050,03,0632,6.67,6.75,Idea Cel,1,1,23.96,4.0,0,W,28,404,004,4e2b,49e,4e2bea86727ab3d6704e2bea7714e2be9d72,0000,00,001133,232"));
verifyPosition(decoder, text(
diff --git a/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java b/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java
index 553e7eb16..248920e21 100644
--- a/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/OwnTracksProtocolDecoderTest.java
@@ -12,6 +12,9 @@ public class OwnTracksProtocolDecoderTest extends ProtocolTest {
OwnTracksProtocolDecoder decoder = new OwnTracksProtocolDecoder(null);
verifyPosition(decoder, request(HttpMethod.POST, "/",
+ buffer("{\"_type\":\"location\",\"acc\":15,\"alt\":440,\"batt\":46,\"conn\":\"w\",\"lat\":46.0681247,\"lon\":11.1512805,\"t\":\"u\",\"tid\":\"5t\",\"tst\":1551874878,\"vac\":2,\"vel\":0}")));
+
+ verifyPosition(decoder, request(HttpMethod.POST, "/",
buffer("{\"lon\":2.29513,\"lat\":48.85833,\"tst\":1497349316,\"_type\":\"location\",\"tid\":\"JJ\"}")));
verifyPosition(decoder, request(HttpMethod.POST, "/",
diff --git a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java
index 2681e6143..355cda783 100644
--- a/test/org/traccar/protocol/SuntechProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/SuntechProtocolDecoderTest.java
@@ -33,6 +33,12 @@ public class SuntechProtocolDecoderTest extends ProtocolTest {
decoder.setHbm(true);
+ verifyPosition(decoder, text(
+ "ST300STT;007238270;40;313;20190220;12:05:04;c99e48;+04.644623;-074.076922;010.390;202.77;20;1;997100;14.10;100000;2;8384;003634;4.1;1"));
+
+ verifyPosition(decoder, text(
+ "ST300STT;109002029;08;1080;20190220;13:00:55;85405;+04.645710;-074.078525;007.760;005.19;10;1;6520802;13.86;100100;4;1716;0000039863;4.1;1;0.00;0000;0000;0;0"));
+
verifyAttribute(decoder, text(
"ST300ALT;007239104;40;313;20190112;01:07:16;c99139;+04.703287;-074.148897;000.000;189.72;21;1;425512;12.61;100000;33;003188;4.1;1"),
Position.KEY_HOURS, 3188 * 60000L);