use API for autocompletes

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@449 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-01-13 12:26:59 +00:00
parent 53b58f3306
commit dfa35cbccf
2 changed files with 28 additions and 29 deletions

View file

@ -18,6 +18,7 @@
package de.schildbach.pte.live;
import java.util.Date;
import java.util.List;
import org.junit.Test;
@ -44,6 +45,30 @@ public class BahnProviderLiveTest
System.out.println(queryDepartures.departures);
}
@Test
public void autocompleteIncomplete() throws Exception
{
final List<Location> autocompletes = provider.autocompleteStations("Be");
list(autocompletes);
}
@Test
public void autocompleteIdentified() throws Exception
{
final List<Location> autocompletes = provider.autocompleteStations("Berlin");
list(autocompletes);
}
private void list(final List<Location> autocompletes)
{
System.out.print(autocompletes.size() + " ");
for (final Location autocomplete : autocompletes)
System.out.print(autocomplete.toDebugString() + " ");
System.out.println();
}
@Test
public void shortConnection() throws Exception
{