EFA: Fix parsing of itdOdv and handling of location IDs.

This commit is contained in:
Andreas Schildbach 2015-01-12 12:47:46 +01:00
parent 64df076576
commit bb03f45f53
14 changed files with 406 additions and 436 deletions

View file

@ -49,7 +49,6 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "90001611"));
print(result);
}
@ -57,7 +56,6 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48401092, 9992037));
print(result);
}
@ -65,7 +63,13 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("90001611", false);
print(result);
}
@Test
public void suggestLocationsIdentified() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Ulm, Justizgebäude");
print(result);
}
@ -73,7 +77,6 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Kur");
print(result);
}
@ -81,15 +84,14 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsWithUmlaut() throws Exception
{
final SuggestLocationsResult result = suggestLocations("grün");
print(result);
}
@Test
public void shortTrip() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "9001011", null, "Justizgebäude"), null, new Location(
LocationType.STATION, "2504524", null, "Theater"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "9001011", "Ulm", "Justizgebäude"), null, new Location(
LocationType.STATION, "9001010", "Ulm", "Theater"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
assertEquals(QueryTripsResult.Status.OK, result.status);
assertTrue(result.trips.size() > 0);

View file

@ -49,7 +49,6 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10001167"));
print(result);
}
@ -57,7 +56,6 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, -37800941, 144966545));
print(result);
}
@ -65,7 +63,6 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("10001167", false);
print(result);
}
@ -73,7 +70,6 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
public void queryDeparturesInvalidStation() throws Exception
{
final QueryDeparturesResult result = queryDepartures("999999", false);
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
}
@ -81,7 +77,6 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Kur");
print(result);
}
@ -113,4 +108,13 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
final QueryTripsResult earlierResult = queryMoreTrips(later2Result.context, false);
print(earlierResult);
}
@Test
public void tripToAny() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, -37903445, 145102109, null,
"16 Burlington St, Oakleigh Victoria 3166, Australien"), null, new Location(LocationType.ANY, null, 0, 0, null,
"elizabeth st kensingtin"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
}
}

View file

@ -50,7 +50,6 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "350"));
print(result);
}
@ -58,7 +57,6 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48135232, 11560650));
print(result);
}
@ -66,7 +64,6 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("2", false);
assertEquals(QueryDeparturesResult.Status.OK, result.status);
print(result);
}
@ -75,15 +72,20 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
public void queryDeparturesInvalidStation() throws Exception
{
final QueryDeparturesResult result = queryDepartures("999999", false);
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
}
@Test
public void suggestLocationsIdentified() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Starnberg, Agentur für Arbeit");
print(result);
}
@Test
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Marien");
print(result);
}
@ -91,7 +93,6 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsWithUmlaut() throws Exception
{
final SuggestLocationsResult result = suggestLocations("grün");
print(result);
}
@ -126,10 +127,10 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
@Test
public void longTrip() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, null, null, "Starnberg, Arbeitsamt"), null, new Location(
LocationType.STATION, null, null, "Ackermannstraße"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "1005530", 48002924, 11340144, "Starnberg",
"Agentur für Arbeit"), null, new Location(LocationType.STATION, null, null, "Ackermannstraße"), new Date(), true, Product.ALL,
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
// seems like there are no more trips all the time
}
@Test

View file

@ -49,7 +49,6 @@ public class SydneyProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10101101"));
print(result);
}
@ -57,7 +56,6 @@ public class SydneyProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, -32823911, 151462824));
print(result);
}
@ -65,15 +63,13 @@ public class SydneyProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("10101101", false);
print(result);
}
@Test
public void suggestLocations() throws Exception
public void suggestLocationsIdentified() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Town Hall Station");
final SuggestLocationsResult result = suggestLocations("Sydney, Town Hall Station");
print(result);
}
@ -81,7 +77,6 @@ public class SydneyProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Kur");
print(result);
}

View file

@ -49,7 +49,6 @@ public class TfiProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "51013670"));
print(result);
}
@ -57,7 +56,6 @@ public class TfiProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53348656, -6262221));
print(result);
}
@ -65,7 +63,6 @@ public class TfiProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("51013670", false);
print(result);
}
@ -73,7 +70,6 @@ public class TfiProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Lower O'Connell Street");
print(result);
}
@ -81,7 +77,7 @@ public class TfiProviderLiveTest extends AbstractProviderLiveTest
public void shortTrip() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "51013670", "Dublin City South",
"O'Connell Bridge (on Lower O'Connell Street)"), null, new Location(LocationType.STATION, "52003679", "Dublin City South",
"O'Connell Bridge (on Lower O'Connell Street)"), null, new Location(LocationType.STATION, "51005661", "Dublin City South",
"Dublin (Baggot Street)"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
assertEquals(QueryTripsResult.Status.OK, result.status);

View file

@ -90,7 +90,6 @@ public class TlemProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocations() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Lower Arncott The Plough");
print(result);
}
@ -98,7 +97,6 @@ public class TlemProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Birming");
print(result);
}
@ -187,4 +185,22 @@ public class TlemProviderLiveTest extends AbstractProviderLiveTest
final QueryTripsResult earlierResult = queryMoreTrips(later2Result.context, false);
print(earlierResult);
}
@Test
public void tripFromPOI() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.POI,
"poiID:48863:31117134:-1:Statue:Ham (London):Statue:ANY:POI:517246:826916:TFLV:uk", 51444620, -314316, "Ham (London)", "Statue"),
null, new Location(LocationType.ADDRESS, "streetID:106269::31117001:-1", "London", "Cannon Street, London"), new Date(), true,
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
}
@Test
public void tripPostcode() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, null, null, "se7 7tr"), null, new Location(LocationType.ANY, null,
null, "n9 0nx"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
}
}

View file

@ -49,7 +49,6 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "119"));
print(result);
}
@ -57,7 +56,6 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47049107, 8312502));
print(result);
}
@ -65,7 +63,13 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("717", false);
print(result);
}
@Test
public void suggestLocationsIdentified() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Luzern, Kantonalbank");
print(result);
}
@ -73,7 +77,6 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Kur");
print(result);
}
@ -81,15 +84,14 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsWithUmlaut() throws Exception
{
final SuggestLocationsResult result = suggestLocations("grün");
print(result);
}
@Test
public void shortTrip() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "119", 47050760, 8310252, "Luzern", "Luzern, Bahnhof"), null,
new Location(LocationType.STATION, "118", 47048844, 8306433, "Luzern", "Kantonalbank"), new Date(), true, Product.ALL,
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "53020041", 47050164, 8310352, "Luzern", "Bahnhof"), null,
new Location(LocationType.STATION, "53028841", 47048564, 8306016, "Luzern", "Kantonalbank"), new Date(), true, Product.ALL,
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
assertEquals(QueryTripsResult.Status.OK, result.status);

View file

@ -46,7 +46,6 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3000510"));
print(result);
}
@ -54,7 +53,6 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49455472, 11079655));
print(result);
}
@ -62,7 +60,6 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("3000510", false);
print(result);
}
@ -70,7 +67,6 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Kur");
print(result);
}
@ -78,7 +74,6 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsWithUmlaut() throws Exception
{
final SuggestLocationsResult result = suggestLocations("grün");
print(result);
}
@ -92,6 +87,17 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
print(laterResult);
}
@Test
public void tripToPOI() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 49527298, 10836204), null, new Location(LocationType.POI,
"poiID:246:9564000:1:Grundschule Grimmstr.:Nürnberg:Grundschule Grimmstr.:ANY:POI:4436708:678322:NAV4:VGN", 49468692, 11125334,
"Nürnberg", "Grundschule Grimmstr."), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
print(laterResult);
}
@Test
public void tripToAddress() throws Exception
{

View file

@ -49,7 +49,6 @@ public class VmobilProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60001296"));
print(result);
}
@ -57,7 +56,6 @@ public class VmobilProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
print(result);
}
@ -65,7 +63,13 @@ public class VmobilProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("60001296", false);
print(result);
}
@Test
public void suggestLocationsIdentified() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Katzenturm");
print(result);
}
@ -73,7 +77,6 @@ public class VmobilProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Kur");
print(result);
}
@ -81,15 +84,14 @@ public class VmobilProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsWithUmlaut() throws Exception
{
final SuggestLocationsResult result = suggestLocations("grün");
print(result);
}
@Test
public void shortTrip() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "60000822", 47238428, 9596940, "Feldkirch", "Katzenturm"),
null, new Location(LocationType.STATION, "60000305", 47240744, 9589368, "Tosters", "Vorarlberghalle"), new Date(), true, Product.ALL,
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "66200822", 47238428, 9596940, "Feldkirch", "Katzenturm"),
null, new Location(LocationType.STATION, "66200305", 47240744, 9589368, "Tosters", "Vorarlberghalle"), new Date(), true, Product.ALL,
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
assertEquals(QueryTripsResult.Status.OK, result.status);

View file

@ -51,7 +51,6 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60203090"));
print(result);
}
@ -59,7 +58,6 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48207355, 16370602));
print(result);
}
@ -67,7 +65,6 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("60203090", false);
print(result);
}
@ -75,7 +72,6 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Kur");
print(result);
}
@ -83,7 +79,6 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsWithUmlaut() throws Exception
{
final SuggestLocationsResult result = suggestLocations("grün");
print(result);
}
@ -128,6 +123,17 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
print(earlierResult);
}
@Test
public void tripToPOI() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, null, 48221088, 16342658, "Wien", "Antonigasse 4"), null,
new Location(LocationType.POI, "poiID:1005:49000000:-1", 48199844, 16365834, "Wien", "Naschmarkt"), new Date(), true, Product.ALL,
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
print(laterResult);
}
@Test
public void tripBetweenCoordinates() throws Exception
{

View file

@ -51,7 +51,6 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStations() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "20019904"));
print(result);
}
@ -59,11 +58,9 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
public void nearbyStationsByCoordinate() throws Exception
{
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51218693, 6777785));
print(result);
final NearbyStationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 51719648, 8754330));
print(result2);
}
@ -71,11 +68,9 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
public void queryDepartures() throws Exception
{
final QueryDeparturesResult result = queryDepartures("1007258", false);
print(result);
final QueryDeparturesResult result2 = queryDepartures("20019904", false);
print(result2);
// Bonn
@ -87,7 +82,6 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
public void queryManyDeparturesWithEquivs() throws Exception
{
final QueryDeparturesResult result = queryDepartures("20018235", true);
print(result);
}
@ -95,11 +89,9 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIncomplete() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Kur");
print(result);
final SuggestLocationsResult paderbornResult = suggestLocations("Paderborn Hbf");
print(paderbornResult);
}
@ -107,7 +99,6 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsWithUmlaut() throws Exception
{
final SuggestLocationsResult result = suggestLocations("grün");
print(result);
}
@ -115,7 +106,6 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsIdentified() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Düsseldorf, Am Frohnhof");
print(result);
}
@ -147,10 +137,18 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
public void suggestLocationsCity() throws Exception
{
final SuggestLocationsResult result = suggestLocations("Düsseldorf");
print(result);
}
@Test
public void anyTrip() throws Exception
{
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, null, null, "Köln"), null, new Location(LocationType.ANY, null,
null, "Bonn"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
print(result);
assertEquals(QueryTripsResult.Status.AMBIGUOUS, result.status);
}
@Test
public void shortTrip() throws Exception
{