mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-20 17:29:51 +00:00
Fix autocomplete coverage for Salzburg.
This commit is contained in:
parent
467299ec99
commit
adca912cc4
2 changed files with 22 additions and 12 deletions
|
@ -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 SvvProvider extends AbstractEfaProvider
|
|||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -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;
|
||||
|
@ -77,6 +79,26 @@ public class SvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
print(autocompletes);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteCoverage() throws Exception
|
||||
{
|
||||
final List<Location> salzburgAutocompletes = provider.autocompleteStations("Salzburg Süd");
|
||||
print(salzburgAutocompletes);
|
||||
assertThat(salzburgAutocompletes, hasItem(new Location(LocationType.STATION, 60650458)));
|
||||
|
||||
final List<Location> strasswalchenAutocompletes = provider.autocompleteStations("Straßwalchen West");
|
||||
print(strasswalchenAutocompletes);
|
||||
assertThat(strasswalchenAutocompletes, hasItem(new Location(LocationType.STATION, 60656483)));
|
||||
|
||||
final List<Location> schwarzachAutocompletes = provider.autocompleteStations("Schwarzach Abtsdorf");
|
||||
print(schwarzachAutocompletes);
|
||||
assertThat(schwarzachAutocompletes, hasItem(new Location(LocationType.STATION, 60656614)));
|
||||
|
||||
final List<Location> trimmelkamAutocompletes = provider.autocompleteStations("Trimmelkam");
|
||||
print(trimmelkamAutocompletes);
|
||||
assertThat(trimmelkamAutocompletes, hasItem(new Location(LocationType.STATION, 60640776)));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortTrip() throws Exception
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue