aboutsummaryrefslogtreecommitdiff
path: root/src/test/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/test/java')
-rw-r--r--src/test/java/org/traccar/protocol/Gs100ProtocolDecoderTest.java3
-rw-r--r--src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java3
-rw-r--r--src/test/java/org/traccar/protocol/StartekProtocolEncoderTest.java2
-rw-r--r--src/test/java/org/traccar/protocol/UlbotechProtocolEncoderTest.java23
4 files changed, 30 insertions, 1 deletions
diff --git a/src/test/java/org/traccar/protocol/Gs100ProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/Gs100ProtocolDecoderTest.java
index 91bbf386c..68c9b8219 100644
--- a/src/test/java/org/traccar/protocol/Gs100ProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/Gs100ProtocolDecoderTest.java
@@ -14,6 +14,9 @@ public class Gs100ProtocolDecoderTest extends ProtocolTest {
"474C490F383632343632303332353036373030133839333831303131363039313838343837323546084657312E302E3236"));
verifyPositions(decoder, binary(
+ "47440416900000124833220421018478956c445263460110426616900000124838220421018478907c445263470055824116900000124839220421018478890c445263440091526116900000124840220421018478867c4452634401312272"));
+
+ verifyPositions(decoder, binary(
"47440216900000064113030417020236402C452286650051929716900000064115030417020236408C4522866800379020"));
}
diff --git a/src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java b/src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java
index 8277b8843..dfd86969a 100644
--- a/src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java
+++ b/src/test/java/org/traccar/protocol/ItsProtocolDecoderTest.java
@@ -17,6 +17,9 @@ public class ItsProtocolDecoderTest extends ProtocolTest {
verifyNull(decoder, text(
"$LGN,,869867037009679,3.2AIH,9.99546000,N,76.35886167,E"));
+ verifyPosition(decoder, text(
+ "$,NRM,MARK,V0.0.1,NR,01,L,358980100040246,000000000,1,10032021,073239,25.932051,N,71.509872,E,0.6,1.40,13,211.2,1.4,0.7,IDEA,0,1,0.1,3.7,0,N,20,404,60,A5F,FD3F,A5F,6F88,29,A5F,5855,18,A5F,6F87,18,A5F,FD41,14,0000,00,0.1,0,000027,0,0,0,4E9C,*"));
+
verifyAttribute(decoder, text(
"$,C,CTPL,4.0.0,NR,01,L,869247045166383,NA00000000,1,12032020,144453,30.452524,N,077.610351,E,1.4,34.8,14,384.19,1.8,0.8,IDEA P,1,1,14.2,4.17,0,C,22,404,82,0FB1,3B26,516B,0FB1,18,3B25,0FB1,15,5169,0FB1,14,3B27,0FB1,13,0000,00,8083,194.9,0B,*,IP=106.67.5.173"),
Position.KEY_ODOMETER, 194900.0);
diff --git a/src/test/java/org/traccar/protocol/StartekProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/StartekProtocolEncoderTest.java
index f23cfb227..7eeb19edf 100644
--- a/src/test/java/org/traccar/protocol/StartekProtocolEncoderTest.java
+++ b/src/test/java/org/traccar/protocol/StartekProtocolEncoderTest.java
@@ -17,7 +17,7 @@ public class StartekProtocolEncoderTest extends ProtocolTest {
command.setDeviceId(1);
command.setType(Command.TYPE_ENGINE_STOP);
- assertEquals("$$:23,123456789012345,900,1,19E\r\n", encoder.encodeCommand(null, command));
+ assertEquals("$$:24,123456789012345,900,1,19F\r\n", encoder.encodeCommand(null, command));
}
diff --git a/src/test/java/org/traccar/protocol/UlbotechProtocolEncoderTest.java b/src/test/java/org/traccar/protocol/UlbotechProtocolEncoderTest.java
new file mode 100644
index 000000000..288f8dc70
--- /dev/null
+++ b/src/test/java/org/traccar/protocol/UlbotechProtocolEncoderTest.java
@@ -0,0 +1,23 @@
+package org.traccar.protocol;
+
+import org.junit.Test;
+import org.traccar.ProtocolTest;
+import org.traccar.model.Command;
+
+public class UlbotechProtocolEncoderTest extends ProtocolTest {
+
+ @Test
+ public void testEncode() {
+
+ var encoder = new UlbotechProtocolEncoder(null);
+
+ Command command = new Command();
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_CUSTOM);
+ command.set(Command.KEY_DATA, "UNO;13912345678");
+
+ verifyCommand(encoder, command, buffer("*TS01,UNO;13912345678#"));
+
+ }
+
+}