aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2015-10-08 15:08:33 +1300
committerAnton Tananaev <anton.tananaev@gmail.com>2015-10-08 15:08:33 +1300
commiteb4ee7a9d4d0f132546b164c3483d62eb9e9f0db (patch)
tree29bc56f0f67cd49bac31a50e415c614ed4b1c5dc /test/org/traccar
parent320d41863864485c5675c9bf8332ff0845e5e812 (diff)
downloadtraccar-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.tar.gz
traccar-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.tar.bz2
traccar-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.zip
Clean up reported PMD issues
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/geocode/ReverseGeocoderTest.java47
1 files changed, 34 insertions, 13 deletions
diff --git a/test/org/traccar/geocode/ReverseGeocoderTest.java b/test/org/traccar/geocode/ReverseGeocoderTest.java
index 31cff8f71..2336418d8 100644
--- a/test/org/traccar/geocode/ReverseGeocoderTest.java
+++ b/test/org/traccar/geocode/ReverseGeocoderTest.java
@@ -1,35 +1,56 @@
package org.traccar.geocode;
+import org.junit.Assert;
+import org.junit.Test;
+
public class ReverseGeocoderTest {
- /*@Test
+ private boolean enable = false;
+
+ @Test
+ public void test() {
+ if (enable) {
+ testGoogle();
+ testNominatim();
+ testGisgraphy();
+ }
+
+ }
+
public void testGoogle() {
ReverseGeocoder reverseGeocoder = new GoogleReverseGeocoder();
- assertEquals(
- "1600 Amphitheatre Pkwy, Mountain View, CA, US",
- reverseGeocoder.getAddress(new AddressFormat(), 37.4217550, -122.0846330));
+ reverseGeocoder.getAddress(new AddressFormat(), 37.4217550, -122.0846330, new ReverseGeocoder.ReverseGeocoderCallback() {
+ @Override
+ public void onResult(String address) {
+ Assert.assertEquals("1600 Amphitheatre Pkwy, Mountain View, CA, US", address);
+ }
+ });
}
- @Test
public void testNominatim() {
ReverseGeocoder reverseGeocoder = new NominatimReverseGeocoder();
- assertEquals(
- "35 West 9th Street, NYC, New York, US",
- reverseGeocoder.getAddress(new AddressFormat(), 40.7337807, -73.9974401));
+ reverseGeocoder.getAddress(new AddressFormat(), 40.7337807, -73.9974401, new ReverseGeocoder.ReverseGeocoderCallback() {
+ @Override
+ public void onResult(String address) {
+ Assert.assertEquals("35 West 9th Street, NYC, New York, US", address);
+ }
+ });
}
- @Test
public void testGisgraphy() {
ReverseGeocoder reverseGeocoder = new GisgraphyReverseGeocoder();
- assertEquals(
- "Rue du Jardinet, Paris, FR",
- reverseGeocoder.getAddress(new AddressFormat(), 48.8530000, 2.3400000));
- }*/
+ reverseGeocoder.getAddress(new AddressFormat(), 48.8530000, 2.3400000, new ReverseGeocoder.ReverseGeocoderCallback() {
+ @Override
+ public void onResult(String address) {
+ Assert.assertEquals("Rue du Jardinet, Paris, FR", address);
+ }
+ });
+ }
}