aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/org/traccar/location/UniversalLocationProvider.java2
-rw-r--r--test/org/traccar/location/LocationProviderTest.java18
2 files changed, 6 insertions, 14 deletions
diff --git a/src/org/traccar/location/UniversalLocationProvider.java b/src/org/traccar/location/UniversalLocationProvider.java
index 624d020a5..7f7028545 100644
--- a/src/org/traccar/location/UniversalLocationProvider.java
+++ b/src/org/traccar/location/UniversalLocationProvider.java
@@ -46,7 +46,7 @@ public class UniversalLocationProvider implements LocationProvider {
JsonObject location = json.getJsonObject("location");
callback.onSuccess(
location.getJsonNumber("lat").doubleValue(),
- location.getJsonNumber("lon").doubleValue(),
+ location.getJsonNumber("lng").doubleValue(),
json.getJsonNumber("accuracy").doubleValue());
}
return null;
diff --git a/test/org/traccar/location/LocationProviderTest.java b/test/org/traccar/location/LocationProviderTest.java
index 9c6000121..aec210c84 100644
--- a/test/org/traccar/location/LocationProviderTest.java
+++ b/test/org/traccar/location/LocationProviderTest.java
@@ -5,24 +5,20 @@ import org.junit.Test;
import org.traccar.BaseTest;
import org.traccar.model.CellTower;
import org.traccar.model.Network;
-import org.traccar.model.Position;
-
-import java.util.HashMap;
-import java.util.Map;
public class LocationProviderTest extends BaseTest {
private boolean enable = false;
@Test
- public void test() {
+ public void test() throws Exception {
if (enable) {
- testMozilla();
+ testGoogleLocationProvider();
}
}
- public void testMozilla() {
- MozillaLocationProvider locationProvider = new MozillaLocationProvider();
+ public void testGoogleLocationProvider() throws Exception {
+ GoogleLocationProvider locationProvider = new GoogleLocationProvider("KEY");
Network network = new Network(CellTower.from(260, 2, 10250, 26511));
@@ -39,11 +35,7 @@ public class LocationProviderTest extends BaseTest {
}
});
- try {
- Thread.sleep(10000);
- } catch (InterruptedException e) {
- e.printStackTrace();
- }
+ Thread.sleep(Long.MAX_VALUE);
}
}