product selection for directions

git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@241 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
andreas.schildbach 2010-10-05 14:26:30 +00:00
parent 89da3a9bba
commit dcd673d6f7
21 changed files with 172 additions and 59 deletions

View file

@ -34,7 +34,8 @@ import de.schildbach.pte.dto.QueryDeparturesResult;
public class BahnProviderLiveTest
{
private BahnProvider provider = new BahnProvider();
private static final String ALL_PRODUCTS = "IRSUTBFC";
@Test
public void departures() throws Exception
{
@ -46,7 +47,7 @@ public class BahnProviderLiveTest
public void shortConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Berlin", null, null, LocationType.ANY, "Leipzig",
new Date(), true, WalkSpeed.NORMAL);
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
for (final Connection connection : result.connections)
@ -58,7 +59,7 @@ public class BahnProviderLiveTest
public void slowConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Marienburger Str., Berlin ", null, null, LocationType.ANY,
"Tutzinger-Hof-Platz, Starnberg", new Date(), true, WalkSpeed.NORMAL);
"Tutzinger-Hof-Platz, Starnberg", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
for (final Connection connection : result.connections)
@ -70,7 +71,7 @@ public class BahnProviderLiveTest
public void connectionWithFootway() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ADDRESS, "Berlin - Mitte, Unter den Linden 24", null, null,
LocationType.ADDRESS, "Starnberg, Possenhofener Straße 13", new Date(), true, WalkSpeed.NORMAL);
LocationType.ADDRESS, "Starnberg, Possenhofener Straße 13", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);

View file

@ -33,7 +33,8 @@ import de.schildbach.pte.dto.QueryDeparturesResult;
public class LinzProviderLiveTest
{
private LinzProvider provider = new LinzProvider();
private static final String ALL_PRODUCTS = "IRSUTBFC";
@Test
public void queryDepartures() throws Exception
{
@ -45,48 +46,49 @@ public class LinzProviderLiveTest
public void shortConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.STATION, "Linz Hauptbahnhof", null, null, LocationType.STATION,
"Linz Auwiesen", new Date(), true, WalkSpeed.FAST);
"Linz Auwiesen", new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST);
System.out.println(result);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
}
@Test
public void longConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.STATION, "Linz Auwiesen", null, null, LocationType.STATION,
"Linz Hafen", new Date(), true, WalkSpeed.SLOW);
"Linz Hafen", new Date(), true, ALL_PRODUCTS, WalkSpeed.SLOW);
System.out.println(result);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
}
@Test
public void connectionBetweenCoordinates() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.WGS84, "48165238,11577473", null, null, LocationType.WGS84,
"47987199,11326532", new Date(), true, WalkSpeed.NORMAL);
"47987199,11326532", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
}
@Test public void connectionBetweenCoordinateAndStation() throws Exception
@Test
public void connectionBetweenCoordinateAndStation() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.WGS84, "48238341,11478230", null, null, LocationType.ANY,
"Ostbahnhof", new Date(), true, WalkSpeed.NORMAL);
"Ostbahnhof", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
}
@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, WalkSpeed.NORMAL);
LocationType.ADDRESS, "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);
// final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
// System.out.println(moreResult);
}
}

View file

@ -32,12 +32,13 @@ import de.schildbach.pte.dto.QueryConnectionsResult;
public class MvvProviderLiveTest
{
private MvvProvider provider = new MvvProvider();
private static final String ALL_PRODUCTS = "IRSUTBFC";
@Test
public void shortConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Marienplatz", null, null, LocationType.ANY, "Pasing",
new Date(), true, WalkSpeed.NORMAL);
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);
@ -47,7 +48,7 @@ public class MvvProviderLiveTest
public void longConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Starnberg, Arbeitsamt", null, null, LocationType.ANY,
"Ackermannstraße", new Date(), true, WalkSpeed.NORMAL);
"Ackermannstraße", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
// seems like there are no more connections all the time
}
@ -56,7 +57,7 @@ public class MvvProviderLiveTest
public void connectionBetweenCoordinates() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.WGS84, "48165238,11577473", null, null, LocationType.WGS84,
"47987199,11326532", new Date(), true, WalkSpeed.NORMAL);
"47987199,11326532", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);
@ -66,7 +67,7 @@ public class MvvProviderLiveTest
public void connectionBetweenCoordinateAndStation() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.WGS84, "48238341,11478230", null, null, LocationType.ANY,
"Ostbahnhof", new Date(), true, WalkSpeed.NORMAL);
"Ostbahnhof", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);
@ -76,7 +77,7 @@ public class MvvProviderLiveTest
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, WalkSpeed.NORMAL);
LocationType.ADDRESS, "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);

View file

@ -33,6 +33,7 @@ import de.schildbach.pte.dto.QueryConnectionsResult;
public class OebbProviderLiveTest
{
private OebbProvider provider = new OebbProvider();
private static final String ALL_PRODUCTS = "IRSUTBFC";
@Test
public void nearbyStation() throws Exception
@ -46,7 +47,7 @@ public class OebbProviderLiveTest
public void shortConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Linz", null, null, LocationType.ANY, "Berlin", new Date(),
true, WalkSpeed.NORMAL);
true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);
@ -56,7 +57,7 @@ public class OebbProviderLiveTest
public void slowConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Ramsen, Zoll", null, null, LocationType.ANY, "Azuga",
new Date(), true, WalkSpeed.NORMAL);
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);
@ -66,7 +67,7 @@ public class OebbProviderLiveTest
public void connectionWithFootway() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Graz, Haselweg", null, null, LocationType.ADDRESS,
"Innsbruck, Gumppstraße 69", new Date(), true, WalkSpeed.NORMAL);
"Innsbruck, Gumppstraße 69", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);
@ -76,7 +77,7 @@ public class OebbProviderLiveTest
public void connectionWithFootway2() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Wien, Krottenbachstraße 110!", null, null,
LocationType.ADDRESS, "Wien, Meidlinger Hauptstraße 1", new Date(), true, WalkSpeed.NORMAL);
LocationType.ADDRESS, "Wien, Meidlinger Hauptstraße 1", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);

View file

@ -35,6 +35,7 @@ import de.schildbach.pte.dto.QueryConnectionsResult;
public class SbbProviderLiveTest
{
private SbbProvider provider = new SbbProvider();
private static final String ALL_PRODUCTS = "IRSUTBFC";
@Test
public void nearbyStation() throws Exception
@ -48,7 +49,7 @@ public class SbbProviderLiveTest
public void shortConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Zürich!", null, null, LocationType.ANY, "Bern",
new Date(), true, WalkSpeed.NORMAL);
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);
@ -58,7 +59,7 @@ public class SbbProviderLiveTest
public void slowConnection() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ANY, "Schocherswil, Alte Post!", null, null, LocationType.ANY,
"Laconnex, Mollach", new Date(), true, WalkSpeed.NORMAL);
"Laconnex, Mollach", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);
@ -68,7 +69,7 @@ public class SbbProviderLiveTest
public void connectionWithFootway() throws Exception
{
final QueryConnectionsResult result = provider.queryConnections(LocationType.ADDRESS, "Spiez, Seestraße 62", null, null,
LocationType.ADDRESS, "Einsiedeln, Erlenmoosweg 24", new Date(), true, WalkSpeed.NORMAL);
LocationType.ADDRESS, "Einsiedeln, Erlenmoosweg 24", new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL);
System.out.println(result);
final QueryConnectionsResult moreResult = provider.queryMoreConnections(result.linkLater);
System.out.println(moreResult);