mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 17:29:51 +00:00
Consolidate Frankfurt into Hesse
This commit is contained in:
parent
008c0f6eb5
commit
0b17a9eb47
5 changed files with 240 additions and 475 deletions
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -45,13 +48,21 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 3011245), 0, 0);
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.STATION, 3000001), 0, 0);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 50108625, 8669604), 0, 0);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinateKassel() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.queryNearbyStations(new Location(LocationType.ADDRESS, 51318447, 9496250), 0, 0);
|
||||
|
||||
|
@ -61,9 +72,25 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures(3011245, 0, false);
|
||||
|
||||
final QueryDeparturesResult result = provider.queryDepartures(3000408, 0, false);
|
||||
print(result);
|
||||
|
||||
final QueryDeparturesResult result2 = provider.queryDepartures(3000010, 0, false);
|
||||
print(result2);
|
||||
|
||||
final QueryDeparturesResult result3 = provider.queryDepartures(3015989, 0, false);
|
||||
print(result3);
|
||||
|
||||
final QueryDeparturesResult result4 = provider.queryDepartures(3000139, 0, false);
|
||||
print(result4);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Flughafen");
|
||||
|
||||
print(autocompletes);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -74,8 +101,86 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
print(autocompletes);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("könig");
|
||||
|
||||
print(autocompletes);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortTrip() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, 3000001, null, "Hauptwache"), null, new Location(
|
||||
LocationType.STATION, 3000912, null, "Südbahnhof"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
assertTrue(result.trips.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryTripsResult later2Result = queryMoreTrips(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryTripsResult later3Result = queryMoreTrips(later2Result.context, true);
|
||||
System.out.println(later3Result);
|
||||
|
||||
if (!later3Result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryTripsResult later4Result = queryMoreTrips(later3Result.context, true);
|
||||
System.out.println(later4Result);
|
||||
|
||||
if (!later4Result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryTripsResult later5Result = queryMoreTrips(later4Result.context, true);
|
||||
System.out.println(later5Result);
|
||||
|
||||
if (!later5Result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryTripsResult later6Result = queryMoreTrips(later5Result.context, true);
|
||||
System.out.println(later6Result);
|
||||
|
||||
if (!result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryTripsResult earlierResult = queryMoreTrips(result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
|
||||
if (!earlierResult.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryTripsResult earlier2Result = queryMoreTrips(earlierResult.context, false);
|
||||
System.out.println(earlier2Result);
|
||||
|
||||
if (!earlier2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryTripsResult earlier3Result = queryMoreTrips(earlier2Result.context, false);
|
||||
System.out.println(earlier3Result);
|
||||
|
||||
if (!earlier3Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryTripsResult earlier4Result = queryMoreTrips(earlier3Result.context, false);
|
||||
System.out.println(earlier4Result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortTripKassel() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, 2200007, null, "Kassel Wilhelmshöhe"), null, new Location(
|
||||
LocationType.STATION, 2200278, null, "Kassel Wilhelmshöher Weg"), new Date(), true, Product.ALL, WalkSpeed.NORMAL,
|
||||
|
@ -84,4 +189,29 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void slowTrip() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, 3029079, 50017679, 8229480, "Mainz", "An den Dünen"), null,
|
||||
new Location(LocationType.STATION, 3013508, 50142890, 8895203, "Hanau", "Beethovenplatz"), new Date(), true, Product.ALL,
|
||||
WalkSpeed.NORMAL, Accessibility.BARRIER_FREE);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
assertTrue(result.trips.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortTripByName() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, 0, null, "Frankfurt Bockenheimer Warte!"), null, new Location(
|
||||
LocationType.ANY, 0, null, "Frankfurt Hauptbahnhof!"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue