aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar/ProtocolTest.java
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-20 17:22:21 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-20 17:22:21 +1300
commit0a8d47bec2a232aad6353d34a101eb82c9d4f7ae (patch)
tree2bad0ed0875b4e2ef751ffc6a7d25591cd6ae3fd /test/org/traccar/ProtocolTest.java
parentc5594e16882ac3ec9215c47047e857566f8166b8 (diff)
downloadtrackermap-server-0a8d47bec2a232aad6353d34a101eb82c9d4f7ae.tar.gz
trackermap-server-0a8d47bec2a232aad6353d34a101eb82c9d4f7ae.tar.bz2
trackermap-server-0a8d47bec2a232aad6353d34a101eb82c9d4f7ae.zip
Improved network location providers
Diffstat (limited to 'test/org/traccar/ProtocolTest.java')
-rw-r--r--test/org/traccar/ProtocolTest.java18
1 files changed, 8 insertions, 10 deletions
diff --git a/test/org/traccar/ProtocolTest.java b/test/org/traccar/ProtocolTest.java
index 93f3150c7..43be1a59e 100644
--- a/test/org/traccar/ProtocolTest.java
+++ b/test/org/traccar/ProtocolTest.java
@@ -7,6 +7,7 @@ import org.jboss.netty.handler.codec.http.HttpMethod;
import org.jboss.netty.handler.codec.http.HttpVersion;
import org.junit.Assert;
import org.traccar.database.IdentityManager;
+import org.traccar.model.CellTower;
import org.traccar.model.Command;
import org.traccar.model.Device;
import org.traccar.model.Position;
@@ -174,16 +175,13 @@ public class ProtocolTest extends BaseTest {
Assert.assertFalse("no attributes", attributes.isEmpty());
}
- if (attributes.containsKey(Position.KEY_LAC) || attributes.containsKey(Position.KEY_CID)) {
- checkInteger(attributes.get(Position.KEY_LAC), 1, 65535);
- checkInteger(attributes.get(Position.KEY_CID), 0, 268435455);
- }
-
- if (attributes.containsKey(Position.KEY_MCC) || attributes.containsKey(Position.KEY_MNC)) {
- checkInteger(attributes.get(Position.KEY_MCC), 100, 999);
- checkInteger(attributes.get(Position.KEY_MNC), 0, 999);
- Assert.assertTrue("value missing", attributes.containsKey(Position.KEY_LAC));
- Assert.assertTrue("value missing", attributes.containsKey(Position.KEY_CID));
+ if (position.getNetwork() != null) {
+ for (CellTower cellTower : position.getNetwork().getCellTowers()) {
+ checkInteger(cellTower.getMobileCountryCode(), 0, 999);
+ checkInteger(cellTower.getMobileNetworkCode(), 0, 999);
+ checkInteger(cellTower.getLocationAreaCode(), 1, 65535);
+ checkInteger(cellTower.getCellId(), 0, 268435455);
+ }
}
}