mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 01:19:49 +00:00
try to guess correct from and to locations
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@467 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
4300807b37
commit
d6e9cdfe1f
2 changed files with 38 additions and 5 deletions
|
@ -17,13 +17,18 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.BvgProvider;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.dto.Connection;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
/**
|
||||
|
@ -32,6 +37,7 @@ import de.schildbach.pte.dto.QueryDeparturesResult;
|
|||
public class BvgProviderLiveTest
|
||||
{
|
||||
private BvgProvider provider = new BvgProvider();
|
||||
private static final String ALL_PRODUCTS = "IRSUTBFC";
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
|
@ -62,4 +68,16 @@ public class BvgProviderLiveTest
|
|||
final QueryDeparturesResult queryDepartures = provider.queryDepartures("309557", 0);
|
||||
System.out.println(queryDepartures.departures);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 9056102, "Berlin", "Nollendorfplatz"),
|
||||
null, new Location(LocationType.STATION, 9013103, "Berlin", "Prinzenstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
|
||||
for (final Connection connection : result.connections)
|
||||
provider.getConnectionDetails(connection.link);
|
||||
System.out.println(moreResult);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue