From ad8ee1702e02e02533e9f20e06af960b2cf3c647 Mon Sep 17 00:00:00 2001 From: namo Date: Fri, 20 Oct 2017 18:50:16 +0300 Subject: flespi integration: listening messages (rev.5): unit test added --- test/org/traccar/ProtocolTest.java | 14 ++++++++----- .../protocol/FlespiProtocolDecoderTest.java | 24 ++++++++++++++++++++++ 2 files changed, 33 insertions(+), 5 deletions(-) create mode 100644 test/org/traccar/protocol/FlespiProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 1daefabd6..daff777a6 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -98,6 +98,10 @@ public class ProtocolTest extends BaseTest { verifyDecodedPosition(decoder.decode(null, null, object), false, true, null); } + protected void verifyAttributesList(BaseProtocolDecoder decoder, Object object) throws Exception { + verifyDecodedList(decoder.decode(null, null, object), false, true, null); + } + protected void verifyPosition(BaseProtocolDecoder decoder, Object object) throws Exception { verifyDecodedPosition(decoder.decode(null, null, object), true, false, null); } @@ -107,25 +111,25 @@ public class ProtocolTest extends BaseTest { } protected void verifyPositions(BaseProtocolDecoder decoder, Object object) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), true, null); + verifyDecodedList(decoder.decode(null, null, object), true, false, null); } protected void verifyPositions(BaseProtocolDecoder decoder, boolean checkLocation, Object object) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), checkLocation, null); + verifyDecodedList(decoder.decode(null, null, object), checkLocation, false, null); } protected void verifyPositions(BaseProtocolDecoder decoder, Object object, Position position) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), true, position); + verifyDecodedList(decoder.decode(null, null, object), true, false, position); } - private void verifyDecodedList(Object decodedObject, boolean checkLocation, Position expected) { + private void verifyDecodedList(Object decodedObject, boolean checkLocation, boolean checkAttributes, Position expected) { Assert.assertNotNull("list is null", decodedObject); Assert.assertTrue("not a list", decodedObject instanceof List); Assert.assertFalse("list is empty", ((List) decodedObject).isEmpty()); for (Object item : (List) decodedObject) { - verifyDecodedPosition(item, checkLocation, false, expected); + verifyDecodedPosition(item, checkLocation, checkAttributes, expected); } } diff --git a/test/org/traccar/protocol/FlespiProtocolDecoderTest.java b/test/org/traccar/protocol/FlespiProtocolDecoderTest.java new file mode 100644 index 000000000..badeaa76e --- /dev/null +++ b/test/org/traccar/protocol/FlespiProtocolDecoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.jboss.netty.handler.codec.http.HttpMethod; +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class FlespiProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + FlespiProtocolDecoder decoder = new FlespiProtocolDecoder(new FlespiProtocol()); + + verifyPositions(decoder, request(HttpMethod.POST, "/", + buffer("[{\"position.speed\":0,\"position.latitude\":53.90573,\"time.valid.status\":true,\"timestamp\":1506956075,\"position.satellites\":10,\"message.buffered.status\":false,\"business.mode.status\":true,\"gps.status\":true,\"position.longitude\":27.455848,\"position.direction\":0,\"ident\":\"605630\"},{\"siren.status\":false,\"business.mode.status\":true,\"position.satellites\":8,\"timestamp\":1506695785,\"led.status\":false,\"position.latitude\":53.905569,\"position.longitude\":27.455986,\"position.speed\":0,\"gradual.stop.status\":false,\"position.direction\":262.643854,\"hardware.version.enum\":223,\"vehicle.mileage\":160,\"message.buffered.status\":false,\"blinkers.status\":false,\"ident\":\"605630\",\"position.altitude\":233.48,\"immobilizer.status\":false}]"))); + + verifyPositions(decoder, request(HttpMethod.POST, "/", + buffer("[{\"geofence.inside.status\":false,\"position.valid\":false,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":0,\"refrigerator.sensor.temperature#1\":62.5,\"gnss.antenna.cut.status\":true,\"din#4\":3,\"ain#3\":0,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":0,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":66.7,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":0,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":68.2,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":68.9,\"ident\":\"50\",\"timestamp\":946684840,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8165,\"external.powersource.voltage\":15.298,\"gnss.enum\":\"glonass\",\"position.longitude\":0,\"battery.voltage\":4.088,\"refrigerator.sensor.temperature#5\":71.3,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false},{\"geofence.inside.status\":false,\"position.valid\":true,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":57.986744,\"refrigerator.sensor.temperature#1\":74.1,\"gnss.antenna.cut.status\":false,\"din#4\":3,\"ain#3\":0,\"position.hdop\":21.1,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":219,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":70.5,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":5,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":71.3,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":69.3,\"ident\":\"50\",\"timestamp\":1392272112,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8174,\"external.powersource.voltage\":15.303,\"gnss.enum\":\"glonass\",\"position.longitude\":56.207576,\"battery.voltage\":3.934,\"refrigerator.sensor.temperature#5\":68.1,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false}]"))); + + verifyAttributesList(decoder, request(HttpMethod.POST, "/", + buffer("[{\"ain#1\":1,\"ain#2\":0,\"ain#3\":0,\"ain#4\":0,\"alarm.event.trigger\":true,\"custom.SOS\":1,\"custom.dparam\":3.141593,\"custom.ign\":1,\"custom.iparam\":-55,\"custom.tparam\":\"lorem\",\"din#1\":false,\"din#10\":false,\"din#11\":false,\"din#12\":false,\"din#13\":false,\"din#14\":false,\"din#15\":false,\"din#16\":false,\"din#17\":false,\"din#18\":false,\"din#19\":false,\"din#2\":false,\"din#20\":false,\"din#21\":false,\"din#22\":false,\"din#23\":false,\"din#24\":false,\"din#25\":false,\"din#26\":false,\"din#27\":false,\"din#28\":false,\"din#29\":false,\"din#3\":false,\"din#30\":false,\"din#31\":false,\"din#32\":false,\"din#4\":false,\"din#5\":false,\"din#6\":false,\"din#7\":false,\"din#8\":false,\"din#9\":false,\"dout#1\":false,\"dout#10\":false,\"dout#11\":false,\"dout#12\":false,\"dout#13\":false,\"dout#14\":false,\"dout#15\":false,\"dout#16\":false,\"dout#17\":false,\"dout#18\":false,\"dout#19\":false,\"dout#2\":false,\"dout#20\":false,\"dout#21\":false,\"dout#22\":false,\"dout#23\":false,\"dout#24\":false,\"dout#25\":false,\"dout#26\":false,\"dout#27\":false,\"dout#28\":false,\"dout#29\":false,\"dout#3\":false,\"dout#30\":false,\"dout#31\":false,\"dout#32\":false,\"dout#4\":false,\"dout#5\":false,\"dout#6\":false,\"dout#7\":false,\"dout#8\":false,\"dout#9\":false,\"ident\":\"namo:namo\",\"position.altitude\":300,\"position.direction\":0,\"position.hdop\":1.1,\"position.latitude\":53.90821,\"position.longitude\":27.524165,\"position.satellites\":7,\"position.speed\":0,\"timestamp\":1508508510.013227}]"))); + } + +} -- cgit v1.2.3 From 4b8095a1c91ae2fc9bcd6cfc6e291c7b63af3cd1 Mon Sep 17 00:00:00 2001 From: namo Date: Tue, 24 Oct 2017 12:26:29 +0300 Subject: Revert "flespi integration: listening messages (rev.5): unit test added" This reverts commit ad8ee1702e02e02533e9f20e06af960b2cf3c647. --- .../traccar/protocol/FlespiProtocolDecoder.java | 5 ++--- test/org/traccar/ProtocolTest.java | 14 +++++-------- .../protocol/FlespiProtocolDecoderTest.java | 24 ---------------------- 3 files changed, 7 insertions(+), 36 deletions(-) delete mode 100644 test/org/traccar/protocol/FlespiProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/FlespiProtocolDecoder.java b/src/org/traccar/protocol/FlespiProtocolDecoder.java index 69a977577..3a12cd7b8 100644 --- a/src/org/traccar/protocol/FlespiProtocolDecoder.java +++ b/src/org/traccar/protocol/FlespiProtocolDecoder.java @@ -30,7 +30,6 @@ import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonNumber; import javax.json.JsonObject; -import javax.json.JsonString; import java.io.StringReader; import java.net.SocketAddress; import java.nio.charset.StandardCharsets; @@ -57,11 +56,11 @@ public class FlespiProtocolDecoder extends BaseProtocolDecoder { List positions = new LinkedList<>(); for (int i = 0; i < result.size(); i++) { JsonObject message = result.getJsonObject(i); - JsonString ident = message.getJsonString("ident"); + String ident = message.getString("ident"); if (ident == null) { continue; } - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, ident.getString()); + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, ident); if (deviceSession == null) { continue; } diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index daff777a6..1daefabd6 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -98,10 +98,6 @@ public class ProtocolTest extends BaseTest { verifyDecodedPosition(decoder.decode(null, null, object), false, true, null); } - protected void verifyAttributesList(BaseProtocolDecoder decoder, Object object) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), false, true, null); - } - protected void verifyPosition(BaseProtocolDecoder decoder, Object object) throws Exception { verifyDecodedPosition(decoder.decode(null, null, object), true, false, null); } @@ -111,25 +107,25 @@ public class ProtocolTest extends BaseTest { } protected void verifyPositions(BaseProtocolDecoder decoder, Object object) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), true, false, null); + verifyDecodedList(decoder.decode(null, null, object), true, null); } protected void verifyPositions(BaseProtocolDecoder decoder, boolean checkLocation, Object object) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), checkLocation, false, null); + verifyDecodedList(decoder.decode(null, null, object), checkLocation, null); } protected void verifyPositions(BaseProtocolDecoder decoder, Object object, Position position) throws Exception { - verifyDecodedList(decoder.decode(null, null, object), true, false, position); + verifyDecodedList(decoder.decode(null, null, object), true, position); } - private void verifyDecodedList(Object decodedObject, boolean checkLocation, boolean checkAttributes, Position expected) { + private void verifyDecodedList(Object decodedObject, boolean checkLocation, Position expected) { Assert.assertNotNull("list is null", decodedObject); Assert.assertTrue("not a list", decodedObject instanceof List); Assert.assertFalse("list is empty", ((List) decodedObject).isEmpty()); for (Object item : (List) decodedObject) { - verifyDecodedPosition(item, checkLocation, checkAttributes, expected); + verifyDecodedPosition(item, checkLocation, false, expected); } } diff --git a/test/org/traccar/protocol/FlespiProtocolDecoderTest.java b/test/org/traccar/protocol/FlespiProtocolDecoderTest.java deleted file mode 100644 index badeaa76e..000000000 --- a/test/org/traccar/protocol/FlespiProtocolDecoderTest.java +++ /dev/null @@ -1,24 +0,0 @@ -package org.traccar.protocol; - -import org.jboss.netty.handler.codec.http.HttpMethod; -import org.junit.Test; -import org.traccar.ProtocolTest; - -public class FlespiProtocolDecoderTest extends ProtocolTest { - - @Test - public void testDecode() throws Exception { - - FlespiProtocolDecoder decoder = new FlespiProtocolDecoder(new FlespiProtocol()); - - verifyPositions(decoder, request(HttpMethod.POST, "/", - buffer("[{\"position.speed\":0,\"position.latitude\":53.90573,\"time.valid.status\":true,\"timestamp\":1506956075,\"position.satellites\":10,\"message.buffered.status\":false,\"business.mode.status\":true,\"gps.status\":true,\"position.longitude\":27.455848,\"position.direction\":0,\"ident\":\"605630\"},{\"siren.status\":false,\"business.mode.status\":true,\"position.satellites\":8,\"timestamp\":1506695785,\"led.status\":false,\"position.latitude\":53.905569,\"position.longitude\":27.455986,\"position.speed\":0,\"gradual.stop.status\":false,\"position.direction\":262.643854,\"hardware.version.enum\":223,\"vehicle.mileage\":160,\"message.buffered.status\":false,\"blinkers.status\":false,\"ident\":\"605630\",\"position.altitude\":233.48,\"immobilizer.status\":false}]"))); - - verifyPositions(decoder, request(HttpMethod.POST, "/", - buffer("[{\"geofence.inside.status\":false,\"position.valid\":false,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":0,\"refrigerator.sensor.temperature#1\":62.5,\"gnss.antenna.cut.status\":true,\"din#4\":3,\"ain#3\":0,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":0,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":66.7,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":0,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":68.2,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":68.9,\"ident\":\"50\",\"timestamp\":946684840,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8165,\"external.powersource.voltage\":15.298,\"gnss.enum\":\"glonass\",\"position.longitude\":0,\"battery.voltage\":4.088,\"refrigerator.sensor.temperature#5\":71.3,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false},{\"geofence.inside.status\":false,\"position.valid\":true,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":57.986744,\"refrigerator.sensor.temperature#1\":74.1,\"gnss.antenna.cut.status\":false,\"din#4\":3,\"ain#3\":0,\"position.hdop\":21.1,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":219,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":70.5,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":5,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":71.3,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":69.3,\"ident\":\"50\",\"timestamp\":1392272112,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8174,\"external.powersource.voltage\":15.303,\"gnss.enum\":\"glonass\",\"position.longitude\":56.207576,\"battery.voltage\":3.934,\"refrigerator.sensor.temperature#5\":68.1,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false}]"))); - - verifyAttributesList(decoder, request(HttpMethod.POST, "/", - buffer("[{\"ain#1\":1,\"ain#2\":0,\"ain#3\":0,\"ain#4\":0,\"alarm.event.trigger\":true,\"custom.SOS\":1,\"custom.dparam\":3.141593,\"custom.ign\":1,\"custom.iparam\":-55,\"custom.tparam\":\"lorem\",\"din#1\":false,\"din#10\":false,\"din#11\":false,\"din#12\":false,\"din#13\":false,\"din#14\":false,\"din#15\":false,\"din#16\":false,\"din#17\":false,\"din#18\":false,\"din#19\":false,\"din#2\":false,\"din#20\":false,\"din#21\":false,\"din#22\":false,\"din#23\":false,\"din#24\":false,\"din#25\":false,\"din#26\":false,\"din#27\":false,\"din#28\":false,\"din#29\":false,\"din#3\":false,\"din#30\":false,\"din#31\":false,\"din#32\":false,\"din#4\":false,\"din#5\":false,\"din#6\":false,\"din#7\":false,\"din#8\":false,\"din#9\":false,\"dout#1\":false,\"dout#10\":false,\"dout#11\":false,\"dout#12\":false,\"dout#13\":false,\"dout#14\":false,\"dout#15\":false,\"dout#16\":false,\"dout#17\":false,\"dout#18\":false,\"dout#19\":false,\"dout#2\":false,\"dout#20\":false,\"dout#21\":false,\"dout#22\":false,\"dout#23\":false,\"dout#24\":false,\"dout#25\":false,\"dout#26\":false,\"dout#27\":false,\"dout#28\":false,\"dout#29\":false,\"dout#3\":false,\"dout#30\":false,\"dout#31\":false,\"dout#32\":false,\"dout#4\":false,\"dout#5\":false,\"dout#6\":false,\"dout#7\":false,\"dout#8\":false,\"dout#9\":false,\"ident\":\"namo:namo\",\"position.altitude\":300,\"position.direction\":0,\"position.hdop\":1.1,\"position.latitude\":53.90821,\"position.longitude\":27.524165,\"position.satellites\":7,\"position.speed\":0,\"timestamp\":1508508510.013227}]"))); - } - -} -- cgit v1.2.3 From 2ef987e1352c9d9483e062ff82fa83d0511a0972 Mon Sep 17 00:00:00 2001 From: namo Date: Tue, 24 Oct 2017 12:43:00 +0300 Subject: flespi integration: listening messages (rev.6): unit test added, getLastLocation added if position is absent --- .../traccar/protocol/FlespiProtocolDecoder.java | 10 ++++++--- .../protocol/FlespiProtocolDecoderTest.java | 24 ++++++++++++++++++++++ 2 files changed, 31 insertions(+), 3 deletions(-) create mode 100644 test/org/traccar/protocol/FlespiProtocolDecoderTest.java (limited to 'test/org/traccar') diff --git a/src/org/traccar/protocol/FlespiProtocolDecoder.java b/src/org/traccar/protocol/FlespiProtocolDecoder.java index 3a12cd7b8..2e57c1dcf 100644 --- a/src/org/traccar/protocol/FlespiProtocolDecoder.java +++ b/src/org/traccar/protocol/FlespiProtocolDecoder.java @@ -30,6 +30,7 @@ import javax.json.Json; import javax.json.JsonArray; import javax.json.JsonNumber; import javax.json.JsonObject; +import javax.json.JsonString; import java.io.StringReader; import java.net.SocketAddress; import java.nio.charset.StandardCharsets; @@ -56,11 +57,11 @@ public class FlespiProtocolDecoder extends BaseProtocolDecoder { List positions = new LinkedList<>(); for (int i = 0; i < result.size(); i++) { JsonObject message = result.getJsonObject(i); - String ident = message.getString("ident"); + JsonString ident = message.getJsonString("ident"); if (ident == null) { continue; } - DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, ident); + DeviceSession deviceSession = getDeviceSession(channel, remoteAddress, ident.getString()); if (deviceSession == null) { continue; } @@ -85,12 +86,15 @@ public class FlespiProtocolDecoder extends BaseProtocolDecoder { private void decodePosition(JsonObject object, Position position) { position.setProtocol(protocolName); - position.setTime(new Date((long) object.getJsonNumber("timestamp").doubleValue() * 1000)); + Date deviceTime = new Date((long) object.getJsonNumber("timestamp").doubleValue() * 1000); + position.setTime(deviceTime); JsonNumber lat = object.getJsonNumber("position.latitude"); JsonNumber lon = object.getJsonNumber("position.longitude"); if (lat != null && lon != null) { position.setLatitude(lat.doubleValue()); position.setLongitude(lon.doubleValue()); + } else { + getLastLocation(position, deviceTime); } JsonNumber speed = object.getJsonNumber("position.speed"); if (speed != null) { diff --git a/test/org/traccar/protocol/FlespiProtocolDecoderTest.java b/test/org/traccar/protocol/FlespiProtocolDecoderTest.java new file mode 100644 index 000000000..b23da024a --- /dev/null +++ b/test/org/traccar/protocol/FlespiProtocolDecoderTest.java @@ -0,0 +1,24 @@ +package org.traccar.protocol; + +import org.jboss.netty.handler.codec.http.HttpMethod; +import org.junit.Test; +import org.traccar.ProtocolTest; + +public class FlespiProtocolDecoderTest extends ProtocolTest { + + @Test + public void testDecode() throws Exception { + + FlespiProtocolDecoder decoder = new FlespiProtocolDecoder(new FlespiProtocol()); + + verifyPositions(decoder, request(HttpMethod.POST, "/", + buffer("[{\"position.speed\":0,\"position.latitude\":53.90573,\"time.valid.status\":true,\"timestamp\":1506956075,\"position.satellites\":10,\"message.buffered.status\":false,\"business.mode.status\":true,\"gps.status\":true,\"position.longitude\":27.455848,\"position.direction\":0,\"ident\":\"605630\"},{\"siren.status\":false,\"business.mode.status\":true,\"position.satellites\":8,\"timestamp\":1506695785,\"led.status\":false,\"position.latitude\":53.905569,\"position.longitude\":27.455986,\"position.speed\":0,\"gradual.stop.status\":false,\"position.direction\":262.643854,\"hardware.version.enum\":223,\"vehicle.mileage\":160,\"message.buffered.status\":false,\"blinkers.status\":false,\"ident\":\"605630\",\"position.altitude\":233.48,\"immobilizer.status\":false}]"))); + + verifyPositions(decoder, request(HttpMethod.POST, "/", + buffer("[{\"geofence.inside.status\":false,\"position.valid\":false,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":0,\"refrigerator.sensor.temperature#1\":62.5,\"gnss.antenna.cut.status\":true,\"din#4\":3,\"ain#3\":0,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":0,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":66.7,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":0,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":68.2,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":68.9,\"ident\":\"50\",\"timestamp\":946684840,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8165,\"external.powersource.voltage\":15.298,\"gnss.enum\":\"glonass\",\"position.longitude\":0,\"battery.voltage\":4.088,\"refrigerator.sensor.temperature#5\":71.3,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false},{\"geofence.inside.status\":false,\"position.valid\":true,\"ain#4\":0,\"rs232.sensor.value#1\":0,\"position.direction\":0,\"rs232.sensor.value#0\":0,\"position.speed\":0,\"position.latitude\":57.986744,\"refrigerator.sensor.temperature#1\":74.1,\"gnss.antenna.cut.status\":false,\"din#4\":3,\"ain#3\":0,\"position.hdop\":21.1,\"refrigerator.sensor.temperature#3\":71.4,\"position.altitude\":219,\"din#2\":3,\"shock.event.trigger\":false,\"alarm.mode.status\":false,\"ibutton.event.connect\":false,\"refrigerator.sensor.temperature#4\":70.5,\"internal.battery.voltage.limit.lower.status\":false,\"ain#2\":0,\"gsm.signal.level\":0,\"refrigerator.connection.status\":0,\"position.satellites\":5,\"din#1\":3,\"external.powersource.voltage.range.outside.status\":false,\"refrigerator.sensor.temperature#2\":71.3,\"incline.event.trigger\":false,\"alarm.event.trigger\":false,\"movement.status\":true,\"refrigerator.sensor.temperature#6\":69.3,\"ident\":\"50\",\"timestamp\":1392272112,\"engine.ignition.status\":true,\"gsm.sim.status\":true,\"record.seqnum\":8174,\"external.powersource.voltage\":15.303,\"gnss.enum\":\"glonass\",\"position.longitude\":56.207576,\"battery.voltage\":3.934,\"refrigerator.sensor.temperature#5\":68.1,\"din#3\":3,\"ain#1\":0,\"internal.bus.supply.voltage.range.outside.status\":false}]"))); + + verifyPositions(decoder, request(HttpMethod.POST, "/", + buffer("[{\"ain#1\":1,\"ain#2\":0,\"ain#3\":0,\"ain#4\":0,\"alarm.event.trigger\":true,\"custom.SOS\":1,\"custom.dparam\":3.141593,\"custom.ign\":1,\"custom.iparam\":-55,\"custom.tparam\":\"lorem\",\"din#1\":false,\"din#10\":false,\"din#11\":false,\"din#12\":false,\"din#13\":false,\"din#14\":false,\"din#15\":false,\"din#16\":false,\"din#17\":false,\"din#18\":false,\"din#19\":false,\"din#2\":false,\"din#20\":false,\"din#21\":false,\"din#22\":false,\"din#23\":false,\"din#24\":false,\"din#25\":false,\"din#26\":false,\"din#27\":false,\"din#28\":false,\"din#29\":false,\"din#3\":false,\"din#30\":false,\"din#31\":false,\"din#32\":false,\"din#4\":false,\"din#5\":false,\"din#6\":false,\"din#7\":false,\"din#8\":false,\"din#9\":false,\"dout#1\":false,\"dout#10\":false,\"dout#11\":false,\"dout#12\":false,\"dout#13\":false,\"dout#14\":false,\"dout#15\":false,\"dout#16\":false,\"dout#17\":false,\"dout#18\":false,\"dout#19\":false,\"dout#2\":false,\"dout#20\":false,\"dout#21\":false,\"dout#22\":false,\"dout#23\":false,\"dout#24\":false,\"dout#25\":false,\"dout#26\":false,\"dout#27\":false,\"dout#28\":false,\"dout#29\":false,\"dout#3\":false,\"dout#30\":false,\"dout#31\":false,\"dout#32\":false,\"dout#4\":false,\"dout#5\":false,\"dout#6\":false,\"dout#7\":false,\"dout#8\":false,\"dout#9\":false,\"ident\":\"namo:namo\",\"position.altitude\":300,\"position.direction\":0,\"position.hdop\":1.1,\"position.latitude\":53.90821,\"position.longitude\":27.524165,\"position.satellites\":7,\"position.speed\":0,\"timestamp\":1508508510.013227}]"))); + } + +} \ No newline at end of file -- cgit v1.2.3