mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-14 08:40:29 +00:00
Rename NetworkProvider.autocompleteStations() to .suggestLocations() and change return type to SuggestLocationsResult.
This commit is contained in:
parent
d38d6e499b
commit
00b0f014ca
136 changed files with 809 additions and 745 deletions
|
@ -66,6 +66,7 @@ import de.schildbach.pte.dto.QueryTripsResult;
|
|||
import de.schildbach.pte.dto.ResultHeader;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
import de.schildbach.pte.dto.Stop;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
import de.schildbach.pte.dto.Trip;
|
||||
import de.schildbach.pte.exception.InvalidDataException;
|
||||
import de.schildbach.pte.exception.ParserException;
|
||||
|
@ -243,7 +244,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
uri.append('&').append(additionalQueryParameter);
|
||||
}
|
||||
|
||||
protected List<Location> jsonStopfinderRequest(final Location constraint) throws IOException
|
||||
protected SuggestLocationsResult jsonStopfinderRequest(final Location constraint) throws IOException
|
||||
{
|
||||
final StringBuilder parameters = stopfinderRequestParameters(constraint, "JSON");
|
||||
|
||||
|
@ -255,10 +256,11 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
// System.out.println(parameters);
|
||||
|
||||
final CharSequence page = ParserUtils.scrape(uri.toString(), httpPost ? parameters.substring(1) : null, UTF_8, null);
|
||||
final ResultHeader header = new ResultHeader(SERVER_PRODUCT);
|
||||
|
||||
try
|
||||
{
|
||||
final List<Location> results = new ArrayList<Location>();
|
||||
final List<Location> locations = new ArrayList<Location>();
|
||||
|
||||
final JSONObject head = new JSONObject(page.toString());
|
||||
final JSONObject stopFinder = head.optJSONObject("stopFinder");
|
||||
|
@ -274,8 +276,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
{
|
||||
final JSONObject stop = points.getJSONObject("point");
|
||||
final Location location = parseJsonStop(stop);
|
||||
results.add(location);
|
||||
return results;
|
||||
locations.add(location);
|
||||
return new SuggestLocationsResult(header, locations);
|
||||
}
|
||||
|
||||
stops = stopFinder.getJSONArray("points");
|
||||
|
@ -287,10 +289,10 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
{
|
||||
final JSONObject stop = stops.optJSONObject(i);
|
||||
final Location location = parseJsonStop(stop);
|
||||
results.add(location);
|
||||
locations.add(location);
|
||||
}
|
||||
|
||||
return results;
|
||||
return new SuggestLocationsResult(header, locations);
|
||||
}
|
||||
catch (final JSONException x)
|
||||
{
|
||||
|
@ -357,7 +359,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
return parameters;
|
||||
}
|
||||
|
||||
protected List<Location> xmlStopfinderRequest(final Location constraint) throws IOException
|
||||
protected SuggestLocationsResult xmlStopfinderRequest(final Location constraint) throws IOException
|
||||
{
|
||||
final StringBuilder parameters = stopfinderRequestParameters(constraint, "XML");
|
||||
|
||||
|
@ -378,9 +380,9 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
final XmlPullParser pp = parserFactory.newPullParser();
|
||||
pp.setInput(is, null);
|
||||
enterItdRequest(pp);
|
||||
final ResultHeader header = enterItdRequest(pp);
|
||||
|
||||
final List<Location> results = new ArrayList<Location>();
|
||||
final List<Location> locations = new ArrayList<Location>();
|
||||
|
||||
XmlPullUtil.enter(pp, "itdStopFinderRequest");
|
||||
|
||||
|
@ -402,7 +404,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
if ("identified".equals(nameState) || "list".equals(nameState))
|
||||
{
|
||||
while (XmlPullUtil.test(pp, "odvNameElem"))
|
||||
results.add(processOdvNameElem(pp, null));
|
||||
locations.add(processOdvNameElem(pp, null));
|
||||
}
|
||||
else if ("notidentified".equals(nameState))
|
||||
{
|
||||
|
@ -419,7 +421,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
XmlPullUtil.exit(pp, "itdStopFinderRequest");
|
||||
|
||||
return results;
|
||||
return new SuggestLocationsResult(header, locations);
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
{
|
||||
|
@ -483,7 +485,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
protected List<Location> mobileStopfinderRequest(final Location constraint) throws IOException
|
||||
protected SuggestLocationsResult mobileStopfinderRequest(final Location constraint) throws IOException
|
||||
{
|
||||
final StringBuilder parameters = stopfinderRequestParameters(constraint, "XML");
|
||||
|
||||
|
@ -504,7 +506,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
final XmlPullParser pp = parserFactory.newPullParser();
|
||||
pp.setInput(is, null);
|
||||
enterEfa(pp);
|
||||
final ResultHeader header = enterEfa(pp);
|
||||
|
||||
final List<LocationAndQuality> locations = new ArrayList<LocationAndQuality>();
|
||||
|
||||
|
@ -571,7 +573,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
for (final LocationAndQuality location : locations)
|
||||
results.add(location.location);
|
||||
|
||||
return results;
|
||||
return new SuggestLocationsResult(header, results);
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
{
|
||||
|
@ -744,7 +746,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return jsonStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@ import de.schildbach.pte.dto.QueryTripsResult;
|
|||
import de.schildbach.pte.dto.ResultHeader;
|
||||
import de.schildbach.pte.dto.StationDepartures;
|
||||
import de.schildbach.pte.dto.Stop;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
import de.schildbach.pte.dto.Trip;
|
||||
import de.schildbach.pte.exception.ParserException;
|
||||
import de.schildbach.pte.exception.SessionExpiredException;
|
||||
|
@ -316,7 +317,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
return new Position(platformText);
|
||||
}
|
||||
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(getStopEndpoint);
|
||||
uri.append(jsonGetStopsParameters(constraint));
|
||||
|
@ -339,7 +340,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
private static final Pattern P_AJAX_GET_STOPS_JSON = Pattern.compile("SLs\\.sls\\s*=\\s*(.*?);\\s*SLs\\.showSuggestion\\(\\);", Pattern.DOTALL);
|
||||
private static final Pattern P_AJAX_GET_STOPS_ID = Pattern.compile(".*?@L=0*(\\d+)@.*?");
|
||||
|
||||
protected final List<Location> jsonGetStops(final String uri) throws IOException
|
||||
protected final SuggestLocationsResult jsonGetStops(final String uri) throws IOException
|
||||
{
|
||||
final CharSequence page = ParserUtils.scrape(uri, null, jsonGetStopsEncoding, null);
|
||||
|
||||
|
@ -347,7 +348,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
if (mJson.matches())
|
||||
{
|
||||
final String json = mJson.group(1);
|
||||
final List<Location> results = new ArrayList<Location>();
|
||||
final List<Location> locations = new ArrayList<Location>();
|
||||
|
||||
try
|
||||
{
|
||||
|
@ -371,16 +372,16 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
if (type == 1) // station
|
||||
{
|
||||
final String[] placeAndName = splitPlaceAndName(value);
|
||||
results.add(new Location(LocationType.STATION, localId, lat, lon, placeAndName[0], placeAndName[1]));
|
||||
locations.add(new Location(LocationType.STATION, localId, lat, lon, placeAndName[0], placeAndName[1]));
|
||||
}
|
||||
else if (type == 2) // address
|
||||
{
|
||||
final String[] placeAndName = splitPlaceAndName(value);
|
||||
results.add(new Location(LocationType.ADDRESS, null, lat, lon, placeAndName[0], placeAndName[1]));
|
||||
locations.add(new Location(LocationType.ADDRESS, null, lat, lon, placeAndName[0], placeAndName[1]));
|
||||
}
|
||||
else if (type == 4) // poi
|
||||
{
|
||||
results.add(new Location(LocationType.POI, localId, lat, lon, null, value));
|
||||
locations.add(new Location(LocationType.POI, localId, lat, lon, null, value));
|
||||
}
|
||||
else if (type == 71) // strange (VBN)
|
||||
{
|
||||
|
@ -401,7 +402,7 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
}
|
||||
}
|
||||
|
||||
return results;
|
||||
return new SuggestLocationsResult(new ResultHeader(SERVER_PRODUCT), locations);
|
||||
}
|
||||
catch (final JSONException x)
|
||||
{
|
||||
|
@ -752,32 +753,32 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
if (!from.isIdentified())
|
||||
{
|
||||
final List<Location> autocompletes = autocompleteStations(from.name);
|
||||
if (autocompletes.isEmpty())
|
||||
final List<Location> locations = suggestLocations(from.name).locations;
|
||||
if (locations.isEmpty())
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||
if (autocompletes.size() > 1)
|
||||
return new QueryTripsResult(header, autocompletes, null, null);
|
||||
from = autocompletes.get(0);
|
||||
if (locations.size() > 1)
|
||||
return new QueryTripsResult(header, locations, null, null);
|
||||
from = locations.get(0);
|
||||
}
|
||||
|
||||
if (via != null && !via.isIdentified())
|
||||
{
|
||||
final List<Location> autocompletes = autocompleteStations(via.name);
|
||||
if (autocompletes.isEmpty())
|
||||
final List<Location> locations = suggestLocations(via.name).locations;
|
||||
if (locations.isEmpty())
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||
if (autocompletes.size() > 1)
|
||||
return new QueryTripsResult(header, null, autocompletes, null);
|
||||
via = autocompletes.get(0);
|
||||
if (locations.size() > 1)
|
||||
return new QueryTripsResult(header, null, locations, null);
|
||||
via = locations.get(0);
|
||||
}
|
||||
|
||||
if (!to.isIdentified())
|
||||
{
|
||||
final List<Location> autocompletes = autocompleteStations(to.name);
|
||||
if (autocompletes.isEmpty())
|
||||
final List<Location> locations = suggestLocations(to.name).locations;
|
||||
if (locations.isEmpty())
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||
if (autocompletes.size() > 1)
|
||||
return new QueryTripsResult(header, null, null, autocompletes);
|
||||
to = autocompletes.get(0);
|
||||
if (locations.size() > 1)
|
||||
return new QueryTripsResult(header, null, null, locations);
|
||||
to = locations.get(0);
|
||||
}
|
||||
|
||||
final Calendar c = new GregorianCalendar(timeZone());
|
||||
|
@ -1371,32 +1372,32 @@ public abstract class AbstractHafasProvider extends AbstractNetworkProvider
|
|||
|
||||
if (!from.isIdentified())
|
||||
{
|
||||
final List<Location> autocompletes = autocompleteStations(from.name);
|
||||
if (autocompletes.isEmpty())
|
||||
final List<Location> locations = suggestLocations(from.name).locations;
|
||||
if (locations.isEmpty())
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||
if (autocompletes.size() > 1)
|
||||
return new QueryTripsResult(header, autocompletes, null, null);
|
||||
from = autocompletes.get(0);
|
||||
if (locations.size() > 1)
|
||||
return new QueryTripsResult(header, locations, null, null);
|
||||
from = locations.get(0);
|
||||
}
|
||||
|
||||
if (via != null && !via.isIdentified())
|
||||
{
|
||||
final List<Location> autocompletes = autocompleteStations(via.name);
|
||||
if (autocompletes.isEmpty())
|
||||
final List<Location> locations = suggestLocations(via.name).locations;
|
||||
if (locations.isEmpty())
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||
if (autocompletes.size() > 1)
|
||||
return new QueryTripsResult(header, null, autocompletes, null);
|
||||
via = autocompletes.get(0);
|
||||
if (locations.size() > 1)
|
||||
return new QueryTripsResult(header, null, locations, null);
|
||||
via = locations.get(0);
|
||||
}
|
||||
|
||||
if (!to.isIdentified())
|
||||
{
|
||||
final List<Location> autocompletes = autocompleteStations(to.name);
|
||||
if (autocompletes.isEmpty())
|
||||
final List<Location> locations = suggestLocations(to.name).locations;
|
||||
if (locations.isEmpty())
|
||||
return new QueryTripsResult(header, QueryTripsResult.Status.NO_TRIPS); // TODO
|
||||
if (autocompletes.size() > 1)
|
||||
return new QueryTripsResult(header, null, null, autocompletes);
|
||||
to = autocompletes.get(0);
|
||||
if (locations.size() > 1)
|
||||
return new QueryTripsResult(header, null, null, locations);
|
||||
to = locations.get(0);
|
||||
}
|
||||
|
||||
final StringBuilder uri = new StringBuilder(queryEndpoint);
|
||||
|
|
|
@ -48,6 +48,7 @@ import de.schildbach.pte.dto.QueryTripsContext;
|
|||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.ResultHeader;
|
||||
import de.schildbach.pte.dto.Stop;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
import de.schildbach.pte.dto.Trip;
|
||||
import de.schildbach.pte.exception.ParserException;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -185,7 +186,7 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
apiBase + (stopFinderEndpoint != null ? stopFinderEndpoint : DEFAULT_STOPFINDER_ENDPOINT));
|
||||
}
|
||||
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
final StringBuilder parameters = buildCommonRequestParams("SearchTripPoint", "json");
|
||||
parameters.append("&MaxItems=").append(50); // XXX good value?
|
||||
|
@ -197,13 +198,13 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
final CharSequence page = ParserUtils.scrape(uri.toString(), null, UTF_8, null, 3);
|
||||
try
|
||||
{
|
||||
final List<Location> stations = new ArrayList<Location>();
|
||||
final List<Location> locations = new ArrayList<Location>();
|
||||
final JSONObject head = new JSONObject(page.toString());
|
||||
|
||||
int status = head.getInt("StatusCode");
|
||||
|
||||
if (status != 200)
|
||||
return stations;
|
||||
return new SuggestLocationsResult(HEADER, SuggestLocationsResult.Status.SERVICE_DOWN);
|
||||
|
||||
JSONArray dataArray = head.getJSONArray("Data");
|
||||
for (int i = 0; i < dataArray.length(); i++)
|
||||
|
@ -213,10 +214,10 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
|
||||
if (location.isIdentified()) // make sure the location is really identified
|
||||
// some addresses may not contain coordinates, we ignore them
|
||||
stations.add(location);
|
||||
locations.add(location);
|
||||
}
|
||||
|
||||
return stations;
|
||||
return new SuggestLocationsResult(HEADER, locations);
|
||||
}
|
||||
catch (final JSONException x)
|
||||
{
|
||||
|
@ -266,11 +267,11 @@ public abstract class AbstractTsiProvider extends AbstractNetworkProvider
|
|||
if (location.isIdentified())
|
||||
return Collections.singletonList(location);
|
||||
|
||||
final List<Location> result = autocompleteStations(location.uniqueShortName());
|
||||
if (result == null)
|
||||
final List<Location> locations = suggestLocations(location.uniqueShortName()).locations;
|
||||
if (locations == null)
|
||||
return new ArrayList<Location>(0);
|
||||
|
||||
return result;
|
||||
return locations;
|
||||
}
|
||||
|
||||
private NearbyStationsResult jsonCoordRequest(final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -44,14 +44,14 @@ public class AtcProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class AvvProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -49,7 +49,7 @@ public final class BahnProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.NEARBY_STATIONS || capability == Capability.DEPARTURES || capability == Capability.AUTOCOMPLETE_ONE_LINE
|
||||
if (capability == Capability.NEARBY_STATIONS || capability == Capability.DEPARTURES || capability == Capability.SUGGEST_LOCATIONS
|
||||
|| capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -30,6 +29,7 @@ import de.schildbach.pte.dto.Product;
|
|||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsContext;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -59,7 +59,7 @@ public class BayernProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -125,7 +125,7 @@ public class BayernProvider extends AbstractEfaProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return mobileStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ public class BsvagProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -44,14 +44,14 @@ public class BvbProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -76,7 +76,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.NEARBY_STATIONS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.NEARBY_STATIONS)
|
||||
return false;
|
||||
|
||||
return true;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class DingProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -50,7 +50,7 @@ public class DsbProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -18,11 +18,11 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -54,14 +54,14 @@ public class DubProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -56,7 +56,7 @@ public class EireannProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -46,7 +46,7 @@ public class GvhProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class IvbProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -51,7 +51,7 @@ public class JetProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -53,7 +53,7 @@ public class KvvProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -46,7 +46,7 @@ public class LinzProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -55,7 +55,7 @@ public class MetProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class MvgProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -52,7 +52,7 @@ public class MvvProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -44,7 +44,7 @@ public class NaldoProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -64,7 +64,7 @@ public class NaldoProvider extends AbstractEfaProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -49,7 +49,7 @@ public class NasaProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte;
|
|||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.Set;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -31,6 +30,7 @@ import de.schildbach.pte.dto.QueryDeparturesResult;
|
|||
import de.schildbach.pte.dto.QueryTripsContext;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.Style;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* Interface to be implemented by providers of transportation networks.
|
||||
|
@ -41,8 +41,8 @@ public interface NetworkProvider
|
|||
{
|
||||
public enum Capability
|
||||
{
|
||||
/* can autocomplete locations */
|
||||
AUTOCOMPLETE_ONE_LINE,
|
||||
/* can suggest locations */
|
||||
SUGGEST_LOCATIONS,
|
||||
/* can determine nearby stations */
|
||||
NEARBY_STATIONS,
|
||||
/* can query for departures */
|
||||
|
@ -99,14 +99,14 @@ public interface NetworkProvider
|
|||
QueryDeparturesResult queryDepartures(String stationId, int maxDepartures, boolean equivs) throws IOException;
|
||||
|
||||
/**
|
||||
* Meant for auto-completion of station names, like in an {@link android.widget.AutoCompleteTextView}
|
||||
* Meant for auto-completion of location names, like in an {@link android.widget.AutoCompleteTextView}
|
||||
*
|
||||
* @param constraint
|
||||
* input by user so far
|
||||
* @return auto-complete suggestions
|
||||
* @return location suggestions
|
||||
* @throws IOException
|
||||
*/
|
||||
List<Location> autocompleteStations(CharSequence constraint) throws IOException;
|
||||
SuggestLocationsResult suggestLocations(CharSequence constraint) throws IOException;
|
||||
|
||||
/**
|
||||
* Typical products for a network
|
||||
|
|
|
@ -53,7 +53,7 @@ public class NriProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ public class NsProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class NvbwProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ public class NvvProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -50,7 +50,7 @@ public class OebbProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.NEARBY_STATIONS || capability == Capability.DEPARTURES || capability == Capability.AUTOCOMPLETE_ONE_LINE
|
||||
if (capability == Capability.NEARBY_STATIONS || capability == Capability.DEPARTURES || capability == Capability.SUGGEST_LOCATIONS
|
||||
|| capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
|
|
|
@ -39,7 +39,7 @@ public class PacaProvider extends AbstractTsiProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -51,7 +51,7 @@ public class PlProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ public class RtProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ public class SbbProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -57,7 +57,7 @@ public class SeProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -75,7 +75,7 @@ public class SeptaProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -54,7 +54,7 @@ public class SfProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -62,7 +62,7 @@ public class ShProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -50,7 +50,7 @@ public class SncbProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -56,7 +56,7 @@ public class StockholmProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class StvProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class SvvProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -48,7 +48,7 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -49,7 +49,7 @@ public class TfiProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -53,7 +53,7 @@ public class TflProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -19,12 +19,12 @@ package de.schildbach.pte;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -56,7 +56,7 @@ public class TlemProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -76,7 +76,7 @@ public class TlemProvider extends AbstractEfaProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -19,12 +19,12 @@ package de.schildbach.pte;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -55,14 +55,14 @@ public class TlswProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class TlwmProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ public class VagfrProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -60,7 +60,7 @@ public class VbbProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.DEPARTURES || capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.TRIPS)
|
||||
if (capability == Capability.DEPARTURES || capability == Capability.SUGGEST_LOCATIONS || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class VblProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -46,7 +46,7 @@ public class VbnProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.NEARBY_STATIONS || capability == Capability.DEPARTURES || capability == Capability.AUTOCOMPLETE_ONE_LINE
|
||||
if (capability == Capability.NEARBY_STATIONS || capability == Capability.DEPARTURES || capability == Capability.SUGGEST_LOCATIONS
|
||||
|| capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
|
|
|
@ -46,7 +46,7 @@ public class VgnProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -45,7 +45,7 @@ public class VgsProvider extends AbstractHafasProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class VmobilProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -44,7 +44,7 @@ public class VmsProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
@ -68,7 +68,7 @@ public class VmsProvider extends AbstractEfaProvider
|
|||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -19,13 +19,13 @@ package de.schildbach.pte;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.Style;
|
||||
import de.schildbach.pte.dto.Style.Shape;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -51,14 +51,14 @@ public class VmvProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -51,7 +51,7 @@ public class VorProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -38,7 +38,7 @@ public class VrnProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -48,7 +48,7 @@ public class VrrProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -44,14 +44,14 @@ public class VrtProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -18,10 +18,10 @@
|
|||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -46,14 +46,14 @@ public class VvmProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.ANY, null, null, constraint.toString()));
|
||||
}
|
||||
|
|
|
@ -47,7 +47,7 @@ public class VvoProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ public class VvsProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class VvtProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -40,7 +40,7 @@ public class VvvProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -47,7 +47,7 @@ public class WienProvider extends AbstractEfaProvider
|
|||
public boolean hasCapabilities(final Capability... capabilities)
|
||||
{
|
||||
for (final Capability capability : capabilities)
|
||||
if (capability == Capability.AUTOCOMPLETE_ONE_LINE || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
if (capability == Capability.SUGGEST_LOCATIONS || capability == Capability.DEPARTURES || capability == Capability.TRIPS)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
|
|
|
@ -0,0 +1,60 @@
|
|||
/*
|
||||
* Copyright 2014 the original author or authors.
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||
*/
|
||||
|
||||
package de.schildbach.pte.dto;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.List;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public final class SuggestLocationsResult implements Serializable
|
||||
{
|
||||
public enum Status
|
||||
{
|
||||
OK, SERVICE_DOWN
|
||||
}
|
||||
|
||||
public final ResultHeader header;
|
||||
public final Status status;
|
||||
public final List<Location> locations;
|
||||
|
||||
public SuggestLocationsResult(final ResultHeader header, final List<Location> locations)
|
||||
{
|
||||
this.header = header;
|
||||
this.status = Status.OK;
|
||||
this.locations = locations;
|
||||
}
|
||||
|
||||
public SuggestLocationsResult(final ResultHeader header, final Status status)
|
||||
{
|
||||
this.header = header;
|
||||
this.status = status;
|
||||
this.locations = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString()
|
||||
{
|
||||
final StringBuilder builder = new StringBuilder(getClass().getName());
|
||||
builder.append("[").append(this.status);
|
||||
builder.append(" ").append(locations);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
}
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import java.io.IOException;
|
||||
import java.util.Collection;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.NetworkProvider;
|
||||
import de.schildbach.pte.NetworkProvider.Accessibility;
|
||||
|
@ -31,6 +30,7 @@ import de.schildbach.pte.dto.Product;
|
|||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsContext;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -59,11 +59,11 @@ public abstract class AbstractProviderLiveTest
|
|||
// System.out.println(departure);
|
||||
}
|
||||
|
||||
protected final void print(final List<Location> autocompletes)
|
||||
protected final void print(final SuggestLocationsResult result)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete + " ");
|
||||
System.out.print(result.locations.size() + " ");
|
||||
for (final Location location : result.locations)
|
||||
System.out.print(location + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
|
|
|
@ -18,7 +18,6 @@
|
|||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -31,6 +30,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -68,19 +68,19 @@ public class AtcProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("ponte");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("ponte");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grünwink");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grünwink");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,19 +70,19 @@ public class AvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kur");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grünwink");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grünwink");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -69,31 +69,31 @@ public class BahnProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Güntzelstr. (U)");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Güntzelstr. (U)");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
|
||||
assertEquals("Güntzelstr. (U), Berlin", autocompletes.get(0).name);
|
||||
assertEquals("Güntzelstr. (U), Berlin", result.locations.get(0).name);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Landungsbr");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Landungsbr");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
|
||||
assertEquals("Hamburg Landungsbrücken", autocompletes.get(0).name);
|
||||
assertEquals("Hamburg Landungsbrücken", result.locations.get(0).name);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIdentified() throws Exception
|
||||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Berlin");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Berlin");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -74,40 +74,40 @@ public class BayernProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Marien");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Marien");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteAddress() throws Exception
|
||||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("München, Friedenstraße 2");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("München, Friedenstraße 2");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteLocal() throws Exception
|
||||
public void suggestLocationsLocal() throws Exception
|
||||
{
|
||||
final List<Location> autocompleteRegensburg = provider.autocompleteStations("Regensburg");
|
||||
assertEquals("80001083", autocompleteRegensburg.iterator().next().id);
|
||||
final SuggestLocationsResult regensburgResult = provider.suggestLocations("Regensburg");
|
||||
assertEquals("80001083", regensburgResult.locations.iterator().next().id);
|
||||
|
||||
final List<Location> autocompleteMunich = provider.autocompleteStations("München");
|
||||
assertEquals("80000689", autocompleteMunich.iterator().next().id);
|
||||
final SuggestLocationsResult munichResult = provider.suggestLocations("München");
|
||||
assertEquals("80000689", munichResult.locations.iterator().next().id);
|
||||
|
||||
final List<Location> autocompleteNuremberg = provider.autocompleteStations("Nürnberg");
|
||||
assertEquals("80001020", autocompleteNuremberg.iterator().next().id);
|
||||
final SuggestLocationsResult nurembergResult = provider.suggestLocations("Nürnberg");
|
||||
assertEquals("80001020", nurembergResult.locations.iterator().next().id);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -23,7 +23,6 @@ import static org.junit.Assert.assertThat;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -36,6 +35,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -72,27 +72,27 @@ public class BsvagProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kurf");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kurf");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteCoverage() throws Exception
|
||||
public void suggestLocationsCoverage() throws Exception
|
||||
{
|
||||
final List<Location> braunschweigAutocompletes = provider.autocompleteStations("Braunschweig Rhönweg");
|
||||
print(braunschweigAutocompletes);
|
||||
assertThat(braunschweigAutocompletes, hasItem(new Location(LocationType.STATION, "26000351")));
|
||||
final SuggestLocationsResult braunschweigResult = provider.suggestLocations("Braunschweig Rhönweg");
|
||||
print(braunschweigResult);
|
||||
assertThat(braunschweigResult.locations, hasItem(new Location(LocationType.STATION, "26000351")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,19 +70,19 @@ public class BvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Haupt");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Haupt");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Assert;
|
||||
import org.junit.Test;
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -91,31 +91,31 @@ public class BvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Güntzelstr.");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Güntzelstr.");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
|
||||
Assert.assertEquals("Güntzelstr. (U)", autocompletes.get(0).name);
|
||||
Assert.assertEquals("Güntzelstr. (U)", result.locations.get(0).name);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteAddress() throws Exception
|
||||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Sophienstr. 24");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Sophienstr. 24");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
|
||||
Assert.assertEquals("Sophienstr. 24", autocompletes.get(0).name);
|
||||
Assert.assertEquals("Sophienstr. 24", result.locations.get(0).name);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("nol");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("nol");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,19 +70,19 @@ public class DingProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kur");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -77,11 +77,11 @@ public class DsbProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Airport");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Airport");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.LocationType;
|
|||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -61,11 +61,11 @@ public class DubProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Airport");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Airport");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -77,27 +77,27 @@ public class EireannProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Dublin");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Dublin");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Busáras");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Busáras");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteAddress() throws Exception
|
||||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Dorfstrasse 10, Dällikon, Schweiz");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Dorfstrasse 10, Dällikon, Schweiz");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,43 +70,43 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kur");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIdentified() throws Exception
|
||||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Hannover, Hannoversche Straße");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Hannover, Hannoversche Straße");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteCity() throws Exception
|
||||
public void suggestLocationsCity() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Hannover");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Hannover");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> results = provider.autocompleteStations("Hannover");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Hannover");
|
||||
|
||||
System.out.println(results.size() + " " + results);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -77,11 +77,11 @@ public class InvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Flughafen");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Flughafen");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,19 +70,19 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kur");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -82,11 +82,11 @@ public class JetProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autoComplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("הנשיא - מוזיאון האיסלם, ירושלים");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("הנשיא - מוזיאון האיסלם, ירושלים");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,19 +70,19 @@ public class KvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kur");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grünwink");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grünwink");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -69,35 +69,35 @@ public class LinzProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Friedhof");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Friedhof");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIdentified() throws Exception
|
||||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Leonding, Haag");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Leonding, Haag");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteCity() throws Exception
|
||||
public void suggestLocationsCity() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Leonding");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Leonding");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -77,11 +77,11 @@ public class LuProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Aéroport");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Aéroport");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,11 +70,11 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kur");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -23,7 +23,6 @@ import static org.junit.Assert.assertThat;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -36,6 +35,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -72,39 +72,39 @@ public class MvgProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Schützenhalle");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Schützenhalle");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteCoverage() throws Exception
|
||||
public void suggestLocationsCoverage() throws Exception
|
||||
{
|
||||
final List<Location> luedenscheidAutocompletes = provider.autocompleteStations("Lüdenscheid Freibad");
|
||||
print(luedenscheidAutocompletes);
|
||||
assertThat(luedenscheidAutocompletes, hasItem(new Location(LocationType.STATION, "24200153")));
|
||||
final SuggestLocationsResult luedenscheidResult = provider.suggestLocations("Lüdenscheid Freibad");
|
||||
print(luedenscheidResult);
|
||||
assertThat(luedenscheidResult.locations, hasItem(new Location(LocationType.STATION, "24200153")));
|
||||
|
||||
final List<Location> iserlohnAutocompletes = provider.autocompleteStations("Iserlohn Rathaus");
|
||||
print(iserlohnAutocompletes);
|
||||
assertThat(iserlohnAutocompletes, hasItem(new Location(LocationType.STATION, "24200764")));
|
||||
final SuggestLocationsResult iserlohnResult = provider.suggestLocations("Iserlohn Rathaus");
|
||||
print(iserlohnResult);
|
||||
assertThat(iserlohnResult.locations, hasItem(new Location(LocationType.STATION, "24200764")));
|
||||
|
||||
final List<Location> plettenbergAutocompletes = provider.autocompleteStations("Plettenberg Friedhof");
|
||||
print(plettenbergAutocompletes);
|
||||
assertThat(plettenbergAutocompletes, hasItem(new Location(LocationType.STATION, "24202864")));
|
||||
final SuggestLocationsResult plettenbergResult = provider.suggestLocations("Plettenberg Friedhof");
|
||||
print(plettenbergResult);
|
||||
assertThat(plettenbergResult.locations, hasItem(new Location(LocationType.STATION, "24202864")));
|
||||
|
||||
final List<Location> mendenAutocompletes = provider.autocompleteStations("Menden Am Gillfeld");
|
||||
print(mendenAutocompletes);
|
||||
assertThat(mendenAutocompletes, hasItem(new Location(LocationType.STATION, "24202193")));
|
||||
final SuggestLocationsResult mendenResult = provider.suggestLocations("Menden Am Gillfeld");
|
||||
print(mendenResult);
|
||||
assertThat(mendenResult.locations, hasItem(new Location(LocationType.STATION, "24202193")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -22,7 +22,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertThat;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -35,6 +34,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -80,35 +80,35 @@ public class MvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Marien");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Marien");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteLocal() throws Exception
|
||||
public void suggestLocationsLocal() throws Exception
|
||||
{
|
||||
final List<Location> autocompletesFraunhoferStr = provider.autocompleteStations("fraunhofer");
|
||||
assertThat(autocompletesFraunhoferStr, hasItem(new Location(LocationType.STATION, "1000150")));
|
||||
final SuggestLocationsResult fraunhoferStrResult = provider.suggestLocations("fraunhofer");
|
||||
assertThat(fraunhoferStrResult.locations, hasItem(new Location(LocationType.STATION, "1000150")));
|
||||
|
||||
final List<Location> autocompletesHirschgarten = provider.autocompleteStations("Hirschgarten");
|
||||
assertEquals("München", autocompletesHirschgarten.get(0).place);
|
||||
final SuggestLocationsResult hirschgartenResult = provider.suggestLocations("Hirschgarten");
|
||||
assertEquals("München", hirschgartenResult.locations.get(0).place);
|
||||
|
||||
final List<Location> autocompletesOstbahnhof = provider.autocompleteStations("Ostbahnhof");
|
||||
assertEquals("München", autocompletesOstbahnhof.get(0).place);
|
||||
final SuggestLocationsResult ostbahnhofResult = provider.suggestLocations("Ostbahnhof");
|
||||
assertEquals("München", ostbahnhofResult.locations.get(0).place);
|
||||
|
||||
final List<Location> autocompletesMarienplatz = provider.autocompleteStations("Marienplatz");
|
||||
assertEquals("München", autocompletesMarienplatz.get(0).place);
|
||||
final SuggestLocationsResult marienplatzResult = provider.suggestLocations("Marienplatz");
|
||||
assertEquals("München", marienplatzResult.locations.get(0).place);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -70,19 +70,19 @@ public class NaldoProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kurf");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kurf");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grünwink");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grünwink");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -80,19 +80,19 @@ public class NasaProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Flughafen");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Flughafen");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Höhle");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Höhle");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -77,19 +77,19 @@ public class NriProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Oslo");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Oslo");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Skøyen");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Skøyen");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -32,6 +31,7 @@ import de.schildbach.pte.dto.LocationType;
|
|||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -76,19 +76,19 @@ public class NsProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Brussel S");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Brussel S");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Brüssel");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Brüssel");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -23,7 +23,6 @@ import static org.junit.Assert.assertThat;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -36,6 +35,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -72,35 +72,35 @@ public class NvbwProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kur");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteWithUmlaut() throws Exception
|
||||
public void suggestLocationsWithUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("grün");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("grün");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteCoverage() throws Exception
|
||||
public void suggestLocationsCoverage() throws Exception
|
||||
{
|
||||
final List<Location> freiburgAutocompletes = provider.autocompleteStations("Freiburg Hauptbahnhof");
|
||||
print(freiburgAutocompletes);
|
||||
assertThat(freiburgAutocompletes, hasItem(new Location(LocationType.STATION, "6906508")));
|
||||
final SuggestLocationsResult freiburgResult = provider.suggestLocations("Freiburg Hauptbahnhof");
|
||||
print(freiburgResult);
|
||||
assertThat(freiburgResult.locations, hasItem(new Location(LocationType.STATION, "6906508")));
|
||||
|
||||
final List<Location> baselAutocompletes = provider.autocompleteStations("Basel");
|
||||
print(baselAutocompletes);
|
||||
assertThat(baselAutocompletes, hasItem(new Location(LocationType.STATION, "51000007")));
|
||||
final SuggestLocationsResult baselResult = provider.suggestLocations("Basel");
|
||||
print(baselResult);
|
||||
assertThat(baselResult.locations, hasItem(new Location(LocationType.STATION, "51000007")));
|
||||
|
||||
final List<Location> constanceAutocompletes = provider.autocompleteStations("Konstanz");
|
||||
print(constanceAutocompletes);
|
||||
assertThat(constanceAutocompletes, hasItem(new Location(LocationType.STATION, "8706554")));
|
||||
final SuggestLocationsResult constanceResult = provider.suggestLocations("Konstanz");
|
||||
print(constanceResult);
|
||||
assertThat(constanceResult.locations, hasItem(new Location(LocationType.STATION, "8706554")));
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -22,7 +22,6 @@ import static org.junit.Assert.assertTrue;
|
|||
|
||||
import java.io.IOException;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -35,6 +34,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -95,27 +95,27 @@ public class NvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Flughafen");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Flughafen");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIdentified() throws Exception
|
||||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kassel Wilhelmshöhe");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Kassel Wilhelmshöhe");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("könig");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("könig");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -34,6 +33,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -82,20 +82,20 @@ public class OebbProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Wien");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Wien");
|
||||
|
||||
print(autocompletes);
|
||||
assertTrue(autocompletes.size() > 0);
|
||||
print(result);
|
||||
assertTrue(result.locations.size() > 0);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Obirhöhle");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Obirhöhle");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -21,7 +21,6 @@ import static org.junit.Assert.assertEquals;
|
|||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -32,6 +31,7 @@ import de.schildbach.pte.dto.Location;
|
|||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Kjell Braden <afflux@pentabarf.de>
|
||||
|
@ -44,27 +44,27 @@ public class PacaProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("aeroport");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("aeroport");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteIdentified() throws Exception
|
||||
public void suggestLocationsIdentified() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("EGANAUDE, Biot");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("EGANAUDE, Biot");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Aéroport");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Aéroport");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -77,19 +77,19 @@ public class PlProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Warszawa");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Warszawa");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteUmlaut() throws Exception
|
||||
public void suggestLocationsUmlaut() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Służewiec");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Służewiec");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
|
@ -20,7 +20,6 @@ package de.schildbach.pte.live;
|
|||
import static org.junit.Assert.assertEquals;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -33,6 +32,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
|||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -77,27 +77,27 @@ public class RtProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
public void suggestLocations() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("haupt");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("haupt");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteAddress() throws Exception
|
||||
public void suggestLocationsAddress() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Dorfstrasse 10, Dällikon, Schweiz");
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Dorfstrasse 10, Dällikon, Schweiz");
|
||||
|
||||
print(autocompletes);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void autocompleteEncoding() throws Exception
|
||||
public void suggestLocationsEncoding() throws Exception
|
||||
{
|
||||
List<Location> autocompletes = provider.autocompleteStations("Dorfstrasse 1, Schäftland");
|
||||
assertEquals("Schöftland, Dorfstrasse", autocompletes.get(0).name);
|
||||
print(autocompletes);
|
||||
final SuggestLocationsResult result = provider.suggestLocations("Dorfstrasse 1, Schäftland");
|
||||
assertEquals("Schöftland, Dorfstrasse", result.locations.get(0).name);
|
||||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue