mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 06:08:52 +00:00
Rename .queryNearbyStations() to .queryNearbyLocations() and make it find POIs too.
This commit is contained in:
parent
25c2eb6176
commit
8df79805d0
84 changed files with 565 additions and 665 deletions
|
@ -25,6 +25,7 @@ import java.util.Calendar;
|
|||
import java.util.Collection;
|
||||
import java.util.Currency;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -53,7 +54,7 @@ import de.schildbach.pte.dto.Line;
|
|||
import de.schildbach.pte.dto.LineDestination;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Point;
|
||||
import de.schildbach.pte.dto.Position;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
@ -507,23 +508,37 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
private StringBuilder xmlCoordRequestParameters(final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
private StringBuilder xmlCoordRequestParameters(final EnumSet<LocationType> types, final int lat, final int lon, final int maxDistance,
|
||||
final int maxLocations)
|
||||
{
|
||||
final StringBuilder parameters = new StringBuilder();
|
||||
appendCommonRequestParams(parameters, "XML");
|
||||
parameters.append("&coord=").append(String.format(Locale.ENGLISH, "%2.6f:%2.6f:WGS84", latLonToDouble(lon), latLonToDouble(lat)));
|
||||
if (useStringCoordListOutputFormat)
|
||||
parameters.append("&coordListOutputFormat=STRING");
|
||||
parameters.append("&max=").append(maxStations != 0 ? maxStations : 50);
|
||||
parameters.append("&inclFilter=1&radius_1=").append(maxDistance != 0 ? maxDistance : 1320);
|
||||
parameters.append("&type_1=STOP"); // ENTRANCE, BUS_POINT, POI_POINT
|
||||
parameters.append("&max=").append(maxLocations != 0 ? maxLocations : 50);
|
||||
parameters.append("&inclFilter=1");
|
||||
int i = 1;
|
||||
for (final LocationType type : types)
|
||||
{
|
||||
parameters.append("&radius_").append(i).append('=').append(maxDistance != 0 ? maxDistance : 1320);
|
||||
parameters.append("&type_").append(i).append('=');
|
||||
if (type == LocationType.STATION)
|
||||
parameters.append("STOP");
|
||||
else if (type == LocationType.POI)
|
||||
parameters.append("POI_POINT");
|
||||
else
|
||||
throw new IllegalArgumentException("cannot handle location type: " + type); // ENTRANCE, BUS_POINT
|
||||
i++;
|
||||
}
|
||||
|
||||
return parameters;
|
||||
}
|
||||
|
||||
protected NearbyStationsResult xmlCoordRequest(final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException
|
||||
protected NearbyLocationsResult xmlCoordRequest(final EnumSet<LocationType> types, final int lat, final int lon, final int maxDistance,
|
||||
final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder parameters = xmlCoordRequestParameters(lat, lon, maxDistance, maxStations);
|
||||
final StringBuilder parameters = xmlCoordRequestParameters(types, lat, lon, maxDistance, maxStations);
|
||||
|
||||
final StringBuilder uri = new StringBuilder(coordEndpoint);
|
||||
if (!httpPost)
|
||||
|
@ -551,7 +566,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.enter(pp, "coordInfoRequest");
|
||||
XmlPullUtil.skipExit(pp, "coordInfoRequest");
|
||||
|
||||
final List<Location> stations = new ArrayList<Location>();
|
||||
final List<Location> locations = new ArrayList<Location>();
|
||||
|
||||
if (XmlPullUtil.test(pp, "coordInfoItemList"))
|
||||
{
|
||||
|
@ -559,10 +574,19 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
while (XmlPullUtil.test(pp, "coordInfoItem"))
|
||||
{
|
||||
if (!"STOP".equals(XmlPullUtil.attr(pp, "type")))
|
||||
throw new RuntimeException("unknown type");
|
||||
final String type = XmlPullUtil.attr(pp, "type");
|
||||
final LocationType locationType;
|
||||
if ("STOP".equals(type))
|
||||
locationType = LocationType.STATION;
|
||||
else if ("POI_POINT".equals(type))
|
||||
locationType = LocationType.POI;
|
||||
else
|
||||
throw new IllegalStateException("unknown type: " + type);
|
||||
|
||||
String id = XmlPullUtil.optAttr(pp, "stateless", null);
|
||||
if (id == null)
|
||||
id = XmlPullUtil.attr(pp, "id");
|
||||
|
||||
final String id = XmlPullUtil.attr(pp, "id");
|
||||
final String name = normalizeLocationName(XmlPullUtil.optAttr(pp, "name", null));
|
||||
final String place = normalizeLocationName(XmlPullUtil.optAttr(pp, "locality", null));
|
||||
|
||||
|
@ -574,13 +598,13 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.skipExit(pp, "coordInfoItem");
|
||||
|
||||
if (name != null)
|
||||
stations.add(new Location(LocationType.STATION, id, coord, place, name));
|
||||
locations.add(new Location(locationType, id, coord, place, name));
|
||||
}
|
||||
|
||||
XmlPullUtil.skipExit(pp, "coordInfoItemList");
|
||||
}
|
||||
|
||||
return new NearbyStationsResult(header, stations);
|
||||
return new NearbyLocationsResult(header, locations);
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
{
|
||||
|
@ -593,9 +617,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
protected NearbyStationsResult mobileCoordRequest(final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException
|
||||
protected NearbyLocationsResult mobileCoordRequest(final EnumSet<LocationType> types, final int lat, final int lon, final int maxDistance,
|
||||
final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder parameters = xmlCoordRequestParameters(lat, lon, maxDistance, maxStations);
|
||||
final StringBuilder parameters = xmlCoordRequestParameters(types, lat, lon, maxDistance, maxStations);
|
||||
|
||||
final StringBuilder uri = new StringBuilder(coordEndpoint);
|
||||
if (!httpPost)
|
||||
|
@ -633,8 +658,13 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
final String name = normalizeLocationName(XmlPullUtil.valueTag(pp, "de"));
|
||||
final String type = XmlPullUtil.valueTag(pp, "ty");
|
||||
if (!"STOP".equals(type))
|
||||
throw new RuntimeException("unknown type");
|
||||
final LocationType locationType;
|
||||
if ("STOP".equals(type))
|
||||
locationType = LocationType.STATION;
|
||||
else if ("POI_POINT".equals(type))
|
||||
locationType = LocationType.POI;
|
||||
else
|
||||
throw new IllegalStateException("unknown type: " + type);
|
||||
|
||||
final String id = XmlPullUtil.valueTag(pp, "id");
|
||||
XmlPullUtil.valueTag(pp, "omc");
|
||||
|
@ -645,7 +675,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
XmlPullUtil.valueTag(pp, "ds");
|
||||
final Point coord = parseCoord(XmlPullUtil.valueTag(pp, "c"));
|
||||
|
||||
stations.add(new Location(LocationType.STATION, id, coord, place, name));
|
||||
stations.add(new Location(locationType, id, coord, place, name));
|
||||
|
||||
XmlPullUtil.skipExit(pp, "pi");
|
||||
}
|
||||
|
@ -655,7 +685,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
XmlPullUtil.skipExit(pp, "ci");
|
||||
|
||||
return new NearbyStationsResult(header, stations);
|
||||
return new NearbyLocationsResult(header, stations);
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
{
|
||||
|
@ -867,10 +897,11 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return null;
|
||||
}
|
||||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
return xmlCoordRequest(location.lat, location.lon, maxDistance, maxStations);
|
||||
return xmlCoordRequest(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
|
||||
if (location.type != LocationType.STATION)
|
||||
throw new IllegalArgumentException("cannot handle: " + location.type);
|
||||
|
@ -878,10 +909,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
if (!location.hasId())
|
||||
throw new IllegalArgumentException("at least one of stationId or lat/lon must be given");
|
||||
|
||||
return nearbyStationsRequest(location.id, maxStations);
|
||||
return nearbyStationsRequest(location.id, maxLocations);
|
||||
}
|
||||
|
||||
private NearbyStationsResult nearbyStationsRequest(final String stationId, final int maxStations) throws IOException
|
||||
private NearbyLocationsResult nearbyStationsRequest(final String stationId, final int maxLocations) throws IOException
|
||||
{
|
||||
final StringBuilder parameters = new StringBuilder();
|
||||
appendCommonRequestParams(parameters, "XML");
|
||||
|
@ -929,19 +960,23 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
else if ("assigned".equals(nameState))
|
||||
stations.add(location);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new IllegalStateException("cannot handle: " + location.type);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
if ("notidentified".equals(nameState))
|
||||
return new NearbyStationsResult(header, NearbyStationsResult.Status.INVALID_STATION);
|
||||
return new NearbyLocationsResult(header, NearbyLocationsResult.Status.INVALID_ID);
|
||||
|
||||
if (ownStation.get() != null && !stations.contains(ownStation))
|
||||
stations.add(ownStation.get());
|
||||
|
||||
if (maxStations == 0 || maxStations >= stations.size())
|
||||
return new NearbyStationsResult(header, stations);
|
||||
if (maxLocations == 0 || maxLocations >= stations.size())
|
||||
return new NearbyLocationsResult(header, stations);
|
||||
else
|
||||
return new NearbyStationsResult(header, stations.subList(0, maxStations));
|
||||
return new NearbyLocationsResult(header, stations.subList(0, maxLocations));
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
{
|
||||
|
|
|
@ -30,6 +30,7 @@ import java.util.Calendar;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.HashSet;
|
||||
|
@ -54,7 +55,7 @@ import de.schildbach.pte.dto.Departure;
|
|||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Point;
|
||||
import de.schildbach.pte.dto.Position;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
@ -91,7 +92,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
private String clientType;
|
||||
private Charset jsonGetStopsEncoding;
|
||||
private boolean jsonGetStopsUseWeight = true;
|
||||
private Charset jsonNearbyStationsEncoding;
|
||||
private Charset jsonNearbyLocationsEncoding;
|
||||
private boolean dominantPlanStopTime = false;
|
||||
private boolean useIso8601 = false;
|
||||
private String extXmlEndpoint = null;
|
||||
|
@ -164,7 +165,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
this.queryEndpoint = queryEndpoint;
|
||||
this.numProductBits = numProductBits;
|
||||
this.jsonGetStopsEncoding = jsonEncoding;
|
||||
this.jsonNearbyStationsEncoding = jsonEncoding;
|
||||
this.jsonNearbyLocationsEncoding = jsonEncoding;
|
||||
}
|
||||
|
||||
protected void setClientType(final String clientType)
|
||||
|
@ -192,9 +193,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
this.jsonGetStopsUseWeight = jsonGetStopsUseWeight;
|
||||
}
|
||||
|
||||
protected void setJsonNearbyStationsEncoding(final Charset jsonNearbyStationsEncoding)
|
||||
protected void setJsonNearbyLocationsEncoding(final Charset jsonNearbyLocationsEncoding)
|
||||
{
|
||||
this.jsonNearbyStationsEncoding = jsonNearbyStationsEncoding;
|
||||
this.jsonNearbyLocationsEncoding = jsonNearbyLocationsEncoding;
|
||||
}
|
||||
|
||||
protected void setUseIso8601(final boolean useIso8601)
|
||||
|
@ -2295,26 +2296,41 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return parsePosition(m.group(1));
|
||||
}
|
||||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
return nearbyStationsByCoordinate(location.lat, location.lon, maxDistance, maxStations);
|
||||
return nearbyLocationsByCoordinate(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
return nearbyStationsById(location.id);
|
||||
else
|
||||
throw new IllegalArgumentException("cannot handle: " + location);
|
||||
}
|
||||
|
||||
protected final NearbyStationsResult nearbyStationsByCoordinate(final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
protected final NearbyLocationsResult nearbyLocationsByCoordinate(final EnumSet<LocationType> types, final int lat, final int lon,
|
||||
final int maxDistance, final int maxLocations) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
appendJsonNearbyStationsParameters(uri, lat, lon, maxDistance, maxStations);
|
||||
if (types.contains(LocationType.STATION))
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
appendJsonNearbyStationsParameters(uri, lat, lon, maxDistance, maxLocations);
|
||||
|
||||
return jsonNearbyStations(uri.toString());
|
||||
return jsonNearbyLocations(uri.toString());
|
||||
}
|
||||
else if (types.contains(LocationType.POI))
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
appendJsonNearbyPOIsParameters(uri, lat, lon, maxDistance, maxLocations);
|
||||
|
||||
return jsonNearbyLocations(uri.toString());
|
||||
}
|
||||
else
|
||||
{
|
||||
return new NearbyLocationsResult(null, Collections.<Location> emptyList());
|
||||
}
|
||||
}
|
||||
|
||||
protected final NearbyStationsResult nearbyStationsById(final String id) throws IOException
|
||||
protected final NearbyLocationsResult nearbyStationsById(final String id) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(stationBoardEndpoint);
|
||||
appendXmlNearbyStationsParameters(uri, id);
|
||||
|
@ -2341,7 +2357,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
, Pattern.DOTALL);
|
||||
private static final Pattern P_XML_NEARBY_STATIONS_MESSAGES = Pattern.compile("<Err code=\"([^\"]*)\" text=\"([^\"]*)\"");
|
||||
|
||||
protected final NearbyStationsResult xmlNearbyStations(final String uri) throws IOException
|
||||
protected final NearbyLocationsResult xmlNearbyStations(final String uri) throws IOException
|
||||
{
|
||||
// scrape page
|
||||
final CharSequence page = ParserUtils.scrape(uri);
|
||||
|
@ -2356,9 +2372,9 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
final String text = mMessage.group(2);
|
||||
|
||||
if (code.equals("H730")) // Your input is not valid
|
||||
return new NearbyStationsResult(null, NearbyStationsResult.Status.INVALID_STATION);
|
||||
return new NearbyLocationsResult(null, NearbyLocationsResult.Status.INVALID_ID);
|
||||
if (code.equals("H890")) // No trains in result
|
||||
return new NearbyStationsResult(null, stations);
|
||||
return new NearbyLocationsResult(null, stations);
|
||||
throw new IllegalArgumentException("unknown error " + code + ", " + text);
|
||||
}
|
||||
|
||||
|
@ -2394,7 +2410,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
return new NearbyStationsResult(null, stations);
|
||||
return new NearbyLocationsResult(null, stations);
|
||||
}
|
||||
|
||||
protected void appendJsonNearbyStationsParameters(final StringBuilder uri, final int lat, final int lon, final int maxDistance,
|
||||
|
@ -2402,17 +2418,34 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
{
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=2&tpl=stop2json");
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
uri.append("&look_stopclass=").append(allProductsInt());
|
||||
uri.append("&look_nv=get_stopweight|yes");
|
||||
// get_shortjson|yes
|
||||
// get_lines|yes
|
||||
// combinemode|2
|
||||
// density|80
|
||||
// get_stopweight|yes
|
||||
// get_infotext|yes
|
||||
uri.append("&look_x=").append(lon);
|
||||
uri.append("&look_y=").append(lat);
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
}
|
||||
|
||||
protected final NearbyStationsResult jsonNearbyStations(final String uri) throws IOException
|
||||
protected void appendJsonNearbyPOIsParameters(final StringBuilder uri, final int lat, final int lon, final int maxDistance, final int maxStations)
|
||||
{
|
||||
final CharSequence page = ParserUtils.scrape(uri, null, jsonNearbyStationsEncoding);
|
||||
uri.append('y');
|
||||
uri.append("?performLocating=4&tpl=poi2json");
|
||||
uri.append("&look_pois="); // all categories
|
||||
uri.append("&look_x=").append(lon);
|
||||
uri.append("&look_y=").append(lat);
|
||||
uri.append("&look_maxno=").append(maxStations != 0 ? maxStations : 200);
|
||||
uri.append("&look_maxdist=").append(maxDistance != 0 ? maxDistance : 5000);
|
||||
}
|
||||
|
||||
protected final NearbyLocationsResult jsonNearbyLocations(final String uri) throws IOException
|
||||
{
|
||||
final CharSequence page = ParserUtils.scrape(uri, null, jsonNearbyLocationsEncoding);
|
||||
|
||||
// System.out.println(uri);
|
||||
// System.out.println(page);
|
||||
|
@ -2423,32 +2456,55 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
final int error = head.getInt("error");
|
||||
if (error == 0)
|
||||
{
|
||||
final JSONArray aStops = head.getJSONArray("stops");
|
||||
final int nStops = aStops.length();
|
||||
final List<Location> stations = new ArrayList<Location>(nStops);
|
||||
final List<Location> locations = new LinkedList<Location>();
|
||||
|
||||
for (int i = 0; i < nStops; i++)
|
||||
final JSONArray aStops = head.optJSONArray("stops");
|
||||
if (aStops != null)
|
||||
{
|
||||
final JSONObject stop = aStops.optJSONObject(i);
|
||||
final String id = stop.getString("extId");
|
||||
// final String name = ParserUtils.resolveEntities(stop.getString("name"));
|
||||
final String urlname = ParserUtils.urlDecode(stop.getString("urlname"), jsonNearbyStationsEncoding);
|
||||
final int lat = stop.getInt("y");
|
||||
final int lon = stop.getInt("x");
|
||||
final int stopWeight = stop.optInt("stopweight", -1);
|
||||
final int nStops = aStops.length();
|
||||
|
||||
if (stopWeight != 0)
|
||||
for (int i = 0; i < nStops; i++)
|
||||
{
|
||||
final String[] placeAndName = splitStationName(urlname);
|
||||
stations.add(new Location(LocationType.STATION, id, lat, lon, placeAndName[0], placeAndName[1]));
|
||||
final JSONObject stop = aStops.optJSONObject(i);
|
||||
final String id = stop.getString("extId");
|
||||
// final String name = ParserUtils.resolveEntities(stop.getString("name"));
|
||||
final String urlname = ParserUtils.urlDecode(stop.getString("urlname"), jsonNearbyLocationsEncoding);
|
||||
final int lat = stop.getInt("y");
|
||||
final int lon = stop.getInt("x");
|
||||
final int stopWeight = stop.optInt("stopweight", -1);
|
||||
|
||||
if (stopWeight != 0)
|
||||
{
|
||||
final String[] placeAndName = splitStationName(urlname);
|
||||
locations.add(new Location(LocationType.STATION, id, lat, lon, placeAndName[0], placeAndName[1]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return new NearbyStationsResult(null, stations);
|
||||
final JSONArray aPOIs = head.optJSONArray("pois");
|
||||
if (aPOIs != null)
|
||||
{
|
||||
final int nPOIs = aPOIs.length();
|
||||
|
||||
for (int i = 0; i < nPOIs; i++)
|
||||
{
|
||||
final JSONObject poi = aPOIs.optJSONObject(i);
|
||||
final String id = poi.getString("extId");
|
||||
// final String name = ParserUtils.resolveEntities(stop.getString("name"));
|
||||
final String urlname = ParserUtils.urlDecode(poi.getString("urlname"), jsonNearbyLocationsEncoding);
|
||||
final int lat = poi.getInt("y");
|
||||
final int lon = poi.getInt("x");
|
||||
|
||||
final String[] placeAndName = splitPOI(urlname);
|
||||
locations.add(new Location(LocationType.POI, id, lat, lon, placeAndName[0], placeAndName[1]));
|
||||
}
|
||||
}
|
||||
|
||||
return new NearbyLocationsResult(null, locations);
|
||||
}
|
||||
else if (error == 2)
|
||||
{
|
||||
return new NearbyStationsResult(null, NearbyStationsResult.Status.SERVICE_DOWN);
|
||||
return new NearbyLocationsResult(null, NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -2473,7 +2529,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
.compile("REQMapRoute0\\.Location0\\.X=(-?\\d+)&(?:amp;)?REQMapRoute0\\.Location0\\.Y=(-?\\d+)&");
|
||||
private final static Pattern P_NEARBY_FINE_LOCATION = Pattern.compile("[\\?&;]input=(\\d+)&[^\"]*\">([^<]*)<");
|
||||
|
||||
protected final NearbyStationsResult htmlNearbyStations(final String uri) throws IOException
|
||||
protected final NearbyLocationsResult htmlNearbyStations(final String uri) throws IOException
|
||||
{
|
||||
final List<Location> stations = new ArrayList<Location>();
|
||||
|
||||
|
@ -2516,7 +2572,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
return new NearbyStationsResult(null, stations);
|
||||
return new NearbyLocationsResult(null, stations);
|
||||
}
|
||||
|
||||
private static final Pattern P_LINE_SBAHN = Pattern.compile("SN?\\d*");
|
||||
|
|
|
@ -24,6 +24,7 @@ import java.util.ArrayList;
|
|||
import java.util.Calendar;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
@ -40,8 +41,8 @@ import de.schildbach.pte.dto.Line;
|
|||
import de.schildbach.pte.dto.LineDestination;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult.Status;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult.Status;
|
||||
import de.schildbach.pte.dto.Point;
|
||||
import de.schildbach.pte.dto.Position;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
@ -749,14 +750,15 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
|
|||
@Override
|
||||
protected boolean hasCapability(final Capability capability)
|
||||
{
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.NEARBY_STATIONS || capability == Capability.DEPARTURES
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.NEARBY_LOCATIONS || capability == Capability.DEPARTURES
|
||||
|| capability == Capability.TRIPS)
|
||||
return true;
|
||||
else
|
||||
return false;
|
||||
}
|
||||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
final ResultHeader resultHeader = new ResultHeader(SERVER_PRODUCT, SERVER_VERSION, 0, null);
|
||||
|
||||
|
@ -786,7 +788,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
|
|||
throw new IllegalArgumentException("Unhandled location type: " + location.type);
|
||||
}
|
||||
|
||||
final String queryUri = uri() + queryUriType + "places_nearby?type[]=stop_point" + "&distance=" + maxDistance + "&count=" + maxStations
|
||||
final String queryUri = uri() + queryUriType + "places_nearby?type[]=stop_point" + "&distance=" + maxDistance + "&count=" + maxLocations
|
||||
+ "&depth=0";
|
||||
final CharSequence page = ParserUtils.scrape(queryUri, authorization);
|
||||
|
||||
|
@ -802,7 +804,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
|
|||
// faulty.
|
||||
if (nbResults == 0)
|
||||
{
|
||||
return new NearbyStationsResult(resultHeader, Status.INVALID_STATION);
|
||||
return new NearbyLocationsResult(resultHeader, Status.INVALID_ID);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
@ -823,7 +825,7 @@ public abstract class AbstractNavitiaProvider extends AbstractNetworkProvider
|
|||
stations.add(nearbyLocation);
|
||||
}
|
||||
|
||||
return new NearbyStationsResult(resultHeader, stations);
|
||||
return new NearbyLocationsResult(resultHeader, stations);
|
||||
}
|
||||
}
|
||||
catch (final JSONException jsonExc)
|
||||
|
|
|
@ -26,6 +26,7 @@ import java.util.Calendar;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
@ -42,7 +43,7 @@ import com.google.common.base.Charsets;
|
|||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Point;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
@ -286,7 +287,7 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
return locations;
|
||||
}
|
||||
|
||||
private NearbyStationsResult jsonCoordRequest(final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException
|
||||
private NearbyLocationsResult jsonCoordRequest(final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException
|
||||
{
|
||||
final StringBuilder parameters = buildCommonRequestParams("SearchTripPoint", "json");
|
||||
parameters.append(String.format(Locale.FRENCH, "&Latitude=%2.6f&Longitude=%2.6f", latLonToDouble(lat), latLonToDouble(lon)));
|
||||
|
@ -308,8 +309,8 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
|
||||
if (status != 200)
|
||||
{
|
||||
return new NearbyStationsResult(HEADER, status == 300 ? NearbyStationsResult.Status.INVALID_STATION
|
||||
: NearbyStationsResult.Status.SERVICE_DOWN);
|
||||
return new NearbyLocationsResult(HEADER, status == 300 ? NearbyLocationsResult.Status.INVALID_ID
|
||||
: NearbyLocationsResult.Status.SERVICE_DOWN);
|
||||
}
|
||||
|
||||
JSONArray dataArray = head.getJSONArray("Data");
|
||||
|
@ -319,7 +320,7 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
stations.add(parseJsonTransportLocation(data));
|
||||
}
|
||||
|
||||
return new NearbyStationsResult(HEADER, stations);
|
||||
return new NearbyLocationsResult(HEADER, stations);
|
||||
}
|
||||
catch (final JSONException x)
|
||||
{
|
||||
|
@ -616,7 +617,8 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
return ((Context) context).queryMore(this, later);
|
||||
}
|
||||
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
Location queryLocation = location;
|
||||
if (!queryLocation.hasLocation())
|
||||
|
@ -629,7 +631,7 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
if (queryLocation == null)
|
||||
throw new IllegalArgumentException("null location or station not found");
|
||||
|
||||
return jsonCoordRequest(location.lat, location.lon, maxDistance, maxStations);
|
||||
return jsonCoordRequest(location.lat, location.lon, maxDistance, maxLocations);
|
||||
}
|
||||
|
||||
public QueryTripsResult queryTrips(final Location from, final Location via, final Location to, final Date date, final boolean dep,
|
||||
|
|
|
@ -20,13 +20,14 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsContext;
|
||||
|
@ -40,6 +41,9 @@ public class BayernProvider extends AbstractEfaProvider
|
|||
{
|
||||
public static final NetworkId NETWORK_ID = NetworkId.BAYERN;
|
||||
private final static String API_BASE = "http://mobile.defas-fgi.de/beg/";
|
||||
|
||||
// http://mobile.defas-fgi.de/xml/
|
||||
|
||||
private static final String DEPARTURE_MONITOR_ENDPOINT = "XML_DM_REQUEST";
|
||||
private static final String TRIP_ENDPOINT = "XML_TRIP_REQUEST2";
|
||||
private static final String STOP_FINDER_ENDPOINT = "XML_STOPFINDER_REQUEST";
|
||||
|
@ -100,10 +104,11 @@ public class BayernProvider extends AbstractEfaProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
return mobileCoordRequest(location.lat, location.lon, maxDistance, maxStations);
|
||||
return mobileCoordRequest(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
|
||||
if (location.type != LocationType.STATION)
|
||||
throw new IllegalArgumentException("cannot handle: " + location.type);
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.Calendar;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
|
@ -37,7 +38,7 @@ import de.schildbach.pte.dto.Departure;
|
|||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Position;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
@ -57,6 +58,8 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.INVG;
|
||||
private static final String API_BASE = "http://fpa.invg.de/bin/";
|
||||
|
||||
// http://invg.hafas.de/bin/
|
||||
|
||||
private static final long PARSER_DAY_ROLLOVER_THRESHOLD_MS = 12 * 60 * 60 * 1000;
|
||||
|
||||
public InvgProvider()
|
||||
|
@ -125,7 +128,8 @@ public class InvgProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxStations) throws IOException
|
||||
{
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -18,6 +18,7 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
import java.util.regex.Matcher;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
|
@ -26,7 +27,7 @@ import com.google.common.base.Charsets;
|
|||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
/**
|
||||
|
@ -99,11 +100,12 @@ public class JetProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
{
|
||||
return nearbyStationsByCoordinate(location.lat, location.lon, maxDistance, maxStations);
|
||||
return nearbyLocationsByCoordinate(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -18,13 +18,14 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.util.StringReplaceReader;
|
||||
|
||||
|
@ -137,11 +138,12 @@ public class NasaProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
{
|
||||
return nearbyStationsByCoordinate(location.lat, location.lon, maxDistance, maxStations);
|
||||
return nearbyLocationsByCoordinate(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -20,10 +20,12 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.Set;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Point;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
@ -43,8 +45,8 @@ public interface NetworkProvider
|
|||
{
|
||||
/* can suggest locations */
|
||||
SUGGEST_LOCATIONS,
|
||||
/* can determine nearby stations */
|
||||
NEARBY_STATIONS,
|
||||
/* can determine nearby locations */
|
||||
NEARBY_LOCATIONS,
|
||||
/* can query for departures */
|
||||
DEPARTURES,
|
||||
/* can query trips */
|
||||
|
@ -71,18 +73,20 @@ public interface NetworkProvider
|
|||
boolean hasCapabilities(final Capability... capabilities);
|
||||
|
||||
/**
|
||||
* Determine stations near to given location. At least one of stationId or lat/lon pair must be present.
|
||||
* Find locations near to given location. At least one of lat/lon pair or station id must be present.
|
||||
*
|
||||
* @param types
|
||||
* types of locations to find
|
||||
* @param location
|
||||
* location to determine nearby stations (optional)
|
||||
* @param maxDistance
|
||||
* maximum distance in meters, or {@code 0}
|
||||
* @param maxStations
|
||||
* maximum number of stations, or {@code 0}
|
||||
* @param maxLocations
|
||||
* maximum number of locations, or {@code 0}
|
||||
* @return nearby stations
|
||||
* @throws IOException
|
||||
*/
|
||||
NearbyStationsResult queryNearbyStations(Location location, int maxDistance, int maxStations) throws IOException;
|
||||
NearbyLocationsResult queryNearbyLocations(EnumSet<LocationType> types, Location location, int maxDistance, int maxLocations) throws IOException;
|
||||
|
||||
/**
|
||||
* Get departures at a given station, probably live
|
||||
|
|
|
@ -19,11 +19,12 @@ package de.schildbach.pte;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.regex.Pattern;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
/**
|
||||
|
@ -123,7 +124,8 @@ public class NsProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -18,13 +18,14 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.util.StringReplaceReader;
|
||||
|
||||
|
@ -160,11 +161,12 @@ public class NvvProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
{
|
||||
return nearbyStationsByCoordinate(location.lat, location.lon, maxDistance, maxStations);
|
||||
return nearbyLocationsByCoordinate(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -19,13 +19,14 @@ package de.schildbach.pte;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
/**
|
||||
|
@ -132,11 +133,12 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
{
|
||||
return nearbyStationsByCoordinate(location.lat, location.lon, maxDistance, maxStations);
|
||||
return nearbyLocationsByCoordinate(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -35,7 +35,7 @@ public class RtProvider extends AbstractHafasProvider
|
|||
{
|
||||
super(API_BASE + "stboard.exe/dn", API_BASE + "ajax-getstop.exe/dn", API_BASE + "query.exe/dn", 10, Charsets.UTF_8);
|
||||
|
||||
setJsonNearbyStationsEncoding(Charsets.ISO_8859_1);
|
||||
setJsonNearbyLocationsEncoding(Charsets.ISO_8859_1);
|
||||
setStationBoardHasStationTable(false);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import java.util.Calendar;
|
|||
import java.util.Collection;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
|
@ -34,7 +35,7 @@ import de.schildbach.pte.dto.Departure;
|
|||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Position;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
@ -100,7 +101,8 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -22,6 +22,7 @@ import java.util.ArrayList;
|
|||
import java.util.Calendar;
|
||||
import java.util.Collections;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.GregorianCalendar;
|
||||
import java.util.List;
|
||||
import java.util.regex.Matcher;
|
||||
|
@ -33,7 +34,7 @@ import de.schildbach.pte.dto.Departure;
|
|||
import de.schildbach.pte.dto.Line;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Position;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
@ -170,7 +171,8 @@ public class ShProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -19,13 +19,14 @@ package de.schildbach.pte;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.EnumSet;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
/**
|
||||
|
@ -41,7 +42,7 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
super(API_BASE + "stboard.exe/nn", API_BASE + "ajax-getstop.exe/nny", API_BASE + "query.exe/nn", 16);
|
||||
|
||||
setJsonGetStopsEncoding(Charsets.UTF_8);
|
||||
setJsonNearbyStationsEncoding(Charsets.UTF_8);
|
||||
setJsonNearbyLocationsEncoding(Charsets.UTF_8);
|
||||
setStationBoardHasLocation(true);
|
||||
}
|
||||
|
||||
|
@ -128,11 +129,12 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
{
|
||||
return nearbyStationsByCoordinate(location.lat, location.lon, maxDistance, maxStations);
|
||||
return nearbyLocationsByCoordinate(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
import java.util.regex.Matcher;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
/**
|
||||
|
@ -122,11 +123,12 @@ public class VgsProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.hasLocation())
|
||||
{
|
||||
return nearbyStationsByCoordinate(location.lat, location.lon, maxDistance, maxStations);
|
||||
return nearbyLocationsByCoordinate(types, location.lat, location.lon, maxDistance, maxLocations);
|
||||
}
|
||||
else if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -18,12 +18,13 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import com.google.common.base.Charsets;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
|
||||
/**
|
||||
|
@ -138,7 +139,8 @@ public class VsnProvider extends AbstractHafasProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations) throws IOException
|
||||
public NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxLocations) throws IOException
|
||||
{
|
||||
if (location.type == LocationType.STATION && location.hasId())
|
||||
{
|
||||
|
|
|
@ -26,37 +26,37 @@ import com.google.common.base.MoreObjects.ToStringHelper;
|
|||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public final class NearbyStationsResult implements Serializable
|
||||
public final class NearbyLocationsResult implements Serializable
|
||||
{
|
||||
public enum Status
|
||||
{
|
||||
OK, INVALID_STATION, SERVICE_DOWN
|
||||
OK, INVALID_ID, SERVICE_DOWN
|
||||
}
|
||||
|
||||
public final ResultHeader header;
|
||||
public final Status status;
|
||||
public final List<Location> stations;
|
||||
public final List<Location> locations;
|
||||
|
||||
public NearbyStationsResult(final ResultHeader header, final List<Location> stations)
|
||||
public NearbyLocationsResult(final ResultHeader header, final List<Location> locations)
|
||||
{
|
||||
this.header = header;
|
||||
this.status = Status.OK;
|
||||
this.stations = stations;
|
||||
this.locations = locations;
|
||||
}
|
||||
|
||||
public NearbyStationsResult(final ResultHeader header, final Status status)
|
||||
public NearbyLocationsResult(final ResultHeader header, final Status status)
|
||||
{
|
||||
this.header = header;
|
||||
this.status = status;
|
||||
this.stations = null;
|
||||
this.locations = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
final ToStringHelper helper = MoreObjects.toStringHelper(this).addValue(status);
|
||||
if (stations != null)
|
||||
helper.add("size", stations.size()).add("stations", stations);
|
||||
if (locations != null)
|
||||
helper.add("size", locations.size()).add("locations", locations);
|
||||
return helper.toString();
|
||||
}
|
||||
}
|
|
@ -22,12 +22,14 @@ import static org.junit.Assert.assertTrue;
|
|||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import de.schildbach.pte.NetworkProvider;
|
||||
import de.schildbach.pte.NetworkProvider.Accessibility;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsContext;
|
||||
|
@ -46,7 +48,7 @@ public abstract class AbstractProviderLiveTest
|
|||
this.provider = provider;
|
||||
}
|
||||
|
||||
protected final void print(final NearbyStationsResult result)
|
||||
protected final void print(final NearbyLocationsResult result)
|
||||
{
|
||||
System.out.println(result);
|
||||
}
|
||||
|
@ -73,15 +75,20 @@ public abstract class AbstractProviderLiveTest
|
|||
// System.out.println(trip);
|
||||
}
|
||||
|
||||
protected final NearbyStationsResult queryNearbyStations(final Location location) throws IOException
|
||||
protected final NearbyLocationsResult queryNearbyStations(final Location location) throws IOException
|
||||
{
|
||||
return queryNearbyStations(location, 0, 0);
|
||||
return queryNearbyLocations(EnumSet.of(LocationType.STATION), location, 0, 0);
|
||||
}
|
||||
|
||||
protected final NearbyStationsResult queryNearbyStations(final Location location, final int maxDistance, final int maxStations)
|
||||
throws IOException
|
||||
protected final NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location) throws IOException
|
||||
{
|
||||
return provider.queryNearbyStations(location, maxDistance, maxStations);
|
||||
return queryNearbyLocations(types, location, 0, 0);
|
||||
}
|
||||
|
||||
protected final NearbyLocationsResult queryNearbyLocations(final EnumSet<LocationType> types, final Location location, final int maxDistance,
|
||||
final int maxStations) throws IOException
|
||||
{
|
||||
return provider.queryNearbyLocations(types, location, maxDistance, maxStations);
|
||||
}
|
||||
|
||||
protected final QueryDeparturesResult queryDepartures(final String stationId, final boolean equivs) throws IOException
|
||||
|
|
|
@ -26,7 +26,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -45,8 +45,7 @@ public class AtcProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "740"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "740"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -54,8 +53,7 @@ public class AtcProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
// TODO bad coordinate!
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 8168907, 10609969));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 8168907, 10609969));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -63,7 +61,6 @@ public class AtcProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("740", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -71,7 +68,6 @@ public class AtcProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("ponte");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -79,7 +75,6 @@ public class AtcProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grünwink");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class AvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "100"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "100"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48367233, 10894976));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48367233, 10894976));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class AvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("100", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class AvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class AvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grünwink");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -28,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,24 +50,30 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "692991"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "692991"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyPOIsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.POI),
|
||||
new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
print(result);
|
||||
assertThat(result.locations, hasItem(new Location(LocationType.POI, "990416076", "Berlin", "Museum für Naturkunde")));
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("692991", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -79,9 +88,7 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Güntzelstr. (U)");
|
||||
|
||||
print(result);
|
||||
|
||||
assertEquals("Güntzelstr. (U)", result.getLocations().get(0).name);
|
||||
}
|
||||
|
||||
|
@ -89,9 +96,7 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Dammt");
|
||||
|
||||
print(result);
|
||||
|
||||
assertEquals("Hamburg Dammtor", result.getLocations().get(0).name);
|
||||
}
|
||||
|
||||
|
@ -99,7 +104,6 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Berlin");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -18,8 +18,10 @@
|
|||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -28,7 +30,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,17 +49,25 @@ public class BayernProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3001459"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3001459"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48135232, 11560650));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48135232, 11560650));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyLocationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), new Location(
|
||||
LocationType.ADDRESS, 48135232, 11560650));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -77,7 +87,6 @@ public class BayernProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Marien");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -85,7 +94,6 @@ public class BayernProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -93,7 +101,6 @@ public class BayernProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("München, Friedenstraße 2");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,16 +50,14 @@ public class BsvagProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "26000178"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "26000178"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52272065, 10524788));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52272065, 10524788));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -67,7 +65,6 @@ public class BsvagProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("26000256", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -75,7 +72,6 @@ public class BsvagProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kurf");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -83,7 +79,6 @@ public class BsvagProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class BvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10000"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10000"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47551466, 7585187));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47551466, 7585187));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class BvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("10000", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class BvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Haupt");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class BvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -49,24 +49,23 @@ public class BvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "9220302"));
|
||||
assertEquals(NearbyStationsResult.Status.OK, result.status);
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "9220302"));
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52486400, 13350744));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52486400, 13350744));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsInvalidStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "2449475"));
|
||||
assertEquals(NearbyStationsResult.Status.INVALID_STATION, result.status);
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "2449475"));
|
||||
assertEquals(NearbyLocationsResult.Status.INVALID_ID, result.status);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,14 +48,14 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "90001611"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "90001611"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48401092, 9992037));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48401092, 9992037));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class DsbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8600858"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8600858"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 55670305, 12554169));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 55670305, 12554169));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class DsbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8600858", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class DsbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class DsbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Airport");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
@ -47,16 +47,14 @@ public class DubProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3500131"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3500131"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 25269008, 55312672));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 25269008, 55312672));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class DubProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Airport");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class EireannProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8013500"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8013500"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53343993, -6267371));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53343993, -6267371));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class EireannProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8013500", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class EireannProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class EireannProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Dublin");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class EireannProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Busáras");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -96,7 +90,6 @@ public class EireannProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Dorfstrasse 10, Dällikon, Schweiz");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "25000031"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "25000031"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52379497, 9735832));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52379497, 9735832));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("25000031", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -89,7 +84,6 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Hannover, Hannoversche Straße");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -97,7 +91,6 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsCity() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Hannover");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -105,7 +98,6 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Hannover");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class InvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "80301"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "80301"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48744678, 11437941));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48744678, 11437941));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class InvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("80301", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class InvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class InvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Flughafen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60401187"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60401187"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("60401187", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class JetProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "1055"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "1055"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 31769757, 35213506));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 31769757, 35213506));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -77,7 +75,6 @@ public class JetProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -85,7 +82,6 @@ public class JetProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("הנשיא - מוזיאון האיסלם, ירושלים");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class KvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "7000090"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "7000090"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49008184, 8400736));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49008184, 8400736));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class KvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("7000090", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class KvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class KvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grünwink");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class LinzProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60500090"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60500090"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48305726, 14287863));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48305726, 14287863));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +70,6 @@ public class LinzProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Friedhof");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -80,7 +77,6 @@ public class LinzProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +84,6 @@ public class LinzProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Leonding, Haag");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -96,7 +91,6 @@ public class LinzProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsCity() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Leonding");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class LuProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "200501001"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "200501001"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49610187, 6132746));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49610187, 6132746));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class LuProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("200501001", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class LuProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class LuProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Aéroport");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,14 +48,14 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10001167"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10001167"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, -37800941, 144966545));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, -37800941, 144966545));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,16 +50,14 @@ public class MvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "24200006"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "24200006"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51219852, 7639217));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51219852, 7639217));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -67,7 +65,6 @@ public class MvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("3", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -75,7 +72,6 @@ public class MvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Schützenhalle");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -83,7 +79,6 @@ public class MvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -20,8 +20,10 @@ package de.schildbach.pte.live;
|
|||
import static org.hamcrest.CoreMatchers.hasItem;
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertThat;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -30,7 +32,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -49,15 +51,25 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "350"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "350"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48135232, 11560650));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48135232, 11560650));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyLocationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), new Location(
|
||||
LocationType.ADDRESS, 48135232, 11560650));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.Accessibility;
|
|||
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.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,26 +48,24 @@ public class NasaProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "13000"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "13000"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51346546, 12383333));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51346546, 12383333));
|
||||
|
||||
print(result);
|
||||
assertEquals(NearbyStationsResult.Status.OK, result.status);
|
||||
assertTrue(result.stations.size() > 0);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("13000", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -75,7 +73,6 @@ public class NasaProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesEquivs() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("13000", true);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -83,7 +80,6 @@ public class NasaProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -91,7 +87,6 @@ public class NasaProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Flughafen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -99,7 +94,6 @@ public class NasaProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Höhle");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.NriProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class NriProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "112270"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "112270"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 59911871, 10764999));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 59911871, 10764999));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class NriProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("6735", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class NriProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class NriProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Oslo");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class NriProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Skøyen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.NsProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
@ -46,16 +46,14 @@ public class NsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8800004"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8800004"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52377548, 4901218));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52377548, 4901218));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -63,7 +61,6 @@ public class NsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8800004", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -71,7 +68,6 @@ public class NsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -79,7 +75,6 @@ public class NsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Brussel S");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -87,7 +82,6 @@ public class NsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Brüssel");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -96,7 +90,7 @@ public class NsProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "8400058", null, "Amsterdam Centraal"), null, new Location(
|
||||
LocationType.STATION, "8400061", null, "Amsterdam Zuid"), new Date(), true, null, WalkSpeed.FAST, Accessibility.NEUTRAL);
|
||||
|
||||
print(result);
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.NvbwProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,20 +50,20 @@ public class NvbwProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result1 = queryNearbyStations(new Location(LocationType.STATION, "6900001"));
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(new Location(LocationType.STATION, "6900001"));
|
||||
print(result1);
|
||||
|
||||
final NearbyStationsResult result2 = queryNearbyStations(new Location(LocationType.STATION, "53019174"));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.STATION, "53019174"));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result1 = queryNearbyStations(new Location(LocationType.ADDRESS, 48778953, 9178963));
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(new Location(LocationType.ADDRESS, 48778953, 9178963));
|
||||
print(result1);
|
||||
|
||||
final NearbyStationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 48493550, 9205656));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 48493550, 9205656));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.NvvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -49,24 +49,21 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3000001"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3000001"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50108625, 8669604));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50108625, 8669604));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinateKassel() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51318447, 9496250));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51318447, 9496250));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -97,7 +94,6 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -105,7 +101,6 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Flughafen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -113,7 +108,6 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kassel Wilhelmshöhe");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -121,7 +115,6 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("könig");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.OebbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,7 +48,7 @@ public class OebbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "902006"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "902006"));
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
@ -56,11 +56,11 @@ public class OebbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48200239, 16370773));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48200239, 16370773));
|
||||
|
||||
print(result);
|
||||
assertEquals(NearbyStationsResult.Status.OK, result.status);
|
||||
assertTrue(result.stations.size() > 0);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -22,6 +22,7 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
import java.util.Calendar;
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
import java.util.LinkedList;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -32,7 +33,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.ParisProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Point;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
@ -54,50 +55,45 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsAddress() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48877523, 2378353), 700, 10);
|
||||
|
||||
assertEquals(NearbyStationsResult.Status.OK, result.status);
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), new Location(LocationType.ADDRESS, 48877523,
|
||||
2378353), 700, 10);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsAddress2() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48785420, 2212050), 2000, 30);
|
||||
|
||||
assertEquals(NearbyStationsResult.Status.OK, result.status);
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), new Location(LocationType.ADDRESS, 48785420,
|
||||
2212050), 2000, 30);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "stop_point:RTP:SP:3926410"), 700, 10);
|
||||
|
||||
assertEquals(NearbyStationsResult.Status.OK, result.status);
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), new Location(LocationType.STATION,
|
||||
"stop_point:RTP:SP:3926410"), 700, 10);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsPoi() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.POI, "poi:n668579722"), 700, 10);
|
||||
|
||||
assertEquals(NearbyStationsResult.Status.OK, result.status);
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), new Location(LocationType.POI, "poi:n668579722"),
|
||||
700, 10);
|
||||
assertEquals(NearbyLocationsResult.Status.OK, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsInvalidStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "stop_point:RTP:SP:392"), 700, 10);
|
||||
|
||||
assertEquals(NearbyStationsResult.Status.INVALID_STATION, result.status);
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION), new Location(LocationType.STATION,
|
||||
"stop_point:RTP:SP:392"), 700, 10);
|
||||
assertEquals(NearbyLocationsResult.Status.INVALID_ID, result.status);
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -106,7 +102,6 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final int maxDepartures = 5;
|
||||
final QueryDeparturesResult result = queryDepartures("stop_point:RTP:SP:3926410", maxDepartures, false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.OK, result.status);
|
||||
assertEquals(1, result.stationDepartures.size());
|
||||
assertTrue(result.stationDepartures.get(0).departures.size() <= maxDepartures);
|
||||
|
@ -119,7 +114,6 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final int maxDepartures = 5;
|
||||
final QueryDeparturesResult result = queryDepartures("stop_point:RTP:SP:3926410", maxDepartures, true);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.OK, result.status);
|
||||
assertTrue(result.stationDepartures.size() > 1);
|
||||
int nbDepartures = 0;
|
||||
|
@ -138,7 +132,6 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("stop_point:RTP:SP:999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -146,9 +139,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("bellevi");
|
||||
|
||||
assertTrue(result.getLocations().size() > 0);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -156,9 +147,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsFromAddress() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("13 rue man");
|
||||
|
||||
assertTrue(result.getLocations().size() > 0);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -166,9 +155,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsNoLocation() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("bellevilleadasdjkaskd");
|
||||
|
||||
assertEquals(result.getLocations().size(), 0);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -177,9 +164,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, 48877095, 2378431), null, new Location(LocationType.ADDRESS,
|
||||
48847168, 2261272), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -188,9 +173,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, 48785419, 2212051), null, new Location(LocationType.STATION,
|
||||
"stop_area:RTP:SA:4284898"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -199,9 +182,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "stop_area:RTP:SA:4036290"), null, new Location(
|
||||
LocationType.STATION, "stop_area:RTP:SA:1804"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -210,9 +191,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "stop_area:RTP:SA:3812993"), null, new Location(
|
||||
LocationType.STATION, "stop_area:RTP:SA:4036290"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -221,9 +200,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, 48787056, 2209731), null, new Location(LocationType.STATION,
|
||||
"stop_area:RTP:SA:4036290"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -232,9 +209,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "stop_area:RTP:SA:1866"), null, new Location(
|
||||
LocationType.STATION, "stop_area:RTP:SA:2045"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -245,9 +220,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "stop_point:RTP:SP:3926410"), null, new Location(
|
||||
LocationType.STATION, "stop_point:RTP:SP:3926410"), new Date(), true, emptyList, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.NO_TRIPS, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -256,9 +229,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "stop_area:RTP:SA:999999"), null, new Location(
|
||||
LocationType.STATION, "stop_area:RTP:SA:1666"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.UNKNOWN_FROM, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -267,9 +238,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "stop_point:RTP:SP:3926410"), null, new Location(
|
||||
LocationType.STATION, "stop_area:RTP:SA:999999"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.UNKNOWN_TO, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -278,9 +247,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, 48877095, 2378431), null, new Location(LocationType.ADDRESS,
|
||||
48847168, 2261272), new Date(), true, Product.ALL, WalkSpeed.SLOW, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -289,9 +256,7 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, 48877095, 2378431), null, new Location(LocationType.ADDRESS,
|
||||
48847168, 2261272), new Date(), true, Product.ALL, WalkSpeed.FAST, Accessibility.NEUTRAL);
|
||||
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -313,7 +278,6 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void getArea() throws Exception
|
||||
{
|
||||
final Point[] polygon = provider.getArea();
|
||||
|
||||
assertTrue(polygon.length > 0);
|
||||
}
|
||||
|
||||
|
@ -330,7 +294,6 @@ public class ParisProviderLiveTest extends AbstractProviderLiveTest
|
|||
|
||||
final QueryTripsResult result = queryTrips(departure, null, arrival, new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
|
||||
print(result);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.PlProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class PlProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "5100065"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "5100065"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52227027, 20989795));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52227027, 20989795));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class PlProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("5100065", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class PlProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class PlProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Warszawa");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class PlProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Służewiec");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.RsagProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -49,16 +49,14 @@ public class RsagProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8010304"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8010304"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 54078314, 12131715));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 54078314, 12131715));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -66,7 +64,6 @@ public class RsagProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8010304", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -74,7 +71,6 @@ public class RsagProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -82,7 +78,6 @@ public class RsagProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Rostock");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -90,9 +85,7 @@ public class RsagProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Lütten Klein");
|
||||
|
||||
print(result);
|
||||
|
||||
assertEquals("Lütten Klein", result.getLocations().get(0).name);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.RtProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8500010"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8500010"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8588344", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("haupt");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Dorfstrasse 10, Dällikon, Schweiz");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.SbbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8500010"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8500010"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52525589, 13369548));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8500010", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("haupt");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Höhle");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -96,7 +90,6 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Dorfstrasse 10, Dällikon, Schweiz");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.SeProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class SeProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "7414867"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "7414867"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 57709311, 11988459));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 57709311, 11988459));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class SeProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("7414867", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class SeProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class SeProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Airport");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class SeProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Luleå");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.SeptaProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class SeptaProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "2090227"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "2090227"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 39954122, -75161705));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 39954122, -75161705));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class SeptaProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("2090227", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class SeptaProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class SeptaProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Airport");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.SfProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class SfProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10001017"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10001017"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 37777811, -122419481));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 37777811, -122419481));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class SfProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("10001017", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class SfProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.ShProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,8 +47,7 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8002547"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8002547"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -56,7 +55,6 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8002547", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Lübeck");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Achterüm");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class ShProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithoutCoordinatesInResult() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("aachen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.SncbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8813003"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8813003"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50748017, 3407118));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50748017, 3407118));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8813003", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Brussel S");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Brüssel");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -96,7 +90,6 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Rue Paul Janson 9, 1030 Bruxelles");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -107,11 +100,11 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
LocationType.STATION, "8813003", "Brussel", "Centraal"), new Date(), true, null, WalkSpeed.FAST, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
if (result.context != null)
|
||||
{
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
if (result.context == null)
|
||||
return;
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -121,11 +114,11 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
LocationType.STATION, "207272", "Brussel", "Stadion"), new Date(), true, null, WalkSpeed.FAST, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
if (result.context != null)
|
||||
{
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
if (result.context == null)
|
||||
return;
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -135,10 +128,10 @@ public class SncbProviderLiveTest extends AbstractProviderLiveTest
|
|||
new Location(LocationType.STATION, "8500010", null, "Basel"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
if (result.context != null)
|
||||
{
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
if (result.context == null)
|
||||
return;
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.StockholmProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class StockholmProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "301109600"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "301109600"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 59329897, 18072281));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 59329897, 18072281));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class StockholmProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("301109600", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class StockholmProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class StockholmProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Luleå Airport");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class StockholmProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("östra");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -99,6 +93,7 @@ public class StockholmProviderLiveTest extends AbstractProviderLiveTest
|
|||
LocationType.STATION, "200101221", "Stockholm", "Abrahamsberg"), new Date(), true, Product.ALL, WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
|
@ -110,6 +105,7 @@ public class StockholmProviderLiveTest extends AbstractProviderLiveTest
|
|||
new Location(LocationType.STATION, "300109205", 59340518, 18081532, "Stockholm", "Stadion"), new Date(), true, Product.ALL,
|
||||
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.StvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,16 +50,14 @@ public class StvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "63203040"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "63203040"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47072612, 15431814));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47072612, 15431814));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -67,7 +65,6 @@ public class StvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("63203040", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -75,7 +72,6 @@ public class StvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -83,7 +79,6 @@ public class StvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.SvvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,16 +50,14 @@ public class SvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60650002"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60650002"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47809195, 13054919));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47809195, 13054919));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -67,7 +65,6 @@ public class SvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("60650002", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -75,7 +72,6 @@ public class SvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.SydneyProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,14 +48,14 @@ public class SydneyProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10101101"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "10101101"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, -32823911, 151462824));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, -32823911, 151462824));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.TfiProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,14 +48,14 @@ public class TfiProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "51013670"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "51013670"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53348656, -6262221));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53348656, -6262221));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.TlemProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,17 +48,17 @@ public class TlemProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result1 = queryNearbyStations(new Location(LocationType.STATION, "1001003"));
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(new Location(LocationType.STATION, "1001003"));
|
||||
print(result1);
|
||||
|
||||
final NearbyStationsResult result2 = queryNearbyStations(new Location(LocationType.STATION, "1000086"));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.STATION, "1000086"));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51507161, -0127144));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51507161, -0127144));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VagfrProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,16 +50,14 @@ public class VagfrProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "6930112"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "6930112"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48000295, 7854338));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48000295, 7854338));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -67,7 +65,6 @@ public class VagfrProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("6930112", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -75,7 +72,6 @@ public class VagfrProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kurf");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VbbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,23 +50,23 @@ public class VbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "9007102"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "9007102"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsInvalidStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "2449475"));
|
||||
assertEquals(NearbyStationsResult.Status.INVALID_STATION, result.status);
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "2449475"));
|
||||
assertEquals(NearbyLocationsResult.Status.INVALID_ID, result.status);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52548505, 13388640));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 52548505, 13388640));
|
||||
print(result);
|
||||
assertTrue(result.stations.size() > 0);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
@ -131,8 +131,10 @@ public class VbbProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "9056102", "Berlin", "Nollendorfplatz"), null, new Location(
|
||||
LocationType.STATION, "9013103", "Berlin", "Prinzenstraße"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
||||
final QueryTripsResult earlierResult = queryMoreTrips(laterResult.context, false);
|
||||
print(earlierResult);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VblProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,14 +48,14 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "119"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "119"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47049107, 8312502));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47049107, 8312502));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VbnProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class VbnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8000110"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8000110"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51318447, 9496250));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51318447, 9496250));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class VbnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8000110", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class VbnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class VbnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Coppengrave");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,9 +83,7 @@ public class VbnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Göttingen Hauptbahnhof");
|
||||
|
||||
print(result);
|
||||
|
||||
assertEquals("Göttingen", result.getLocations().get(0).place);
|
||||
}
|
||||
|
||||
|
|
|
@ -26,7 +26,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VgnProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -45,14 +45,14 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3000510"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3000510"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49455472, 11079655));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49455472, 11079655));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -94,6 +94,7 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
|
|||
"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);
|
||||
}
|
||||
|
@ -105,6 +106,7 @@ public class VgnProviderLiveTest extends AbstractProviderLiveTest
|
|||
LocationType.ADDRESS, null, 49437392, 11094524, "Nürnberg", "Wodanstraße 25"), new Date(), false, Product.ALL, WalkSpeed.FAST,
|
||||
Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VgsProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class VgsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8000244"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8000244"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49234783, 6995687));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49234783, 6995687));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class VgsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Flughafen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class VgsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8000244", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class VgsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -90,6 +85,7 @@ public class VgsProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "10640", "Saarbrücken", "Hauptbahnhof"), null, new Location(
|
||||
LocationType.STATION, "10700", "Saarbrücken", "Ostbahnhof"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VmobilProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,14 +48,14 @@ public class VmobilProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60001296"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60001296"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VmsProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class VmsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "36030062"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "36030062"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50832754, 12918348));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50832754, 12918348));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class VmsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("36030062", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class VmsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VmvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class VmvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "44402031"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "44402031"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53637555, 11392593));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 53637555, 11392593));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class VmvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("80001834", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class VmvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VorProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,14 +50,14 @@ public class VorProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60203090"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60203090"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48207355, 16370602));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48207355, 16370602));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VrnProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,20 +48,20 @@ public class VrnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result1 = queryNearbyStations(new Location(LocationType.STATION, "6032236"));
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(new Location(LocationType.STATION, "6032236"));
|
||||
print(result1);
|
||||
|
||||
final NearbyStationsResult result2 = queryNearbyStations(new Location(LocationType.STATION, "17001301"));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.STATION, "17001301"));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result1 = queryNearbyStations(new Location(LocationType.ADDRESS, 49486561, 8477297));
|
||||
final NearbyLocationsResult result1 = queryNearbyStations(new Location(LocationType.ADDRESS, 49486561, 8477297));
|
||||
print(result1);
|
||||
|
||||
final NearbyStationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 49757571, 6639147));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 49757571, 6639147));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VrrProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,17 +50,17 @@ public class VrrProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "20019904"));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "20019904"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51218693, 6777785));
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51218693, 6777785));
|
||||
print(result);
|
||||
|
||||
final NearbyStationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 51719648, 8754330));
|
||||
final NearbyLocationsResult result2 = queryNearbyStations(new Location(LocationType.ADDRESS, 51719648, 8754330));
|
||||
print(result2);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VsnProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class VsnProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8000128"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8000128"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51536614, 9925673));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51536614, 9925673));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class VsnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8000128", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class VsnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class VsnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Hannover");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -88,7 +83,6 @@ public class VsnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Göttingen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -96,7 +90,6 @@ public class VsnProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithoutCoordinatesInResult() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("aachen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -107,6 +100,7 @@ public class VsnProviderLiveTest extends AbstractProviderLiveTest
|
|||
LocationType.STATION, "1140061", null, "Göttingen Nikolausberger Weg"), new Date(), true, Product.ALL, WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
}
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VvmProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class VvmProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3000510"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "3000510"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49455472, 11079655));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 49455472, 11079655));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class VvmProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("3000510", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class VvmProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class VvmProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VvoProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,16 +50,14 @@ public class VvoProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "33000013"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "33000013"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51052467, 13733196));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 51052467, 13733196));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -67,7 +65,6 @@ public class VvoProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("100", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -75,7 +72,6 @@ public class VvoProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -83,7 +79,6 @@ public class VvoProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Hülßestraße");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -99,7 +94,6 @@ public class VvoProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestAddressLocation() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Dresden, Töpferstr. 10");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VvsProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class VvsProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "6118"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "6118"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48775005, 9166517));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48775005, 9166517));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class VvsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("6118", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class VvsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class VvsProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VvtProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class VvtProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60101187"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60101187"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47271228, 11402063));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class VvtProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("60101187", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class VvtProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class VvtProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.VvvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -48,16 +48,14 @@ public class VvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "80007271"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "80007271"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50776518, 12056032));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 50776518, 12056032));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -65,7 +63,6 @@ public class VvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("80007271", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -73,7 +70,6 @@ public class VvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kirchweidach, Kirchweidach");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -81,7 +77,6 @@ public class VvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,6 +23,7 @@ import static org.junit.Assert.assertThat;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -31,7 +32,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.WienProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -50,24 +51,30 @@ public class WienProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStations() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60203090"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "60203090"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48207355, 16370602));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 48207355, 16370602));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyLocationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyLocationsResult result = queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), new Location(
|
||||
LocationType.ADDRESS, 48207355, 16370602));
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("60203090", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -75,7 +82,6 @@ public class WienProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Kur");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -83,7 +89,6 @@ public class WienProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("grün");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -28,7 +28,7 @@ import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
|||
import de.schildbach.pte.ZvvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
@ -47,16 +47,14 @@ public class ZvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void nearbyStationsByStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8503000"));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.STATION, "8503000"));
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStationsByCoordinate() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47378968, 8540534));
|
||||
|
||||
final NearbyLocationsResult result = queryNearbyStations(new Location(LocationType.ADDRESS, 47378968, 8540534));
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -64,7 +62,6 @@ public class ZvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("8503000", false);
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
@ -72,7 +69,6 @@ public class ZvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
|
@ -80,7 +76,6 @@ public class ZvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final SuggestLocationsResult result = suggestLocations("Flughafen");
|
||||
|
||||
print(result);
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2012-2014 the original author or authors.
|
||||
* Copyright 2012-2015 the original author or authors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU Affero General Public License as published by
|
||||
|
@ -18,6 +18,7 @@
|
|||
package de.schildbach.pte.service;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.EnumSet;
|
||||
|
||||
import org.springframework.stereotype.Controller;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -28,7 +29,7 @@ import org.springframework.web.bind.annotation.ResponseBody;
|
|||
import de.schildbach.pte.RtProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
|
@ -48,9 +49,9 @@ public class LocationController
|
|||
|
||||
@RequestMapping(value = "/location/nearby", method = RequestMethod.GET)
|
||||
@ResponseBody
|
||||
public NearbyStationsResult nearby(@RequestParam("lat") final int lat, @RequestParam("lon") final int lon) throws IOException
|
||||
public NearbyLocationsResult nearby(@RequestParam("lat") final int lat, @RequestParam("lon") final int lon) throws IOException
|
||||
{
|
||||
final Location location = new Location(LocationType.ANY, lat, lon);
|
||||
return provider.queryNearbyStations(location, 5000, 100);
|
||||
return provider.queryNearbyLocations(EnumSet.of(LocationType.STATION, LocationType.POI), location, 5000, 100);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue