autocomplete for all efa based providers

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@245 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-10-06 11:36:18 +00:00
parent b11faf1cd7
commit b4bf75d875
10 changed files with 250 additions and 41 deletions

View file

@ -16,9 +16,12 @@
*/
package de.schildbach.pte.live;
import java.util.List;
import org.junit.Test;
import de.schildbach.pte.VrrProvider;
import de.schildbach.pte.dto.Autocomplete;
import de.schildbach.pte.dto.NearbyStationsResult;
import de.schildbach.pte.dto.QueryDeparturesResult;
@ -29,6 +32,38 @@ public class VrrProviderLiveTest
{
private final VrrProvider provider = new VrrProvider();
@Test
public void autocompleteIncomplete() throws Exception
{
final List<Autocomplete> autocompletes = provider.autocompleteStations("Kur");
list(autocompletes);
}
@Test
public void autocompleteIdentified() throws Exception
{
final List<Autocomplete> autocompletes = provider.autocompleteStations("Düsseldorf, Am Frohnhof");
list(autocompletes);
}
@Test
public void autocompleteCity() throws Exception
{
final List<Autocomplete> autocompletes = provider.autocompleteStations("Düsseldorf");
list(autocompletes);
}
private void list(final List<Autocomplete> autocompletes)
{
System.out.print(autocompletes.size() + " ");
for (final Autocomplete autocomplete : autocompletes)
System.out.print(autocomplete.toDebugString() + " ");
System.out.println();
}
@Test
public void nearbyStation() throws Exception
{