mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 05:28:46 +00:00
autocomplete using XML-interface for Switzerland and Belgium
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@300 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
824bab1b5e
commit
06712bf0eb
9 changed files with 165 additions and 41 deletions
|
@ -39,6 +39,22 @@ public class SbbProviderLiveTest
|
|||
private SbbProvider provider = new SbbProvider();
|
||||
private static final String ALL_PRODUCTS = "IRSUTBFC";
|
||||
|
||||
@Test
|
||||
public void autoComplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("haupt");
|
||||
|
||||
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 nearbyStation() throws Exception
|
||||
{
|
||||
|
@ -90,11 +106,4 @@ public class SbbProviderLiveTest
|
|||
for (final Connection connection : moreResult.connections)
|
||||
System.out.println(provider.getConnectionDetails(connection.link));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autoComplete() throws Exception
|
||||
{
|
||||
final List<Location> result = provider.autocompleteStations("haupt");
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -16,9 +16,12 @@
|
|||
*/
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.SncbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
||||
/**
|
||||
|
@ -28,6 +31,22 @@ public class SncbProviderLiveTest
|
|||
{
|
||||
private final SncbProvider provider = new SncbProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Brussel S");
|
||||
|
||||
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 nearbyStation() throws Exception
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue