aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
Diffstat (limited to 'test')
-rw-r--r--test/org/traccar/DetectorHandlerTest.java20
-rw-r--r--test/org/traccar/protocol/Gl200ProtocolDecoderTest.java6
-rw-r--r--test/org/traccar/protocol/Gps103ProtocolDecoderTest.java3
-rw-r--r--test/org/traccar/protocol/MeitrackProtocolEncoderTest.java7
4 files changed, 16 insertions, 20 deletions
diff --git a/test/org/traccar/DetectorHandlerTest.java b/test/org/traccar/DetectorHandlerTest.java
deleted file mode 100644
index 4bac79d53..000000000
--- a/test/org/traccar/DetectorHandlerTest.java
+++ /dev/null
@@ -1,20 +0,0 @@
-package org.traccar;
-
-import org.junit.Test;
-
-public class DetectorHandlerTest {
-
- @Test
- public void testCheckPipeline() throws Exception {
-
- /*ChannelPipeline pipeline = Channels.pipeline();
- pipeline.addLast("frameDecoder", new CharacterDelimiterFrameDecoder(1024, "\r\n", "\n", ";"));
- pipeline.addLast("stringDecoder", new StringDecoder());
- pipeline.addLast("stringEncoder", new StringEncoder());
- pipeline.addLast("objectDecoder", new Gps103ProtocolDecoder(null));
-
- DetectorHandler.checkPipeline("gps103", pipeline, ChannelBuffers.copiedBuffer(
- "imei:869039001186913,tracker,1308282156,0,F,215630.000,A,5602.11015,N,9246.30767,E,1.4,,175.9,;", Charset.defaultCharset()));*/
- }
-
-}
diff --git a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
index bf7e3f175..8f0ca230b 100644
--- a/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gl200ProtocolDecoderTest.java
@@ -10,6 +10,12 @@ public class Gl200ProtocolDecoderTest extends ProtocolTest {
Gl200ProtocolDecoder decoder = new Gl200ProtocolDecoder(new Gl200Protocol());
+ verifyPosition(decoder, text(
+ "+RESP:GTIGN,060228,862894020180553,,9860,0,0.2,189,420.0,-63.158195,-17.800608,20160309022951,0736,0003,6AD4,3471,00,,881.2,20160308222956,129A$"));
+
+ verifyPosition(decoder, text(
+ "+BUFF:GTIGF,060228,862894020180553,,1958,0,0.0,240,390.3,-63.089213,-17.764712,20160309122854,0736,0003,6AB8,5A23,00,,936.8,20160309082858,1368$"));
+
verifyPositions(decoder, text(
"+RESP:GTFRI,060228,862894020180553,,,10,1,1,20.0,147,329.7,-62.899703,-17.720434,20160309113548,0736,0003,6AAE,3381,00,913.3,,,,0,220101,,,,20160309073554,132B$"));
diff --git a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
index ab59ba331..aecbe2ef1 100644
--- a/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
+++ b/test/org/traccar/protocol/Gps103ProtocolDecoderTest.java
@@ -10,6 +10,9 @@ public class Gps103ProtocolDecoderTest extends ProtocolTest {
Gps103ProtocolDecoder decoder = new Gps103ProtocolDecoder(new Gps103Protocol());
+ verifyAttributes(decoder, text(
+ "imei:359710049028435,OBD,160316053657,70430,,,0,49,60.00%,46,19.22%,859,0.00,U1108,,,;"));
+
verifyPosition(decoder, text(
"359769031878322imei:359769031878322,tracker,1602160718,2,F,221811.000,A,1655.2193,S,14546.6722,E,0.00,,"));
diff --git a/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java b/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java
index 64812c1da..3e0a870d0 100644
--- a/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java
+++ b/test/org/traccar/protocol/MeitrackProtocolEncoderTest.java
@@ -18,6 +18,13 @@ public class MeitrackProtocolEncoderTest extends ProtocolTest {
Assert.assertEquals("@@Q25,123456789012345,A10*68\r\n", encoder.encodeCommand(command));
+ command.setDeviceId(1);
+ command.setType(Command.TYPE_SEND_SMS);
+ command.set(Command.KEY_PHONE_NUMBER, "15360853789");
+ command.set(Command.KEY_MESSAGE, "Meitrack");
+
+ Assert.assertEquals("@@f48,123456789012345,C02,0,15360853789,Meitrack*B0\r\n", encoder.encodeCommand(command));
+
}
}