diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2017-05-22 17:59:22 +1200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-05-22 17:59:22 +1200 |
commit | 5af130db6edcc25d89a8f84e55350644ba4797b3 (patch) | |
tree | d828de08c9c2f7cabf671f6d75ddda459af77507 /test | |
parent | 0bafa34ebceba731aae2b45ae9e05c8f55b66b0e (diff) | |
parent | 152e8f2e494275b1259601560abc22bcb39502c3 (diff) | |
download | trackermap-server-5af130db6edcc25d89a8f84e55350644ba4797b3.tar.gz trackermap-server-5af130db6edcc25d89a8f84e55350644ba4797b3.tar.bz2 trackermap-server-5af130db6edcc25d89a8f84e55350644ba4797b3.zip |
Merge pull request #3178 from Abyss777/power_and_charge
Organize KEY_POWER and KEY_CHARGE
Diffstat (limited to 'test')
-rw-r--r-- | test/org/traccar/ProtocolTest.java | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java index c9d4ceeb2..a1b14c74d 100644 --- a/test/org/traccar/ProtocolTest.java +++ b/test/org/traccar/ProtocolTest.java @@ -192,6 +192,10 @@ public class ProtocolTest extends BaseTest { Assert.assertTrue(attributes.get(Position.KEY_FUEL_LEVEL) instanceof Number); } + if (attributes.containsKey(Position.KEY_POWER)) { + Assert.assertTrue(attributes.get(Position.KEY_POWER) instanceof Number); + } + if (attributes.containsKey(Position.KEY_BATTERY)) { Assert.assertTrue(attributes.get(Position.KEY_BATTERY) instanceof Number); } @@ -201,6 +205,10 @@ public class ProtocolTest extends BaseTest { Assert.assertTrue(batteryLevel <= 100 && batteryLevel >= 0); } + if (attributes.containsKey(Position.KEY_CHARGE)) { + Assert.assertTrue(attributes.get(Position.KEY_CHARGE) instanceof Boolean); + } + if (position.getNetwork() != null && position.getNetwork().getCellTowers() != null) { for (CellTower cellTower : position.getNetwork().getCellTowers()) { checkInteger(cellTower.getMobileCountryCode(), 0, 999); |