Fix autocomplete coverage for Dresden.

This commit is contained in:
Andreas Schildbach 2014-02-10 11:11:54 +01:00
parent adca912cc4
commit ac941b608b
2 changed files with 10 additions and 12 deletions

View file

@ -17,12 +17,6 @@
package de.schildbach.pte; 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 * @author Andreas Schildbach
*/ */
@ -58,10 +52,4 @@ public class VvoProvider extends AbstractEfaProvider
return false; return false;
} }
@Override
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
{
return xmlStopfinderRequest(new Location(LocationType.STATION, 0, null, constraint.toString()));
}
} }

View file

@ -17,7 +17,9 @@
package de.schildbach.pte.live; package de.schildbach.pte.live;
import static org.hamcrest.CoreMatchers.hasItem;
import static org.junit.Assert.assertEquals; import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertThat;
import static org.junit.Assert.assertTrue; import static org.junit.Assert.assertTrue;
import java.util.Date; import java.util.Date;
@ -85,6 +87,14 @@ public class VvoProviderLiveTest extends AbstractProviderLiveTest
print(autocompletes); print(autocompletes);
} }
@Test
public void autocompleteCoverage() throws Exception
{
final List<Location> dresdenAutocompletes = provider.autocompleteStations("Dresden Postplatz");
print(dresdenAutocompletes);
assertThat(dresdenAutocompletes, hasItem(new Location(LocationType.STATION, 33000037)));
}
@Test @Test
public void shortTrip() throws Exception public void shortTrip() throws Exception
{ {