diff options
author | Abyss777 <abyss@fox5.ru> | 2017-05-19 14:41:23 +0500 |
---|---|---|
committer | Abyss777 <abyss@fox5.ru> | 2017-05-19 14:58:08 +0500 |
commit | 9e758d437c048b954d224935664b76d6f6f8416c (patch) | |
tree | 6e1468437fc094245ae484e2eb9e6cc92116a2d6 /test/org/traccar | |
parent | f523e3b995f5f1895cf3dea700be34f4b74dccf9 (diff) | |
download | traccar-server-9e758d437c048b954d224935664b76d6f6f8416c.tar.gz traccar-server-9e758d437c048b954d224935664b76d6f6f8416c.tar.bz2 traccar-server-9e758d437c048b954d224935664b76d6f6f8416c.zip |
Adjust battery and batteryLevel type
Diffstat (limited to 'test/org/traccar')
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index 1725e31be..94c5edb9f 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -192,6 +192,16 @@ public class ProtocolTest extends BaseTest { Assert.assertTrue(attributes.get(Position.KEY_FUEL_LEVEL) instanceof Number); } + if (attributes.containsKey(Position.KEY_BATTERY)) { + Assert.assertTrue(attributes.get(Position.KEY_BATTERY) instanceof Number); + } + + if (attributes.containsKey(Position.KEY_BATTERY_LEVEL)) { + Object batteryLevel = attributes.get(Position.KEY_BATTERY_LEVEL); + Assert.assertTrue(batteryLevel instanceof Number); + Assert.assertTrue(((Number) batteryLevel).intValue() <=100 && ((Number) batteryLevel).intValue() >= 0); + } + if (position.getNetwork() != null && position.getNetwork().getCellTowers() != null) { for (CellTower cellTower : position.getNetwork().getCellTowers()) { checkInteger(cellTower.getMobileCountryCode(), 0, 999); |