aboutsummaryrefslogtreecommitdiff
path: root/test/org/traccar
diff options
context:
space:
mode:
authorAbyss777 <abyss@fox5.ru>2017-11-10 09:56:30 +0500
committerAbyss777 <abyss@fox5.ru>2017-11-10 09:56:30 +0500
commit96d89e2e352f5cba70a346b1f71bfb3bd399556b (patch)
treebfec39fe84b547dac991f0d38cd69e9c64c688a6 /test/org/traccar
parent404044342a9fc9891366fa4378b4b1330cbca6c3 (diff)
downloadtraccar-server-96d89e2e352f5cba70a346b1f71bfb3bd399556b.tar.gz
traccar-server-96d89e2e352f5cba70a346b1f71bfb3bd399556b.tar.bz2
traccar-server-96d89e2e352f5cba70a346b1f71bfb3bd399556b.zip
- Combine "getAddress" functions
- Change switches logic
Diffstat (limited to 'test/org/traccar')
-rw-r--r--test/org/traccar/geocoder/GeocoderTest.java26
1 files changed, 16 insertions, 10 deletions
diff --git a/test/org/traccar/geocoder/GeocoderTest.java b/test/org/traccar/geocoder/GeocoderTest.java
index 84e2fb2d6..7c6208048 100644
--- a/test/org/traccar/geocoder/GeocoderTest.java
+++ b/test/org/traccar/geocoder/GeocoderTest.java
@@ -1,5 +1,7 @@
package org.traccar.geocoder;
+import java.util.Locale;
+
import org.junit.Assert;
import org.junit.Ignore;
import org.junit.Test;
@@ -9,6 +11,7 @@ public class GeocoderTest {
@Ignore
@Test
public void test() throws InterruptedException {
+ Locale.setDefault(Locale.US);
testGoogle();
}
@@ -38,12 +41,13 @@ public class GeocoderTest {
}
@Override
- public void onFailure(Throwable e) {
+ public void onFailure(final Throwable e) {
}
});
Assert.assertEquals("1 Ibn Shaprut St, Jerusalem, Jerusalem District, IL", waitAddress());
- Assert.assertEquals("1 Ibn Shaprut St, Jerusalem, Jerusalem District, IL", geocoder.getAddress(31.776797, 35.211489));
+ Assert.assertEquals("1 Ibn Shaprut St, Jerusalem, Jerusalem District, IL",
+ geocoder.getAddress(31.776797, 35.211489, null));
}
public void testNominatim() throws InterruptedException {
@@ -59,9 +63,10 @@ public class GeocoderTest {
public void onFailure(Throwable e) {
}
});
- Assert.assertEquals("35 West 9th Street, NYC, New York, US", waitAddress());
+ Assert.assertEquals("35 West 9th Street, NYC, New York, US", waitAddress());
- Assert.assertEquals("35 West 9th Street, NYC, New York, US", geocoder.getAddress(40.7337807, -73.9974401));
+ Assert.assertEquals("35 West 9th Street, NYC, New York, US",
+ geocoder.getAddress(40.7337807, -73.9974401, null));
}
public void testGisgraphy() throws InterruptedException {
@@ -77,9 +82,9 @@ public class GeocoderTest {
public void onFailure(Throwable e) {
}
});
- Assert.assertEquals("Rue du Jardinet, Paris, FR", waitAddress());
+ Assert.assertEquals("Rue du Jardinet, Paris, FR", waitAddress());
- Assert.assertEquals("Rue du Jardinet, Paris, FR", geocoder.getAddress(48.8530000, 2.3400000));
+ Assert.assertEquals("Rue du Jardinet, Paris, FR", geocoder.getAddress(48.8530000, 2.3400000, null));
}
public void testOpenCage() throws InterruptedException {
@@ -96,9 +101,9 @@ public class GeocoderTest {
public void onFailure(Throwable e) {
}
});
- Assert.assertEquals("Charleston Road, California, US", waitAddress());
+ Assert.assertEquals("Charleston Road, California, US", waitAddress());
- Assert.assertEquals("Charleston Road, California, US", geocoder.getAddress(34.116302, -118.051519));
+ Assert.assertEquals("Charleston Road, California, US", geocoder.getAddress(34.116302, -118.051519, null));
}
public void testGeocodeFarm() throws InterruptedException {
@@ -114,9 +119,10 @@ public class GeocoderTest {
public void onFailure(Throwable e) {
}
});
- Assert.assertEquals("Estrella Avenue, Arcadia, California, United States", waitAddress());
+ Assert.assertEquals("Estrella Avenue, Arcadia, California, United States", waitAddress());
- Assert.assertEquals("Estrella Avenue, Arcadia, California, United States", geocoder.getAddress(34.116302, -118.051519));
+ Assert.assertEquals("Estrella Avenue, Arcadia, California, United States",
+ geocoder.getAddress(34.116302, -118.051519, null));
}
}