aboutsummaryrefslogtreecommitdiff
path: root/test/org
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2016-12-31 11:17:50 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2016-12-31 11:17:50 +1300
commitd13f618ee3b8463d063b7f67e039299560245597 (patch)
treea59177abc8a4f9c74680dd15b3d1c6c0c1231c9d /test/org
parent2c6c6eccf2c45bf87e16c45e3bac9872f53c12c3 (diff)
downloadtraccar-server-d13f618ee3b8463d063b7f67e039299560245597.tar.gz
traccar-server-d13f618ee3b8463d063b7f67e039299560245597.tar.bz2
traccar-server-d13f618ee3b8463d063b7f67e039299560245597.zip
Implement geocoding error handling
Diffstat (limited to 'test/org')
-rw-r--r--test/org/traccar/geocode/ReverseGeocoderTest.java30
1 files changed, 25 insertions, 5 deletions
diff --git a/test/org/traccar/geocode/ReverseGeocoderTest.java b/test/org/traccar/geocode/ReverseGeocoderTest.java
index 2b0c30779..eab147cd5 100644
--- a/test/org/traccar/geocode/ReverseGeocoderTest.java
+++ b/test/org/traccar/geocode/ReverseGeocoderTest.java
@@ -35,9 +35,13 @@ public class ReverseGeocoderTest {
reverseGeocoder.getAddress(new AddressFormat(), 37.4217550, -122.0846330, new ReverseGeocoder.ReverseGeocoderCallback() {
@Override
- public void onResult(String address) {
+ public void onSuccess(String address) {
setAddress(address);
}
+
+ @Override
+ public void onFailure(Throwable e) {
+ }
});
Assert.assertEquals("1600 Amphitheatre Pkwy, Mountain View, CA, US", waitAddress());
}
@@ -47,9 +51,13 @@ public class ReverseGeocoderTest {
reverseGeocoder.getAddress(new AddressFormat(), 40.7337807, -73.9974401, new ReverseGeocoder.ReverseGeocoderCallback() {
@Override
- public void onResult(String address) {
+ public void onSuccess(String address) {
setAddress(address);
}
+
+ @Override
+ public void onFailure(Throwable e) {
+ }
});
Assert.assertEquals("35 West 9th Street, NYC, New York, US", waitAddress());
}
@@ -59,9 +67,13 @@ public class ReverseGeocoderTest {
reverseGeocoder.getAddress(new AddressFormat(), 48.8530000, 2.3400000, new ReverseGeocoder.ReverseGeocoderCallback() {
@Override
- public void onResult(String address) {
+ public void onSuccess(String address) {
setAddress(address);
}
+
+ @Override
+ public void onFailure(Throwable e) {
+ }
});
Assert.assertEquals("Rue du Jardinet, Paris, FR", waitAddress());
}
@@ -72,9 +84,13 @@ public class ReverseGeocoderTest {
reverseGeocoder.getAddress(new AddressFormat(), 34.116302, -118.051519, new ReverseGeocoder.ReverseGeocoderCallback() {
@Override
- public void onResult(String address) {
+ public void onSuccess(String address) {
setAddress(address);
}
+
+ @Override
+ public void onFailure(Throwable e) {
+ }
});
Assert.assertEquals("Charleston Road, California, US", waitAddress());
}
@@ -84,9 +100,13 @@ public class ReverseGeocoderTest {
reverseGeocoder.getAddress(new AddressFormat(), 34.116302, -118.051519, new ReverseGeocoder.ReverseGeocoderCallback() {
@Override
- public void onResult(String address) {
+ public void onSuccess(String address) {
setAddress(address);
}
+
+ @Override
+ public void onFailure(Throwable e) {
+ }
});
Assert.assertEquals("Estrella Avenue, Arcadia, California, United States", waitAddress());
}