mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-07 23:28:48 +00:00
use stop finder if available for auto-completion
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@559 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
db6d9b4337
commit
cdc3ef140c
68 changed files with 1206 additions and 238 deletions
|
@ -63,15 +63,16 @@ import de.schildbach.pte.util.XmlPullUtil;
|
|||
*/
|
||||
public abstract class AbstractEfaProvider implements NetworkProvider
|
||||
{
|
||||
final XmlPullParserFactory parserFactory;
|
||||
final String additionalQueryParameter;
|
||||
private final String apiBase;
|
||||
private final String additionalQueryParameter;
|
||||
private final XmlPullParserFactory parserFactory;
|
||||
|
||||
public AbstractEfaProvider()
|
||||
{
|
||||
this(null);
|
||||
this(null, null);
|
||||
}
|
||||
|
||||
public AbstractEfaProvider(final String additionalQueryParameter)
|
||||
public AbstractEfaProvider(final String apiBase, final String additionalQueryParameter)
|
||||
{
|
||||
try
|
||||
{
|
||||
|
@ -82,6 +83,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
|||
throw new RuntimeException(x);
|
||||
}
|
||||
|
||||
this.apiBase = apiBase;
|
||||
this.additionalQueryParameter = additionalQueryParameter;
|
||||
}
|
||||
|
||||
|
@ -98,7 +100,85 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
|||
return uri + "&" + additionalQueryParameter;
|
||||
}
|
||||
|
||||
protected abstract String autocompleteUri(final CharSequence constraint);
|
||||
protected List<Location> xmlStopfinderRequest(final CharSequence constraint) throws IOException
|
||||
{
|
||||
final StringBuilder uri = new StringBuilder(apiBase);
|
||||
uri.append("XML_STOPFINDER_REQUEST?coordOutputFormat=WGS84&locationServerActive=1&name_sf=");
|
||||
uri.append(ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
uri.append("&type_sf=any&SpEncId=0");
|
||||
uri.append("&anyObjFilter_sf=126"); // 1=place 2=stop 4=street 8=address 16=crossing 32=poi 64=postcode
|
||||
uri.append("&reducedAnyPostcodeObjFilter_sf=64&reducedAnyTooManyObjFilter_sf=2&useHouseNumberList=true®ionID_sf=1");
|
||||
if (additionalQueryParameter != null)
|
||||
uri.append('&').append(additionalQueryParameter);
|
||||
|
||||
InputStream is = null;
|
||||
try
|
||||
{
|
||||
is = ParserUtils.scrapeInputStream(uri.toString());
|
||||
|
||||
final XmlPullParser pp = parserFactory.newPullParser();
|
||||
pp.setInput(is, null);
|
||||
assertItdRequest(pp);
|
||||
|
||||
XmlPullUtil.enter(pp, "itdRequest");
|
||||
|
||||
if (XmlPullUtil.test(pp, "clientHeaderLines"))
|
||||
XmlPullUtil.next(pp);
|
||||
|
||||
if (XmlPullUtil.test(pp, "itdVersionInfo"))
|
||||
XmlPullUtil.next(pp);
|
||||
|
||||
if (XmlPullUtil.test(pp, "itdInfoLinkList"))
|
||||
XmlPullUtil.next(pp);
|
||||
|
||||
if (XmlPullUtil.test(pp, "serverMetaInfo"))
|
||||
XmlPullUtil.next(pp);
|
||||
|
||||
final List<Location> results = new ArrayList<Location>();
|
||||
|
||||
XmlPullUtil.enter(pp, "itdStopFinderRequest");
|
||||
|
||||
XmlPullUtil.require(pp, "itdOdv");
|
||||
if (!"sf".equals(pp.getAttributeValue(null, "usage")))
|
||||
throw new IllegalStateException("cannot find <itdOdv usage=\"sf\" />");
|
||||
XmlPullUtil.enter(pp, "itdOdv");
|
||||
|
||||
XmlPullUtil.require(pp, "itdOdvPlace");
|
||||
XmlPullUtil.next(pp);
|
||||
|
||||
XmlPullUtil.enter(pp, "itdOdvName");
|
||||
|
||||
if (XmlPullUtil.test(pp, "itdMessage"))
|
||||
XmlPullUtil.next(pp);
|
||||
|
||||
while (XmlPullUtil.test(pp, "odvNameElem"))
|
||||
results.add(processOdvNameElem(pp, null));
|
||||
|
||||
XmlPullUtil.exit(pp, "itdOdvName");
|
||||
|
||||
XmlPullUtil.exit(pp, "itdOdv");
|
||||
|
||||
XmlPullUtil.exit(pp, "itdStopFinderRequest");
|
||||
|
||||
return results;
|
||||
}
|
||||
catch (final XmlPullParserException x)
|
||||
{
|
||||
throw new ParserException(x);
|
||||
}
|
||||
finally
|
||||
{
|
||||
if (is != null)
|
||||
is.close();
|
||||
}
|
||||
}
|
||||
|
||||
private String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
final String AUTOCOMPLETE_URI = apiBase + "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
|
|
|
@ -32,6 +32,11 @@ public class AtcProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.ATC;
|
||||
private final static String API_BASE = "http://tpweb.atc.bo.it/atc2/";
|
||||
|
||||
public AtcProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,15 +51,6 @@ public class AtcProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -33,6 +35,11 @@ public class AvvProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "efa.avv-augsburg.de";
|
||||
private final static String API_BASE = "http://efa.avv-augsburg.de/avv/";
|
||||
|
||||
public AvvProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,13 +54,10 @@ public class AvvProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,11 @@ public class BsagProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.BSAG;
|
||||
private final static String API_BASE = "http://62.206.133.180/bsag/";
|
||||
|
||||
public BsagProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,15 +51,6 @@ public class BsagProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -33,6 +33,11 @@ public class BsvagProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "212.68.73.240";
|
||||
private final static String API_BASE = "http://212.68.73.240/bsvag/";
|
||||
|
||||
public BsvagProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,15 +52,6 @@ public class BsvagProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -33,6 +35,11 @@ public class BvbProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "www.efa-bvb.ch";
|
||||
private final static String API_BASE = "http://www.efa-bvb.ch/bvb/";
|
||||
|
||||
public BvbProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,13 +54,10 @@ public class BvbProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -33,6 +35,11 @@ public class DingProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "www.ding-ulm.de";
|
||||
private final static String API_BASE = "http://www.ding-ulm.de/ding2/"; // http://www.ding.eu/swu
|
||||
|
||||
public DingProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,13 +54,10 @@ public class DingProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,6 +34,11 @@ public class DubProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "wojhati.rta.ae";
|
||||
private final static String API_BASE = "http://wojhati.rta.ae/dub/";
|
||||
|
||||
public DubProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -54,15 +59,6 @@ public class DubProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,10 +17,12 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -38,7 +40,7 @@ public class GvhProvider extends AbstractEfaProvider
|
|||
|
||||
public GvhProvider(final String additionalQueryParameter)
|
||||
{
|
||||
super(additionalQueryParameter);
|
||||
super(API_BASE, additionalQueryParameter);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -55,13 +57,10 @@ public class GvhProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
private static final String NEARBY_STATION_URI = API_BASE
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -33,6 +35,11 @@ public class IvbProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "efa.ivb.at";
|
||||
private final static String API_BASE = "http://efa.ivb.at/ivb/";
|
||||
|
||||
public IvbProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,13 +54,10 @@ public class IvbProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -16,9 +16,11 @@
|
|||
*/
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -32,6 +34,11 @@ public class KvvProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "213.144.24.66";
|
||||
private final static String API_BASE = "http://213.144.24.66/kvv/";
|
||||
|
||||
public KvvProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,13 +53,10 @@ public class KvvProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,6 +34,11 @@ public class LinzProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "www.linzag.at";
|
||||
public static final String API_BASE = "http://www.linzag.at/linz/";
|
||||
|
||||
public LinzProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -48,15 +53,6 @@ public class LinzProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
private static final String NEARBY_LATLON_URI = API_BASE
|
||||
+ "XSLT_DM_REQUEST"
|
||||
+ "?outputFormat=XML&mode=direct&coordOutputFormat=WGS84&mergeDep=1&useAllStops=1&name_dm=%2.6f:%2.6f:WGS84&type_dm=coord&itOptionsActive=1&ptOptionsActive=1&useProxFootSearch=1&excludedMeans=checkbox";
|
||||
|
|
|
@ -32,6 +32,11 @@ public class MariborProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "164.8.32.183";
|
||||
private final static String API_BASE = "http://164.8.32.183/slo/";
|
||||
|
||||
public MariborProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,15 +51,6 @@ public class MariborProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -33,6 +35,11 @@ public class MetProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.MET;
|
||||
private final static String API_BASE = "http://jp.metlinkmelbourne.com.au/metlink/";
|
||||
|
||||
public MetProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -53,13 +60,10 @@ public class MetProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,10 +17,12 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -36,6 +38,11 @@ public class MvvProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "efa.mvv-muenchen.de";
|
||||
private static final String API_BASE = "http://efa.mvv-muenchen.de/mobile/";
|
||||
|
||||
public MvvProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -50,13 +57,10 @@ public class MvvProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,11 @@ public class NaldoProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "efa.naldo.de";
|
||||
private final static String API_BASE = "http://efa.naldo.de/naldo/";
|
||||
|
||||
public NaldoProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,15 +51,6 @@ public class NaldoProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -32,6 +34,11 @@ public class NvbwProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.NVBW;
|
||||
private final static String API_BASE = "http://www.efa-bw.de/nvbw/";
|
||||
|
||||
public NvbwProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,13 +53,10 @@ public class NvbwProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -33,6 +35,11 @@ public class SfProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.SF;
|
||||
private final static String API_BASE = "http://tripplanner.transit.511.org/mtc/";
|
||||
|
||||
public SfProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -68,13 +75,10 @@ public class SfProvider extends AbstractEfaProvider
|
|||
return super.parseLine(mot, name, longName, noTrainName);
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,11 @@ public class StvProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "fahrplan.verbundlinie.at";
|
||||
private final static String API_BASE = "http://fahrplan.verbundlinie.at/stv/";
|
||||
|
||||
public StvProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,15 +51,6 @@ public class StvProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -32,6 +32,11 @@ public class SvvProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "efa.svv-info.at";
|
||||
private final static String API_BASE = "http://efa.svv-info.at/svv/";
|
||||
|
||||
public SvvProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,15 +51,6 @@ public class SvvProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -33,6 +35,11 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.SYDNEY;
|
||||
private final static String API_BASE = "http://mobile.131500.com.au/TripPlanner/mobile/";
|
||||
|
||||
public SydneyProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -53,13 +60,10 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,10 +17,12 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.TimeZone;
|
||||
|
||||
|
@ -37,6 +39,11 @@ public class TflProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "journeyplanner.tfl.gov.uk";
|
||||
private static final String API_BASE = "http://journeyplanner.tfl.gov.uk/user/";
|
||||
|
||||
public TflProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -57,13 +64,10 @@ public class TflProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
private static final String NEARBY_STATION_URI = API_BASE
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -34,6 +36,11 @@ public class TleaProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "www.travelineeastanglia.org.uk";
|
||||
private final static String API_BASE = "http://www.travelineeastanglia.org.uk/ea/";
|
||||
|
||||
public TleaProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -54,13 +61,10 @@ public class TleaProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -34,6 +36,11 @@ public class TlemProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "www.travelineeastmidlands.co.uk";
|
||||
private final static String API_BASE = "http://www.travelineeastmidlands.co.uk/em/";
|
||||
|
||||
public TlemProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -54,13 +61,10 @@ public class TlemProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -34,6 +36,11 @@ public class TlseProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "www.travelinesoutheast.org.uk";
|
||||
private final static String API_BASE = "http://www.travelinesoutheast.org.uk/se/";
|
||||
|
||||
public TlseProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -54,13 +61,10 @@ public class TlseProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
import java.util.TimeZone;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
@ -33,6 +35,11 @@ public class TlswProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.TLSW;
|
||||
private final static String API_BASE = "http://www.travelinesw.com/swe/";
|
||||
|
||||
public TlswProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -53,13 +60,10 @@ public class TlswProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -32,6 +32,11 @@ public class VagfrProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.VAGFR;
|
||||
private final static String API_BASE = "http://efa.vag-freiburg.de/vagfr/";
|
||||
|
||||
public VagfrProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,15 +51,6 @@ public class VagfrProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -32,6 +34,11 @@ public class VblProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.VBL;
|
||||
private final static String API_BASE = "http://mobil.vbl.ch/vblmobil/";
|
||||
|
||||
public VblProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,13 +53,10 @@ public class VblProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -33,6 +35,11 @@ public class VmsProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "www.vms-aktuell.de";
|
||||
private static final String API_BASE = "http://www.vms-aktuell.de/vms/";
|
||||
|
||||
public VmsProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,13 +54,10 @@ public class VmsProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -34,6 +34,11 @@ public class VmvProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "80.146.180.107";
|
||||
private static final String API_BASE = "http://80.146.180.107/delfi/"; // http://80.146.180.107/vmv/
|
||||
|
||||
public VmvProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -48,15 +53,6 @@ public class VmvProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -33,6 +35,11 @@ public class VorProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "efa.vor.at";
|
||||
private final static String API_BASE = "http://efa.vor.at/wvb/";
|
||||
|
||||
public VorProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,13 +54,10 @@ public class VorProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -33,6 +35,11 @@ public class VrnProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "fahrplanauskunft.vrn.de";
|
||||
private static final String API_BASE = "http://fahrplanauskunft.vrn.de/vrn_mobile/";
|
||||
|
||||
public VrnProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,13 +54,10 @@ public class VrnProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,10 +17,12 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.HashMap;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Map;
|
||||
|
||||
|
@ -35,8 +37,12 @@ public class VrrProvider extends AbstractEfaProvider
|
|||
{
|
||||
public static final NetworkId NETWORK_ID = NetworkId.VRR;
|
||||
public static final String OLD_NETWORK_ID = "efa3.vrr.de";
|
||||
// private static final String API_BASE = "http://efa3.vrr.de/vrr_mobile/";
|
||||
private static final String API_BASE = "http://efa.vrr.de/standard/";
|
||||
private static final String API_BASE = "http://app.vrr.de/standard/";
|
||||
|
||||
public VrrProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
|
@ -52,13 +58,10 @@ public class VrrProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
private static final String NEARBY_LATLON_URI = API_BASE
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -32,6 +34,11 @@ public class VrtProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.VRT;
|
||||
private final static String API_BASE = "http://efa9.vrn.de/vrt/";
|
||||
|
||||
public VrtProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,13 +53,10 @@ public class VrtProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.util.ParserUtils;
|
||||
|
@ -32,6 +34,11 @@ public class VvmProvider extends AbstractEfaProvider
|
|||
public static final NetworkId NETWORK_ID = NetworkId.VVM;
|
||||
private final static String API_BASE = "http://efa.mobilitaetsverbund.de/web/";
|
||||
|
||||
public VvmProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -46,13 +53,10 @@ public class VvmProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&locationServerActive=1&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -33,6 +33,11 @@ public class VvoProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "efa.vvo-online.de";
|
||||
private final static String API_BASE = "http://efa.vvo-online.de:8080/dvb/";
|
||||
|
||||
public VvoProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -47,15 +52,6 @@ public class VvoProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
}
|
||||
|
||||
@Override
|
||||
protected String nearbyLatLonUri(final int lat, final int lon)
|
||||
{
|
||||
|
|
|
@ -17,9 +17,11 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
import java.text.DateFormat;
|
||||
import java.text.SimpleDateFormat;
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
|
@ -34,6 +36,11 @@ public class VvsProvider extends AbstractEfaProvider
|
|||
public static final String OLD_NETWORK_ID = "mobil.vvs.de";
|
||||
private static final String API_BASE = "http://mobil.vvs.de/mobile/"; // http://www2.vvs.de/vvs/
|
||||
|
||||
public VvsProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
{
|
||||
return NETWORK_ID;
|
||||
|
@ -48,13 +55,10 @@ public class VvsProvider extends AbstractEfaProvider
|
|||
return false;
|
||||
}
|
||||
|
||||
private static final String AUTOCOMPLETE_URI = API_BASE
|
||||
+ "XSLT_TRIP_REQUEST2?outputFormat=XML&coordOutputFormat=WGS84&type_origin=any&name_origin=%s";
|
||||
|
||||
@Override
|
||||
protected String autocompleteUri(final CharSequence constraint)
|
||||
public List<Location> autocompleteStations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return String.format(AUTOCOMPLETE_URI, ParserUtils.urlEncode(constraint.toString(), "ISO-8859-1"));
|
||||
return xmlStopfinderRequest(constraint);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.AtcProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class AtcProviderLiveTest
|
|||
{
|
||||
private final AtcProvider provider = new AtcProvider();
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Bologna");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.AvvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class AvvProviderLiveTest
|
|||
{
|
||||
private final AvvProvider provider = new AvvProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.BsagProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
||||
/**
|
||||
|
@ -29,6 +32,22 @@ public class BsagProviderLiveTest
|
|||
{
|
||||
private final BsagProvider provider = new BsagProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
58
test/de/schildbach/pte/live/BsvagProviderLiveTest.java
Normal file
58
test/de/schildbach/pte/live/BsvagProviderLiveTest.java
Normal file
|
@ -0,0 +1,58 @@
|
|||
/*
|
||||
* Copyright 2010, 2011 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.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.BsvagProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public class BsvagProviderLiveTest
|
||||
{
|
||||
private final BsvagProvider provider = new BsvagProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Braunschweig", 0, 0, 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
}
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.BvbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class BvbProviderLiveTest
|
|||
{
|
||||
private final BvbProvider provider = new BvbProvider();
|
||||
|
||||
@Test
|
||||
public void autocomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Basel");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.DingProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class DingProviderLiveTest
|
|||
{
|
||||
private final DingProvider provider = new DingProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
49
test/de/schildbach/pte/live/DubProviderLiveTest.java
Normal file
49
test/de/schildbach/pte/live/DubProviderLiveTest.java
Normal file
|
@ -0,0 +1,49 @@
|
|||
/*
|
||||
* Copyright 2010, 2011 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.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.DubProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public class DubProviderLiveTest
|
||||
{
|
||||
private final DubProvider provider = new DubProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Airport");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
}
|
67
test/de/schildbach/pte/live/IvbProviderLiveTest.java
Normal file
67
test/de/schildbach/pte/live/IvbProviderLiveTest.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright 2010, 2011 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.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.IvbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public class IvbProviderLiveTest
|
||||
{
|
||||
private final IvbProvider provider = new IvbProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Innsbruck", 0, 0, 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("60464209", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@
|
|||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
|
@ -37,6 +38,22 @@ public class KvvProviderLiveTest
|
|||
private final KvvProvider provider = new KvvProvider();
|
||||
private static final String ALL_PRODUCTS = "IRSUTBFC";
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.MariborProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class MariborProviderLiveTest
|
|||
{
|
||||
private final MariborProvider provider = new MariborProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.MetProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class MetProviderLiveTest
|
|||
{
|
||||
private final MetProvider provider = new MetProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.NaldoProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class NaldoProviderLiveTest
|
|||
{
|
||||
private final NaldoProvider provider = new NaldoProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.NvbwProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class NvbwProviderLiveTest
|
|||
{
|
||||
private final NvbwProvider provider = new NvbwProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.SfProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class SfProviderLiveTest
|
|||
{
|
||||
private final SfProvider provider = new SfProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.StvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class StvProviderLiveTest
|
|||
{
|
||||
private final StvProvider provider = new StvProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.SvvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class SvvProviderLiveTest
|
|||
{
|
||||
private final SvvProvider provider = new SvvProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.SydneyProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class SydneyProviderLiveTest
|
|||
{
|
||||
private final SydneyProvider provider = new SydneyProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -18,11 +18,12 @@
|
|||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.TflProvider;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.TflProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
|
@ -37,6 +38,22 @@ public class TflProviderLiveTest
|
|||
private final TflProvider provider = new TflProvider();
|
||||
private static final String ALL_PRODUCTS = "IRSUTBFC";
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
67
test/de/schildbach/pte/live/TleaProviderLiveTest.java
Normal file
67
test/de/schildbach/pte/live/TleaProviderLiveTest.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright 2010, 2011 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.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.TleaProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public class TleaProviderLiveTest
|
||||
{
|
||||
private final TleaProvider provider = new TleaProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("London", 0, 0, 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("London", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
}
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.TlemProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class TlemProviderLiveTest
|
|||
{
|
||||
private final TlemProvider provider = new TlemProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
67
test/de/schildbach/pte/live/TlseProviderLiveTest.java
Normal file
67
test/de/schildbach/pte/live/TlseProviderLiveTest.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright 2010, 2011 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.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.TlseProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public class TlseProviderLiveTest
|
||||
{
|
||||
private final TlseProvider provider = new TlseProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("London", 0, 0, 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("London", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
}
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.TlswProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class TlswProviderLiveTest
|
|||
{
|
||||
private final TlswProvider provider = new TlswProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VagfrProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class VagfrProviderLiveTest
|
|||
{
|
||||
private final VagfrProvider provider = new VagfrProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VblProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class VblProviderLiveTest
|
|||
{
|
||||
private final VblProvider provider = new VblProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VmsProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class VmsProviderLiveTest
|
|||
{
|
||||
private final VmsProvider provider = new VmsProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VmvProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class VmvProviderLiveTest
|
|||
{
|
||||
private final VmvProvider provider = new VmvProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
67
test/de/schildbach/pte/live/VorProviderLiveTest.java
Normal file
67
test/de/schildbach/pte/live/VorProviderLiveTest.java
Normal file
|
@ -0,0 +1,67 @@
|
|||
/*
|
||||
* Copyright 2010, 2011 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.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VorProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public class VorProviderLiveTest
|
||||
{
|
||||
private final VorProvider provider = new VorProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
final NearbyStationsResult result = provider.nearbyStations("Bad Vöslau", 0, 0, 0, 0);
|
||||
|
||||
System.out.println(result.stations.size() + " " + result.stations);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryDepartures() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = provider.queryDepartures("Bad Vöslau", 0, false);
|
||||
|
||||
System.out.println(result.stationDepartures);
|
||||
}
|
||||
}
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VrtProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class VrtProviderLiveTest
|
|||
{
|
||||
private final VrtProvider provider = new VrtProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VvmProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class VvmProviderLiveTest
|
|||
{
|
||||
private final VvmProvider provider = new VvmProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VvoProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class VvoProviderLiveTest
|
|||
{
|
||||
private final VvoProvider provider = new VvoProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
|
@ -17,9 +17,12 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.VvsProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
|
||||
|
@ -30,6 +33,22 @@ public class VvsProviderLiveTest
|
|||
{
|
||||
private final VvsProvider provider = new VvsProvider();
|
||||
|
||||
@Test
|
||||
public void autocompleteIncomplete() throws Exception
|
||||
{
|
||||
final List<Location> autocompletes = provider.autocompleteStations("Kur");
|
||||
|
||||
list(autocompletes);
|
||||
}
|
||||
|
||||
private void list(final List<Location> autocompletes)
|
||||
{
|
||||
System.out.print(autocompletes.size() + " ");
|
||||
for (final Location autocomplete : autocompletes)
|
||||
System.out.print(autocomplete.toDebugString() + " ");
|
||||
System.out.println();
|
||||
}
|
||||
|
||||
@Test
|
||||
public void nearbyStation() throws Exception
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue