mirror of
https://codeberg.org/Mercury-IM/Smack
synced 2025-12-07 13:41:08 +01:00
geoloc: GeoLocation constructor should have Builder as sole paramter
Also remove that (broken) "Error and accuracy set" warning, but mark (get|set)Error() as deprecated.
This commit is contained in:
parent
9b20e2efd8
commit
f5c412a98f
4 changed files with 62 additions and 63 deletions
|
|
@ -121,6 +121,7 @@ public class GeoLocationTest extends SmackTestSuite {
|
|||
assertNotNull(geoLocation);
|
||||
assertNotNull(geoLocation.toXML());
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
GeoLocation constructedGeoLocation = GeoLocation.builder().setAccuracy(23d).setAlt(1000d).setAltAccuracy(10d).setArea("Delhi").setBearing(
|
||||
10d).setBuilding("Small Building").setCountry("India").setCountryCode("IN").setDescription(
|
||||
"My Description").setError(90d).setFloor("top").setLat(25.098345d).setLocality("awesome").setLon(
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ package org.jivesoftware.smackx.geoloc.provider;
|
|||
|
||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||
import static org.junit.jupiter.api.Assertions.assertNotNull;
|
||||
import static org.junit.jupiter.api.Assertions.assertNull;
|
||||
|
||||
import java.net.URI;
|
||||
|
||||
|
|
@ -82,7 +81,9 @@ public class GeoLocationProviderTest extends SmackTestSuite {
|
|||
assertEquals("IN", geoLocation.getCountryCode());
|
||||
assertEquals("WGS84", geoLocation.getDatum());
|
||||
assertEquals("My Description", geoLocation.getDescription());
|
||||
assertNull(geoLocation.getError());
|
||||
@SuppressWarnings("deprecation")
|
||||
Double error = geoLocation.getError();
|
||||
assertEquals(90, error);
|
||||
assertEquals("top", geoLocation.getFloor());
|
||||
assertEquals((Double) 25.098345d, geoLocation.getLat());
|
||||
assertEquals("awesome", geoLocation.getLocality());
|
||||
|
|
@ -150,7 +151,9 @@ public class GeoLocationProviderTest extends SmackTestSuite {
|
|||
assertEquals("IN", geoLocation.getCountryCode());
|
||||
assertEquals("Test Datum", geoLocation.getDatum());
|
||||
assertEquals("My Description", geoLocation.getDescription());
|
||||
assertNull(geoLocation.getError());
|
||||
@SuppressWarnings("deprecation")
|
||||
Double error = geoLocation.getError();
|
||||
assertEquals(90, error);
|
||||
assertEquals("top", geoLocation.getFloor());
|
||||
assertEquals((Double) 25.098345d, geoLocation.getLat());
|
||||
assertEquals("awesome", geoLocation.getLocality());
|
||||
|
|
@ -183,7 +186,9 @@ public class GeoLocationProviderTest extends SmackTestSuite {
|
|||
|
||||
GeoLocation geoLocation = messageWithGeoLocation.getExtension(GeoLocation.class);
|
||||
|
||||
assertEquals((Double) 90d, geoLocation.getError());
|
||||
@SuppressWarnings("deprecation")
|
||||
Double error = geoLocation.getError();
|
||||
assertEquals((Double) 90d, error);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
@ -223,8 +228,9 @@ public class GeoLocationProviderTest extends SmackTestSuite {
|
|||
GeoLocation geoLocation = messageWithGeoLocation.getExtension(GeoLocation.class);
|
||||
|
||||
assertEquals((Double) 90d, geoLocation.getAccuracy());
|
||||
assertNull(geoLocation.getError());
|
||||
|
||||
@SuppressWarnings("deprecation")
|
||||
Double error = geoLocation.getError();
|
||||
assertEquals(100, error);
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue