aboutsummaryrefslogtreecommitdiff
path: root/src/test/java/org/traccar/speedlimit
diff options
context:
space:
mode:
authorAnton Tananaev <anton.tananaev@gmail.com>2020-09-14 21:54:19 -0700
committerAnton Tananaev <anton.tananaev@gmail.com>2020-09-14 21:54:19 -0700
commitf4e7350ee5e15c0d463a4fcf83db877acc181f13 (patch)
tree4a397328c4110aedcfcf298d57993a269a87b759 /src/test/java/org/traccar/speedlimit
parente454daf2bdef1ec13ab30fad36bbb330f1ddd6d0 (diff)
downloadtraccar-server-f4e7350ee5e15c0d463a4fcf83db877acc181f13.tar.gz
traccar-server-f4e7350ee5e15c0d463a4fcf83db877acc181f13.tar.bz2
traccar-server-f4e7350ee5e15c0d463a4fcf83db877acc181f13.zip
Add speed limit provider
Diffstat (limited to 'src/test/java/org/traccar/speedlimit')
-rw-r--r--src/test/java/org/traccar/speedlimit/OverpassSpeedLimitProviderTest.java35
1 files changed, 35 insertions, 0 deletions
diff --git a/src/test/java/org/traccar/speedlimit/OverpassSpeedLimitProviderTest.java b/src/test/java/org/traccar/speedlimit/OverpassSpeedLimitProviderTest.java
new file mode 100644
index 000000000..dcac78f80
--- /dev/null
+++ b/src/test/java/org/traccar/speedlimit/OverpassSpeedLimitProviderTest.java
@@ -0,0 +1,35 @@
+package org.traccar.speedlimit;
+
+import org.junit.Ignore;
+import org.junit.Test;
+
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.fail;
+
+public class OverpassSpeedLimitProviderTest {
+
+ @Ignore
+ @Test
+ public void test() throws Exception {
+ testLocationProvider();
+ }
+
+ public void testLocationProvider() throws Exception {
+ SpeedLimitProvider provider = new OverpassSpeedLimitProvider("http://8.8.8.8/api/interpreter");
+
+ provider.getSpeedLimit(34.74767, -82.48098, new SpeedLimitProvider.SpeedLimitProviderCallback() {
+ @Override
+ public void onSuccess(double speedLimit) {
+ assertEquals(52.1, speedLimit, 0.1);
+ }
+
+ @Override
+ public void onFailure(Throwable e) {
+ fail();
+ }
+ });
+
+ Thread.sleep(Long.MAX_VALUE);
+ }
+
+}