diff options
author | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-08 15:08:33 +1300 |
---|---|---|
committer | Anton Tananaev <anton.tananaev@gmail.com> | 2015-10-08 15:08:33 +1300 |
commit | eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db (patch) | |
tree | 29bc56f0f67cd49bac31a50e415c614ed4b1c5dc /test/org/traccar/geocode | |
parent | 320d41863864485c5675c9bf8332ff0845e5e812 (diff) | |
download | trackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.tar.gz trackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.tar.bz2 trackermap-server-eb4ee7a9d4d0f132546b164c3483d62eb9e9f0db.zip |
Clean up reported PMD issues
Diffstat (limited to 'test/org/traccar/geocode')
-rw-r--r-- | test/org/traccar/geocode/ReverseGeocoderTest.java | 47 |
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); + } + }); + } } |