diff --git a/enabler/src/de/schildbach/pte/ShProvider.java b/enabler/src/de/schildbach/pte/ShProvider.java index 98c02e3d..8edc5685 100644 --- a/enabler/src/de/schildbach/pte/ShProvider.java +++ b/enabler/src/de/schildbach/pte/ShProvider.java @@ -145,16 +145,6 @@ public class ShProvider extends AbstractHafasProvider return super.splitStationName(address); } - @Override - public NearbyLocationsResult queryNearbyLocations(final EnumSet types, final Location location, final int maxDistance, - final int maxLocations) throws IOException - { - if (location.type == LocationType.STATION && location.hasId()) - return nearbyStationsById(location.id, maxDistance); - else - throw new IllegalArgumentException("cannot handle: " + location); - } - @Override protected NearbyLocationsResult nearbyStationsById(final String id, final int maxDistance) throws IOException { diff --git a/enabler/test/de/schildbach/pte/live/ShProviderLiveTest.java b/enabler/test/de/schildbach/pte/live/ShProviderLiveTest.java index 53beed3e..737d4d0e 100644 --- a/enabler/test/de/schildbach/pte/live/ShProviderLiveTest.java +++ b/enabler/test/de/schildbach/pte/live/ShProviderLiveTest.java @@ -18,6 +18,7 @@ package de.schildbach.pte.live; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertTrue; import java.util.Date; @@ -51,6 +52,21 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest print(result); } + @Test + public void nearbyStationsInvalidStation() throws Exception + { + final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "999999")); + assertEquals(NearbyLocationsResult.Status.INVALID_ID, result.status); + } + + @Test + public void nearbyStationsByCoordinate() throws Exception + { + final NearbyLocationsResult result = queryNearbyStations(Location.coord(54325845, 10122920)); + print(result); + assertTrue(result.locations.size() > 0); + } + @Test public void queryDepartures() throws Exception {