From 152e8f2e494275b1259601560abc22bcb39502c3 Mon Sep 17 00:00:00 2001 From: Abyss777 Date: Mon, 22 May 2017 10:42:10 +0500 Subject: Organize KEY_POWER and KEY_CHARGE using --- test/org/traccar/ProtocolTest.java | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'test') 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); -- cgit v1.2.3