mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-18 16:29:51 +00:00
querying for connections uses Location for from, via and to parameters
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@249 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
8797d02a4b
commit
e282106c00
24 changed files with 308 additions and 557 deletions
|
@ -23,6 +23,7 @@ import org.junit.Test;
|
|||
|
||||
import de.schildbach.pte.MvvProvider;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||
|
||||
|
@ -37,8 +38,8 @@ public class MvvProviderLiveTest
|
|||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Marienplatz", null, null, LocationType.ANY, "Pasing",
|
||||
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Marienplatz"), null, new Location(
|
||||
LocationType.ANY, 0, 0, 0, "Pasing"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
|
||||
System.out.println(moreResult);
|
||||
|
@ -47,8 +48,8 @@ public class MvvProviderLiveTest
|
|||
@Test
|
||||
public void longConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Starnberg, Arbeitsamt", null, null, LocationType.ANY,
|
||||
"Ackermannstraße", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, 0, 0, "Starnberg, Arbeitsamt"), null,
|
||||
new Location(LocationType.STATION, 0, 0, 0, "Ackermannstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
// seems like there are no more connections all the time
|
||||
}
|
||||
|
@ -56,8 +57,8 @@ public class MvvProviderLiveTest
|
|||
@Test
|
||||
public void connectionBetweenCoordinates() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(LocationType.WGS84, "48165238,11577473", null, null, LocationType.WGS84,
|
||||
"47987199,11326532", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 48165238, 11577473, null), null,
|
||||
new Location(LocationType.ADDRESS, 0, 47987199, 11326532, null), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
|
||||
System.out.println(moreResult);
|
||||
|
@ -66,8 +67,8 @@ public class MvvProviderLiveTest
|
|||
@Test
|
||||
public void connectionBetweenCoordinateAndStation() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(LocationType.WGS84, "48238341,11478230", null, null, LocationType.ANY,
|
||||
"Ostbahnhof", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 48238341, 11478230, null), null,
|
||||
new Location(LocationType.ANY, 0, 0, 0, "Ostbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
|
||||
System.out.println(moreResult);
|
||||
|
@ -76,8 +77,8 @@ public class MvvProviderLiveTest
|
|||
@Test
|
||||
public void connectionBetweenAddresses() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = provider.queryConnections(LocationType.ADDRESS, "München, Maximilianstr. 1", null, null,
|
||||
LocationType.ADDRESS, "Starnberg, Jahnstraße 50", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 0, 0, "München, Maximilianstr. 1"),
|
||||
null, new Location(LocationType.ADDRESS, 0, 0, 0, "Starnberg, Jahnstraße 50"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
|
||||
System.out.println(moreResult);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue