diff --git a/enabler/src/de/schildbach/pte/MvgProvider.java b/enabler/src/de/schildbach/pte/MvgProvider.java index 0748a0d7..3deba4c7 100644 --- a/enabler/src/de/schildbach/pte/MvgProvider.java +++ b/enabler/src/de/schildbach/pte/MvgProvider.java @@ -17,12 +17,6 @@ package de.schildbach.pte; -import java.io.IOException; -import java.util.List; - -import de.schildbach.pte.dto.Location; -import de.schildbach.pte.dto.LocationType; - /** * @author Andreas Schildbach */ @@ -49,10 +43,4 @@ public class MvgProvider extends AbstractEfaProvider return false; } - - @Override - public List autocompleteStations(final CharSequence constraint) throws IOException - { - return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString())); - } } diff --git a/enabler/test/de/schildbach/pte/live/MvgProviderLiveTest.java b/enabler/test/de/schildbach/pte/live/MvgProviderLiveTest.java index b9e51997..dd1176e6 100644 --- a/enabler/test/de/schildbach/pte/live/MvgProviderLiveTest.java +++ b/enabler/test/de/schildbach/pte/live/MvgProviderLiveTest.java @@ -17,7 +17,9 @@ package de.schildbach.pte.live; +import static org.hamcrest.CoreMatchers.hasItem; import static org.junit.Assert.assertEquals; +import static org.junit.Assert.assertThat; import static org.junit.Assert.assertTrue; import java.util.Date; @@ -85,6 +87,26 @@ public class MvgProviderLiveTest extends AbstractProviderLiveTest print(autocompletes); } + @Test + public void autocompleteCoverage() throws Exception + { + final List luedenscheidAutocompletes = provider.autocompleteStations("Lüdenscheid Freibad"); + print(luedenscheidAutocompletes); + assertThat(luedenscheidAutocompletes, hasItem(new Location(LocationType.STATION, 24200153))); + + final List iserlohnAutocompletes = provider.autocompleteStations("Iserlohn Rathaus"); + print(iserlohnAutocompletes); + assertThat(iserlohnAutocompletes, hasItem(new Location(LocationType.STATION, 24200764))); + + final List plettenbergAutocompletes = provider.autocompleteStations("Plettenberg Friedhof"); + print(plettenbergAutocompletes); + assertThat(plettenbergAutocompletes, hasItem(new Location(LocationType.STATION, 24202864))); + + final List mendenAutocompletes = provider.autocompleteStations("Menden Am Gillfeld"); + print(mendenAutocompletes); + assertThat(mendenAutocompletes, hasItem(new Location(LocationType.STATION, 24202193))); + } + @Test public void shortTrip() throws Exception {