aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org
diff options
context:
space:
mode:
authorIván Ávalos <avalos@disroot.org>2024-08-03 20:52:00 -0600
committerIván Ávalos <avalos@disroot.org>2024-08-03 20:52:00 -0600
commit55f6d92c09a5b1d8566b53633d07be3d31010d3b (patch)
treeb86bed801b0bbadb72c7e839296dae1d28b12bbb /src/test/java/org
parentc04ad7d48331253c095fc123ded1b00f6ff871d3 (diff)
parent2788174193def918a3a1a5be3bbed24c9613323f (diff)
downloadtrackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.gz
trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.tar.bz2
trackermap-server-55f6d92c09a5b1d8566b53633d07be3d31010d3b.zip
Merge tag 'tags/v6.3'
Diffstat (limited to 'src/test/java/org')
-rw-r--r--src/test/java/org/traccar/ProtocolTest.java64
-rw-r--r--src/test/java/org/traccar/geocoder/GeocoderTest.java13
-rw-r--r--src/test/java/org/traccar/protocol/AstraProtocolDecoderTest.java3
-rw-r--r--src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java10
-rw-r--r--src/test/java/org/traccar/protocol/GotopProtocolDecoderTest.java6
-rw-r--r--src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java26
-rw-r--r--src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java8
-rw-r--r--src/test/java/org/traccar/protocol/MeiligaoProtocolDecoderTest.java4
-rw-r--r--src/test/java/org/traccar/protocol/MeitrackProtocolEncoderTest.java6
-rw-r--r--src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java4
-rw-r--r--src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java6
-rw-r--r--src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java3
12 files changed, 111 insertions, 42 deletions
diff --git a/src/test/java/org/traccar/ProtocolTest.java b/src/test/java/org/traccar/ProtocolTest.java
index 23ba562f8..1ad192f85 100644
--- a/src/test/java/org/traccar/ProtocolTest.java
+++ b/src/test/java/org/traccar/ProtocolTest.java
@@ -28,6 +28,7 @@ import java.util.TimeZone;
import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
+import static org.junit.jupiter.api.Assertions.assertInstanceOf;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.junit.jupiter.api.Assertions.assertNull;
import static org.junit.jupiter.api.Assertions.assertTrue;
@@ -117,15 +118,10 @@ public class ProtocolTest extends BaseTest {
position = (Position) decodedObject;
}
switch (key) {
- case "speed":
- assertEquals(expected, position.getSpeed());
- break;
- case "course":
- assertEquals(expected, position.getCourse());
- break;
- default:
- assertEquals(expected, position.getAttributes().get(key));
- break;
+ case "speed" -> assertEquals(expected, position.getSpeed());
+ case "course" -> assertEquals(expected, position.getCourse());
+ case "altitude" -> assertEquals(expected, position.getAltitude());
+ default -> assertEquals(expected, position.getAttributes().get(key));
}
}
@@ -156,7 +152,7 @@ public class ProtocolTest extends BaseTest {
private void verifyDecodedList(Object decodedObject, boolean checkLocation, Position expected) {
assertNotNull(decodedObject, "list is null");
- assertTrue(decodedObject instanceof List, "not a list");
+ assertInstanceOf(List.class, decodedObject, "not a list");
assertFalse(((List<?>) decodedObject).isEmpty(), "list is empty");
for (Object item : (List<?>) decodedObject) {
@@ -168,7 +164,7 @@ public class ProtocolTest extends BaseTest {
private void verifyDecodedPosition(Object decodedObject, boolean checkLocation, boolean checkAttributes, Position expected) {
assertNotNull(decodedObject, "position is null");
- assertTrue(decodedObject instanceof Position, "not a position");
+ assertInstanceOf(Position.class, decodedObject, "not a position");
Position position = (Position) decodedObject;
@@ -222,55 +218,55 @@ public class ProtocolTest extends BaseTest {
}
if (attributes.containsKey(Position.KEY_INDEX)) {
- assertTrue(attributes.get(Position.KEY_INDEX) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_INDEX));
}
if (attributes.containsKey(Position.KEY_HDOP)) {
- assertTrue(attributes.get(Position.KEY_HDOP) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_HDOP));
}
if (attributes.containsKey(Position.KEY_VDOP)) {
- assertTrue(attributes.get(Position.KEY_VDOP) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_VDOP));
}
if (attributes.containsKey(Position.KEY_PDOP)) {
- assertTrue(attributes.get(Position.KEY_PDOP) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_PDOP));
}
if (attributes.containsKey(Position.KEY_SATELLITES)) {
- assertTrue(attributes.get(Position.KEY_SATELLITES) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_SATELLITES));
}
if (attributes.containsKey(Position.KEY_SATELLITES_VISIBLE)) {
- assertTrue(attributes.get(Position.KEY_SATELLITES_VISIBLE) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_SATELLITES_VISIBLE));
}
if (attributes.containsKey(Position.KEY_RSSI)) {
- assertTrue(attributes.get(Position.KEY_RSSI) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_RSSI));
}
if (attributes.containsKey(Position.KEY_ODOMETER)) {
- assertTrue(attributes.get(Position.KEY_ODOMETER) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_ODOMETER));
}
if (attributes.containsKey(Position.KEY_RPM)) {
- assertTrue(attributes.get(Position.KEY_RPM) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_RPM));
}
if (attributes.containsKey(Position.KEY_FUEL_LEVEL)) {
- assertTrue(attributes.get(Position.KEY_FUEL_LEVEL) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_FUEL_LEVEL));
}
if (attributes.containsKey(Position.KEY_FUEL_USED)) {
- assertTrue(attributes.get(Position.KEY_FUEL_USED) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_FUEL_USED));
}
if (attributes.containsKey(Position.KEY_POWER)) {
- assertTrue(attributes.get(Position.KEY_POWER) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_POWER));
}
if (attributes.containsKey(Position.KEY_BATTERY)) {
- assertTrue(attributes.get(Position.KEY_BATTERY) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_BATTERY));
}
if (attributes.containsKey(Position.KEY_BATTERY_LEVEL)) {
@@ -279,39 +275,39 @@ public class ProtocolTest extends BaseTest {
}
if (attributes.containsKey(Position.KEY_CHARGE)) {
- assertTrue(attributes.get(Position.KEY_CHARGE) instanceof Boolean);
+ assertInstanceOf(Boolean.class, attributes.get(Position.KEY_CHARGE));
}
if (attributes.containsKey(Position.KEY_IGNITION)) {
- assertTrue(attributes.get(Position.KEY_IGNITION) instanceof Boolean);
+ assertInstanceOf(Boolean.class, attributes.get(Position.KEY_IGNITION));
}
if (attributes.containsKey(Position.KEY_MOTION)) {
- assertTrue(attributes.get(Position.KEY_MOTION) instanceof Boolean);
+ assertInstanceOf(Boolean.class, attributes.get(Position.KEY_MOTION));
}
if (attributes.containsKey(Position.KEY_ARCHIVE)) {
- assertTrue(attributes.get(Position.KEY_ARCHIVE) instanceof Boolean);
+ assertInstanceOf(Boolean.class, attributes.get(Position.KEY_ARCHIVE));
}
if (attributes.containsKey(Position.KEY_DRIVER_UNIQUE_ID)) {
- assertTrue(attributes.get(Position.KEY_DRIVER_UNIQUE_ID) instanceof String);
+ assertInstanceOf(String.class, attributes.get(Position.KEY_DRIVER_UNIQUE_ID));
}
if (attributes.containsKey(Position.KEY_STEPS)) {
- assertTrue(attributes.get(Position.KEY_STEPS) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_STEPS));
}
if (attributes.containsKey(Position.KEY_ROAMING)) {
- assertTrue(attributes.get(Position.KEY_ROAMING) instanceof Boolean);
+ assertInstanceOf(Boolean.class, attributes.get(Position.KEY_ROAMING));
}
if (attributes.containsKey(Position.KEY_HOURS)) {
- assertTrue(attributes.get(Position.KEY_HOURS) instanceof Number);
+ assertInstanceOf(Number.class, attributes.get(Position.KEY_HOURS));
}
if (attributes.containsKey(Position.KEY_RESULT)) {
- assertTrue(attributes.get(Position.KEY_RESULT) instanceof String);
+ assertInstanceOf(String.class, attributes.get(Position.KEY_RESULT));
}
if (position.getNetwork() != null) {
@@ -348,7 +344,7 @@ public class ProtocolTest extends BaseTest {
protected void verifyFrame(ByteBuf expected, Object object) {
assertNotNull(object, "buffer is null");
- assertTrue(object instanceof ByteBuf, "not a buffer");
+ assertInstanceOf(ByteBuf.class, object, "not a buffer");
assertEquals(ByteBufUtil.hexDump(expected), ByteBufUtil.hexDump((ByteBuf) object));
}
diff --git a/src/test/java/org/traccar/geocoder/GeocoderTest.java b/src/test/java/org/traccar/geocoder/GeocoderTest.java
index ef2dd062d..2aa7ab77c 100644
--- a/src/test/java/org/traccar/geocoder/GeocoderTest.java
+++ b/src/test/java/org/traccar/geocoder/GeocoderTest.java
@@ -20,7 +20,7 @@ public class GeocoderTest {
@Disabled
@Test
public void testGoogle() {
- Geocoder geocoder = new GoogleGeocoder(client, null, null, 0, new AddressFormat());
+ Geocoder geocoder = new GoogleGeocoder(client, null, null, null, 0, new AddressFormat());
String address = geocoder.getAddress(31.776797, 35.211489, null);
assertEquals("1 Ibn Shaprut St, Jerusalem, Jerusalem District, IL", address);
}
@@ -69,9 +69,9 @@ public class GeocoderTest {
@Disabled
@Test
public void testBan() {
- Geocoder geocoder = new BanGeocoder(client, 0, new AddressFormat("%f [%d], %c"));
+ Geocoder geocoder = new BanGeocoder(client, 0, new AddressFormat());
String address = geocoder.getAddress(48.8575, 2.2944, null);
- assertEquals("8 Avenue Gustave Eiffel 75007 Paris [75, Paris, Île-de-France], FR", address);
+ assertEquals("8 Avenue Gustave Eiffel, Paris, FR", address);
}
@Disabled
@@ -122,4 +122,11 @@ public class GeocoderTest {
assertEquals("114 East 13th Street, New York, New York, US", address);
}
+ @Disabled
+ @Test
+ public void testGeocodeJSON() {
+ Geocoder geocoder = new GeocodeJsonGeocoder(client, null, null, null, 0, new AddressFormat());
+ String address = geocoder.getAddress(40.7337807, -73.9974401, null);
+ assertEquals("35 West 9th Street, New York, New York, US", address);
+ }
}
diff --git a/src/test/java/org/traccar/protocol/AstraProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/AstraProtocolDecoderTest.java
index 3dabcac5d..dc48fc829 100644
--- a/src/test/java/org/traccar/protocol/AstraProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/AstraProtocolDecoderTest.java
@@ -10,6 +10,9 @@ public class AstraProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new AstraProtocolDecoder(null));
+ verifyPositions(decoder, false, binary(
+ "5800cb02052196881aff5b3c0000200010bf53cbfab10000000100393d5853cbfab0031b93affffb034b0000ae00000000010000000c000c00000000000000787e00000000000000000000000000000000000000000000000000000000000000000000000000000000003d0000200010bf53cbfae60000280000293c5853cbfae6031b93affffb034b0000ae00000000010000000d000c00000000000000ae7e0000000000000000000000000000000000000000000000000000000000000000000000000000000000e604"));
+
verifyPositions(decoder, binary(
"4b00700529c0c265976b8202cba9ff00676d864554a9c30000000020073401006436000300030008000000000000a0000100001920c43d00009600428302cba9ff00676d864554aa3e000000002007240100643b000300020008000000000000b0000100001920c43d00009600420f0e"));
diff --git a/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
index 925a0da1c..04980117b 100644
--- a/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gl200TextProtocolDecoderTest.java
@@ -11,6 +11,9 @@ public class Gl200TextProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new Gl200TextProtocolDecoder(null));
+ verifyAttributes(decoder, buffer(
+ "+RESP:GTINF,423036,866884046104139,,41,89103000000064820042,22,99,0,,,3.82,0,0,1,0,0,20240622183159,57,,,,,20240623011548,005C$"));
+
verifyAttribute(decoder, buffer(
"+RESP:GTERI,8020050704,867488060246195,,00000004,28823,10,1,1,0.0,33,10.1,10.606120,43.656780,20240408084402,0222,0010,7D53,00DD120D,02,0,0.0,,,,,100,210100,0,1,FFFFF,YS2R4X20009288827,2,H1910197,58234.30,500,1,90,H1.5,P84.00,,0,4616.20,2.28,2.16,5.64,5358,1038,0010,00,00,20240408084403,1809$"),
Position.KEY_BATTERY_LEVEL, 100);
@@ -513,6 +516,13 @@ public class Gl200TextProtocolDecoderTest extends ProtocolTest {
verifyAttributes(decoder, buffer(
"+RESP:GTCAN,8020050605,867488060270575,,00,1,FFFFFFFF,8LBETF3W4N0001613,,,22.54,0,,,,,,,7.84,4.61,3.24,3.33,,8080,,,00,0.00,0.00,1,14,14,2371,0,001FFFFF,,,,,,,,,7158,9998,0,7.84,0.00,0.00,558,,,,,,,C0,,,,,0,0.0,346,2848.5,-78.592371,-0.968132,20240202083437,0740,0002,526C,00AE7907,00,20240202083440,3F6D$"));
+ verifyAttribute(decoder, buffer(
+ "+BUFF:GTIGN,6E0202,868589060169789,ra79,379,1,0.0,105,532.2,-70.616413,-33.393457,20240610201712,0730,0001,333A,00CFA301,01,11,,0.0,20240610201713,3AE2$"),
+ Position.KEY_IGNITION, true);
+
+ verifyAttribute(decoder, buffer(
+ "+RESP:GTIGF,6E0202,868589060169789,ra79,145,1,0.0,83,532.2,-70.616413,-33.393457,20240610201937,0730,0001,333A,00CFA301,01,12,,0.0,20240610201938,3AE9$"),
+ Position.KEY_IGNITION, false);
}
}
diff --git a/src/test/java/org/traccar/protocol/GotopProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/GotopProtocolDecoderTest.java
index aea6e7592..8601618bd 100644
--- a/src/test/java/org/traccar/protocol/GotopProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/GotopProtocolDecoderTest.java
@@ -11,6 +11,12 @@ public class GotopProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new GotopProtocolDecoder(null));
+ verifyPosition(decoder, text(
+ "012896001901633,CMD-T,A,130104,175950,24.0234233S,029.4691133E,Speed:001.8,90-24,1.3,10,10,65501-0371-170D,12,1-1,00.00"));
+
+ verifyPosition(decoder, text(
+ "012896001901633,CMD-T,A,130104,175950,24.0234233S,029.4691133E,Speed:001.8,90-24,1.3,00.00"));
+
verifyNull(decoder, text(
""));
diff --git a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
index 05a33cc72..bb809529a 100644
--- a/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gt06ProtocolDecoderTest.java
@@ -18,8 +18,30 @@ public class Gt06ProtocolDecoderTest extends ProtocolTest {
"78780D01086471700328358100093F040D0A"));
verifyAttribute(decoder, binary(
- "78782732180214123324ca0162bdf0041f45d900190b0a02d4000bc5270000ec025206040202005e07e10d0a"),
- Position.KEY_ALARM, Position.ALARM_POWER_CUT);
+ "787817360005040002003201010018020192006a015f0324aeaf0d0a"),
+ Position.KEY_BATTERY, 4.02);
+
+ verifyPosition(decoder, binary(
+ "787840a218061b0e0f05cf021d22430aa2660b005c00014e140000026500000000024d4e02114504df06031c010007d00000000000086973105524576500c802a86fda0d0a"));
+
+ verifyAttribute(decoder, binary(
+ "79790007940B010A0B5ACE0D0A"),
+ "networkTechnology", "4G");
+
+ verifyAttribute(decoder, binary(
+ "7878293218061301261ccd0274c4ad050d7c960018000a02d4000ac3c70dbdc40b46f004210202af001784290d0a"),
+ "altitude", -31703.0);
+
+ verifyAttribute(decoder, binary(
+ "78782a31180613012b39cc0274c4dc050d7cd000180002d4000ac3c70dbdc4150100000000000002a6000ea40b0d0a"),
+ "altitude", 678.0);
+
+ verifyAttribute(decoder, binary(
+ "7878281718060e021831c6026e8acc0c361b1000140001cc00286d000f4dbf0000012ca7e001000004b2630d0a"),
+ Position.KEY_DRIVER_UNIQUE_ID, "bf0000012ca7e001");
+
+ verifyNotNull(decoder, binary(
+ "78782732180214123324ca0162bdf0041f45d900190b0a02d4000bc5270000ec025206040202005e07e10d0a"));
verifyAttribute(decoder, binary(
"78782616170A080C0E24C0027C58AD0C2B8B0100454E0901CC0025030328E7A0005D4B13021EC373170D0A"),
diff --git a/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java
index 2ba37ab09..286ebfed1 100644
--- a/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/HuabaoProtocolDecoderTest.java
@@ -227,6 +227,14 @@ public class HuabaoProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"7e0002000004304832546500b7ca7e"));
+ verifyAttribute(decoder, binary(
+ "7E020000964130564801050048000000001000004F01651E2E02CAEC3802E80000001524062616002101040000000330011F31010EF1040000308CF231414F56585F564C3330302D4C415F48322E315F4547393135554C4141425230334130324D30385F56322E312E305F763130F3011FF400F5080000000000000001F6084008FFFFFFFD0009F70600000E870246F912000F000000010000062A00082406261600184D7E"),
+ Position.KEY_CHARGE, true);
+
+ verifyAttribute(decoder, binary(
+ "7E020000964130564801050048000000001000004F01651E2E02CAEC3802E80000001524062616002101040000000330011F31010EF1040000308CF231414F56585F564C3330302D4C415F48322E315F4547393135554C4141425230334130324D30385F56322E312E305F763130F3011FF400F5080000000000000001F6084008FFFFFFFD0009F70600000E870246F912000F000000010000062A00082406261600184D7E"),
+ Position.KEY_POWER, 12.428);
+
}
}
diff --git a/src/test/java/org/traccar/protocol/MeiligaoProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
index 8074636a3..8e2f55117 100644
--- a/src/test/java/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/MeiligaoProtocolDecoderTest.java
@@ -12,6 +12,10 @@ public class MeiligaoProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new MeiligaoProtocolDecoder(null));
verifyAttribute(decoder, binary(
+ "242400166578902354329399034331453838d2c40d0a"),
+ Position.KEY_DTCS, "C1E88");
+
+ verifyAttribute(decoder, binary(
"2424008f142180340967ff99553033333233302e3030302c412c313531362e383039392c4e2c31303435322e383835352c452c302e30302c33332c3038313232302c2c2a33367c302e387c3132337c323130307c303030302c303030302c303230452c303241417c30323038303030353038394530304531434638347c31437c31373243353832437c3042a8060d0a"),
Position.KEY_SATELLITES, 11);
diff --git a/src/test/java/org/traccar/protocol/MeitrackProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/MeitrackProtocolEncoderTest.java
index ac9854b8e..71620b967 100644
--- a/src/test/java/org/traccar/protocol/MeitrackProtocolEncoderTest.java
+++ b/src/test/java/org/traccar/protocol/MeitrackProtocolEncoderTest.java
@@ -17,19 +17,19 @@ public class MeitrackProtocolEncoderTest extends ProtocolTest {
command.setDeviceId(1);
command.setType(Command.TYPE_POSITION_SINGLE);
- assertEquals("@@Q25,123456789012345,A10*68\r\n", encoder.encodeCommand(command));
+ assertEquals("@@A25,123456789012345,A10*58\r\n", encoder.encodeCommand(command));
command.setDeviceId(1);
command.setType(Command.TYPE_REQUEST_PHOTO);
- assertEquals("@@D46,123456789012345,D03,1,camera_picture.jpg*1F\r\n", encoder.encodeCommand(command));
+ assertEquals("@@A46,123456789012345,D03,1,camera_picture.jpg*1C\r\n", encoder.encodeCommand(command));
command.setDeviceId(1);
command.setType(Command.TYPE_SEND_SMS);
command.set(Command.KEY_PHONE, "15360853789");
command.set(Command.KEY_MESSAGE, "Meitrack");
- assertEquals("@@f48,123456789012345,C02,0,15360853789,Meitrack*B0\r\n", encoder.encodeCommand(command));
+ assertEquals("@@A48,123456789012345,C02,0,15360853789,Meitrack*8B\r\n", encoder.encodeCommand(command));
}
diff --git a/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
index 2a8ff87b6..d8e480f25 100644
--- a/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/TeltonikaProtocolDecoderTest.java
@@ -15,6 +15,10 @@ public class TeltonikaProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, binary(
"000F313233343536373839303132333435"));
+ verifyAttribute(decoder, binary(
+ "00000000000000768e010000018fdc4b27cb015b3e33ceefa529030009013f0e0000022400010000000000000000000102240049010f0001c60106babbf36300550202806d0f0001ca01063456555565690202806b0f0001d10106467975425450020280690b0001c90106fa54ba8d00550b0001cf0106cabbf36300550100005455"),
+ "tag1Voltage", 3090);
+
verifyPositions(decoder, binary(
"00000000000000728e010000018b23dd796300fbf7263c24f9e11a0000000000000002240001000000000000000000010224004501210001e50110cde39f7e42bb55aa788e4a29ed650055020ab70a8f264c6000ffff6b210001b00110f89b907e42bb55aaa3463b29ed650055020ab708bb2600ae0500096c01000051d4"));
diff --git a/src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java
index a17fc341f..944b684d0 100644
--- a/src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/TrvProtocolDecoderTest.java
@@ -14,6 +14,9 @@ public class TrvProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, text(
"TRVAP00352121088015548"));
+ verifyNull(decoder, text(
+ "IWAPXL,080835"));
+
verifyAttribute(decoder, text(
"IWAP10080524A2232.9806N11404.9355E000.1061830323.8706000908000502,460,0,9520,3671,01,zhcn,00,HOME|74-DE-2B-44-88-8C|97&HOME1|74-DE-2B-44-88-8C|97&HOME2|74-DE-2B-44-88-8C|97&HOME3|74-DE-2B-44-88-8C|97"),
Position.KEY_ALARM, Position.ALARM_SOS);
@@ -96,6 +99,9 @@ public class TrvProtocolDecoderTest extends ProtocolTest {
verifyPosition(decoder, text(
"TRVYP14220217A5235.7885N00724.1840E000.0130919177.561000050660000200004,262,01,14635,52789,FritzBox7|DC-39-8F-7E-94-73|-89&FritzBox7|24-4E-5D-71-C3-9C|-90&MY_IOT|80-B4-F7-77-9C-7C|-81&MYAP|44-D4-F7-77-9C-7C|-80#"));
+ verifyNull(decoder, text(
+ "IWAP12,080835,+491773329827,+491773329826,+49306618438"));
+
}
}
diff --git a/src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java
index f070c6201..ac9c83e01 100644
--- a/src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/UproProtocolDecoderTest.java
@@ -12,6 +12,9 @@ public class UproProtocolDecoderTest extends ProtocolTest {
var decoder = inject(new UproProtocolDecoder(null));
verifyPosition(decoder, buffer(
+ "*HQ200862406278000161,AB1&A1103312243149711422697470000040724&B0100000000&F0000&R2900&N04&Y3246011F4202C1460D351F4202C146113A1F4204C1460B3C&Q06f4911e6155e127b04e2640509e325091e3cc45ed4e788a20e024a151f81a679be2a45250d4f7e7dff75b&T63&J000300&K00100&X(k89882280666065148193)(10)(J0000)(PMODE,0,10)(20)(5000A)#"));
+
+ verifyPosition(decoder, buffer(
"*HQ201999999,BA&A1656512233362911356523660000230618&B0100060010&C00000<6<&F0000&R2405&V0109&W0000003E&K00100&T65&I54600027A00FCB6227A00FCA5727A00E955327A00E8B5327A00F9748&Y54600027A000000FCB6227A000000FCA5727A000000E955327A000000E8B5327A000000F9748&b00A7E81007607#"));
verifyPosition(decoder, buffer(