AbstractProviderLiveTest holds reference to provider

This commit is contained in:
Andreas Schildbach 2012-03-20 18:35:49 +01:00
parent d254923b77
commit b7cbeff9de
67 changed files with 593 additions and 403 deletions

View file

@ -36,7 +36,10 @@ import de.schildbach.pte.dto.QueryDeparturesResult;
*/
public class GvhProviderLiveTest extends AbstractProviderLiveTest
{
private final GvhProvider provider = new GvhProvider(null);
public GvhProviderLiveTest()
{
super(new GvhProvider(null));
}
@Test
public void nearbyStations() throws Exception
@ -105,41 +108,42 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
@Test
public void incompleteConnection() throws Exception
{
final QueryConnectionsResult result = queryConnections(provider, new Location(LocationType.ANY, 0, null, "hann"), null, new Location(
LocationType.ANY, 0, null, "laat"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST, Accessibility.NEUTRAL);
final QueryConnectionsResult result = queryConnections(new Location(LocationType.ANY, 0, null, "hann"), null, new Location(LocationType.ANY,
0, null, "laat"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST, Accessibility.NEUTRAL);
System.out.println(result);
}
@Test
public void shortConnection() throws Exception
{
final QueryConnectionsResult result = queryConnections(provider, new Location(LocationType.STATION, 25000031, null, "Hannover Hauptbahnhof"),
null, new Location(LocationType.STATION, 25001141, null, "Hannover Bismarckstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST,
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 25000031, null, "Hannover Hauptbahnhof"), null,
new Location(LocationType.STATION, 25001141, null, "Hannover Bismarckstraße"), new Date(), true, ALL_PRODUCTS, WalkSpeed.FAST,
Accessibility.NEUTRAL);
System.out.println(result);
final QueryConnectionsResult laterResult = queryMoreConnections(provider, result.context, true);
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
System.out.println(laterResult);
}
@Test
public void connectionBetweenAnyAndAddress() throws Exception
{
final QueryConnectionsResult result = queryConnections(provider, new Location(LocationType.ANY, 0, 53069619, 8799202, null,
"bremen, neustadtswall 12"), null, new Location(LocationType.ADDRESS, 0, 53104124, 8788575, null, "Bremen Glücksburger Straße 37"),
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
final QueryConnectionsResult result = queryConnections(
new Location(LocationType.ANY, 0, 53069619, 8799202, null, "bremen, neustadtswall 12"), null, new Location(LocationType.ADDRESS, 0,
53104124, 8788575, null, "Bremen Glücksburger Straße 37"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL,
Accessibility.NEUTRAL);
System.out.println(result);
final QueryConnectionsResult laterResult = queryMoreConnections(provider, result.context, true);
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
System.out.println(laterResult);
}
@Test
public void connectionBetweenAddresses() throws Exception
{
final QueryConnectionsResult result = queryConnections(provider, new Location(LocationType.ADDRESS, 0, 53622859, 10133545, null,
final QueryConnectionsResult result = queryConnections(new Location(LocationType.ADDRESS, 0, 53622859, 10133545, null,
"Zamenhofweg 14, 22159 Hamburg, Deutschland"), null, new Location(LocationType.ADDRESS, 0, 53734260, 9674990, null,
"Lehmkuhlen 5, 25337 Elmshorn, Deutschland"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
System.out.println(result);
final QueryConnectionsResult laterResult = queryMoreConnections(provider, result.context, true);
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
System.out.println(laterResult);
}
}