mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 05:38:47 +00:00
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:
parent
53b58f3306
commit
dfa35cbccf
2 changed files with 28 additions and 29 deletions
|
@ -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
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue