place in departures

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@447 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach@gmail.com 2011-01-12 11:51:29 +00:00
parent 612111edef
commit 2ae3bff64b
23 changed files with 135 additions and 105 deletions

View file

@ -25,6 +25,7 @@ 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.NearbyStationsResult;
import de.schildbach.pte.dto.QueryConnectionsResult;
/**
@ -35,11 +36,19 @@ public class MvvProviderLiveTest
private MvvProvider provider = new MvvProvider();
private static final String ALL_PRODUCTS = "IRSUTBFC";
@Test
public void nearbyStation() throws Exception
{
final NearbyStationsResult result = provider.nearbyStations("350", 0, 0, 0, 0);
System.out.println(result.stations.size() + " " + result.stations);
}
@Test
public void shortConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Marienplatz"), null, new Location(
LocationType.ANY, 0, "Pasing"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, null, "Marienplatz"), null, new Location(
LocationType.ANY, 0, null, "Pasing"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
System.out.println(moreResult);
@ -48,8 +57,8 @@ public class MvvProviderLiveTest
@Test
public void longConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, "Starnberg, Arbeitsamt"), null,
new Location(LocationType.STATION, 0, "Ackermannstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ANY, 0, null, "Starnberg, Arbeitsamt"), null,
new Location(LocationType.STATION, 0, null, "Ackermannstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
// seems like there are no more connections all the time
}
@ -57,8 +66,8 @@ public class MvvProviderLiveTest
@Test
public void connectionBetweenCoordinates() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 48165238, 11577473, null, null), null,
new Location(LocationType.ADDRESS, 0, 47987199, 11326532, null, null), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 48165238, 11577473), null,
new Location(LocationType.ADDRESS, 0, 47987199, 11326532), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
System.out.println(moreResult);
@ -67,8 +76,8 @@ public class MvvProviderLiveTest
@Test
public void connectionBetweenCoordinateAndStation() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 48238341, 11478230, null, null), null,
new Location(LocationType.ANY, 0, "Ostbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, 48238341, 11478230), null,
new Location(LocationType.ANY, 0, null, "Ostbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
System.out.println(moreResult);
@ -77,8 +86,8 @@ public class MvvProviderLiveTest
@Test
public void connectionBetweenAddresses() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, "München, Maximilianstr. 1"), null,
new Location(LocationType.ADDRESS, 0, "Starnberg, Jahnstraße 50"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.ADDRESS, 0, null, "München, Maximilianstr. 1"),
null, new Location(LocationType.ADDRESS, 0, null, "Starnberg, Jahnstraße 50"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);
System.out.println(moreResult);
@ -87,7 +96,7 @@ public class MvvProviderLiveTest
@Test
public void connectionBetweenStationAndAddress() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 1220, "Josephsburg"), null, new Location(
final QueryConnectionsResult result = provider.queryConnections(new Location(LocationType.STATION, 1220, null, "Josephsburg"), null, new Location(
LocationType.ADDRESS, 0, 48188018, 11574239, null, "München Frankfurter Ring 35"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.context);