mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-16 01:19:49 +00:00
prepare for multiple stations per queryDepartures call
git-svn-id: https://public-transport-enabler.googlecode.com/svn/trunk@487 0924bc21-9374-b0fa-ee44-9ff1593b38f0
This commit is contained in:
parent
39fe5d52df
commit
5fe5f9f4e1
47 changed files with 260 additions and 113 deletions
|
@ -43,6 +43,7 @@ import de.schildbach.pte.dto.Fare;
|
||||||
import de.schildbach.pte.dto.Fare.Type;
|
import de.schildbach.pte.dto.Fare.Type;
|
||||||
import de.schildbach.pte.dto.GetConnectionDetailsResult;
|
import de.schildbach.pte.dto.GetConnectionDetailsResult;
|
||||||
import de.schildbach.pte.dto.Line;
|
import de.schildbach.pte.dto.Line;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.dto.Location;
|
import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||||
|
@ -957,11 +958,13 @@ public abstract class AbstractEfaProvider implements NetworkProvider
|
||||||
XmlPullUtil.exit(pp, "itdDepartureList");
|
XmlPullUtil.exit(pp, "itdDepartureList");
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(location, departures, lines);
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
result.stationDepartures.add(new StationDepartures(location, departures, lines));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else if ("notidentified".equals(nameState))
|
else if ("notidentified".equals(nameState))
|
||||||
{
|
{
|
||||||
return new QueryDeparturesResult(QueryDeparturesResult.Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(QueryDeparturesResult.Status.INVALID_STATION);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,7 @@ import de.schildbach.pte.dto.NearbyStationsResult;
|
||||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.Station;
|
import de.schildbach.pte.dto.Station;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.exception.SessionExpiredException;
|
import de.schildbach.pte.exception.SessionExpiredException;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
|
@ -453,9 +454,13 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
|
// scrape page
|
||||||
final String uri = departuresQueryUri(stationId, maxDepartures);
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
final CharSequence page = ParserUtils.scrape(uri);
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
|
// parse page
|
||||||
final Matcher mMessage = P_DEPARTURES_MESSAGES.matcher(page);
|
final Matcher mMessage = P_DEPARTURES_MESSAGES.matcher(page);
|
||||||
if (mMessage.find())
|
if (mMessage.find())
|
||||||
{
|
{
|
||||||
|
@ -463,10 +468,13 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
final String text = mMessage.group(2);
|
final String text = mMessage.group(2);
|
||||||
|
|
||||||
if (code.equals("H730")) // Your input is not valid
|
if (code.equals("H730")) // Your input is not valid
|
||||||
return new QueryDeparturesResult(QueryDeparturesResult.Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(QueryDeparturesResult.Status.INVALID_STATION);
|
||||||
if (code.equals("H890")) // No trains in result
|
if (code.equals("H890"))
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId)),
|
{
|
||||||
Collections.<Departure> emptyList(), null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId)), Collections
|
||||||
|
.<Departure> emptyList(), null));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
throw new IllegalArgumentException("unknown error " + code + ", " + text);
|
throw new IllegalArgumentException("unknown error " + code + ", " + text);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -510,7 +518,8 @@ public final class BahnProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId)), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId)), departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -41,6 +41,7 @@ import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
import de.schildbach.pte.dto.Station;
|
import de.schildbach.pte.dto.Station;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.exception.SessionExpiredException;
|
import de.schildbach.pte.exception.SessionExpiredException;
|
||||||
import de.schildbach.pte.util.Color;
|
import de.schildbach.pte.util.Color;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
@ -630,8 +631,11 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
if (stationId.length() == 6) // live
|
if (stationId.length() == 6) // live
|
||||||
{
|
{
|
||||||
|
// scrape page
|
||||||
final String uri = departuresQueryLiveUri(stationId);
|
final String uri = departuresQueryLiveUri(stationId);
|
||||||
final CharSequence page = ParserUtils.scrape(uri);
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
|
@ -639,9 +643,9 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
if (mError.find())
|
if (mError.find())
|
||||||
{
|
{
|
||||||
if (mError.group(1) != null)
|
if (mError.group(1) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
if (mError.group(2) != null)
|
if (mError.group(2) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
if (mError.group(3) != null)
|
if (mError.group(3) != null)
|
||||||
throw new IOException("connected to private wlan");
|
throw new IOException("connected to private wlan");
|
||||||
}
|
}
|
||||||
|
@ -699,7 +703,9 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -708,6 +714,7 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// scrape page
|
||||||
final String uri = departuresQueryPlanUri(stationId, maxDepartures);
|
final String uri = departuresQueryPlanUri(stationId, maxDepartures);
|
||||||
final CharSequence page = ParserUtils.scrape(uri);
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
|
@ -715,9 +722,9 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
if (mError.find())
|
if (mError.find())
|
||||||
{
|
{
|
||||||
if (mError.group(1) != null)
|
if (mError.group(1) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
if (mError.group(2) != null)
|
if (mError.group(2) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
if (mError.group(3) != null)
|
if (mError.group(3) != null)
|
||||||
throw new IOException("connected to private wlan");
|
throw new IOException("connected to private wlan");
|
||||||
}
|
}
|
||||||
|
@ -768,7 +775,9 @@ public final class BvgProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,6 +34,7 @@ import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -155,6 +156,8 @@ public class InvgProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
// scrape page
|
// scrape page
|
||||||
final String uri = departuresQueryUri(stationId, maxDepartures);
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
final CharSequence page = ParserUtils.scrape(uri);
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
@ -165,12 +168,15 @@ public class InvgProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
// messages
|
// messages
|
||||||
if (mHeadCoarse.group(4) != null)
|
if (mHeadCoarse.group(4) != null)
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId)),
|
{
|
||||||
Collections.<Departure> emptyList(), null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId)), Collections
|
||||||
|
.<Departure> emptyList(), null));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
else if (mHeadCoarse.group(5) != null)
|
else if (mHeadCoarse.group(5) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
else if (mHeadCoarse.group(6) != null)
|
else if (mHeadCoarse.group(6) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
|
|
||||||
final int locationId = Integer.parseInt(mHeadCoarse.group(2));
|
final int locationId = Integer.parseInt(mHeadCoarse.group(2));
|
||||||
|
|
||||||
|
@ -240,7 +246,9 @@ public class InvgProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
final String[] nameAndPlace = splitNameAndPlace(location);
|
final String[] nameAndPlace = splitNameAndPlace(location);
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, nameAndPlace[0], nameAndPlace[1]), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, locationId, nameAndPlace[0], nameAndPlace[1]),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,6 +36,7 @@ import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -134,8 +135,11 @@ public class NasaProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
// scrape page
|
// scrape page
|
||||||
final CharSequence page = ParserUtils.scrape(departuresQueryUri(stationId, maxDepartures));
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
// parse page
|
// parse page
|
||||||
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
||||||
|
@ -143,12 +147,15 @@ public class NasaProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
// messages
|
// messages
|
||||||
if (mHeadCoarse.group(3) != null)
|
if (mHeadCoarse.group(3) != null)
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId)),
|
{
|
||||||
Collections.<Departure> emptyList(), null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId)), Collections
|
||||||
|
.<Departure> emptyList(), null));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
else if (mHeadCoarse.group(4) != null)
|
else if (mHeadCoarse.group(4) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
else if (mHeadCoarse.group(5) != null)
|
else if (mHeadCoarse.group(5) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
|
|
||||||
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(mHeadCoarse.group(1));
|
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(mHeadCoarse.group(1));
|
||||||
if (mHeadFine.matches())
|
if (mHeadFine.matches())
|
||||||
|
@ -215,7 +222,9 @@ public class NasaProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,7 @@ import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,7 +109,11 @@ public class NsProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
final CharSequence page = ParserUtils.scrape(departuresQueryUri(stationId, maxDepartures));
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
|
// scrape page
|
||||||
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
// parse page
|
// parse page
|
||||||
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
||||||
|
@ -116,9 +121,9 @@ public class NsProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
// messages
|
// messages
|
||||||
if (mHeadCoarse.group(3) != null)
|
if (mHeadCoarse.group(3) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
else if (mHeadCoarse.group(4) != null)
|
else if (mHeadCoarse.group(4) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
|
|
||||||
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(mHeadCoarse.group(1));
|
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(mHeadCoarse.group(1));
|
||||||
if (mHeadFine.matches())
|
if (mHeadFine.matches())
|
||||||
|
@ -161,7 +166,9 @@ public class NsProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -40,6 +40,7 @@ import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.exception.SessionExpiredException;
|
import de.schildbach.pte.exception.SessionExpiredException;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
|
@ -530,14 +531,18 @@ public class OebbProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
// scrape page
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
final String page = ParserUtils.scrape(departuresQueryUri(stationId, maxDepartures)).toString().substring(14);
|
|
||||||
|
|
||||||
|
// scrape page
|
||||||
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
|
final String page = ParserUtils.scrape(uri).toString().substring(14);
|
||||||
|
|
||||||
|
// parse page
|
||||||
final Matcher mError = P_DEPARTURES_ERROR.matcher(page);
|
final Matcher mError = P_DEPARTURES_ERROR.matcher(page);
|
||||||
if (mError.find())
|
if (mError.find())
|
||||||
{
|
{
|
||||||
if (mError.group(1) != null)
|
if (mError.group(1) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
}
|
}
|
||||||
|
|
||||||
try
|
try
|
||||||
|
@ -547,7 +552,7 @@ public class OebbProvider extends AbstractHafasProvider
|
||||||
final int locationId = head.optInt("stationEvaId", -1);
|
final int locationId = head.optInt("stationEvaId", -1);
|
||||||
// final boolean rt = head.optBoolean("rtInfo");
|
// final boolean rt = head.optBoolean("rtInfo");
|
||||||
if (locationId == -1)
|
if (locationId == -1)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
|
|
||||||
final List<Departure> departures = new ArrayList<Departure>(8);
|
final List<Departure> departures = new ArrayList<Departure>(8);
|
||||||
|
|
||||||
|
@ -575,7 +580,8 @@ public class OebbProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, locationId, null, location), departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
catch (final JSONException x)
|
catch (final JSONException x)
|
||||||
{
|
{
|
||||||
|
|
|
@ -38,6 +38,7 @@ import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -465,7 +466,11 @@ public class RmvProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
final CharSequence page = ParserUtils.scrape(departuresQueryUri(stationId, maxDepartures));
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
|
// scrape page
|
||||||
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
// parse page
|
// parse page
|
||||||
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
||||||
|
@ -473,9 +478,9 @@ public class RmvProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
// messages
|
// messages
|
||||||
if (mHeadCoarse.group(4) != null)
|
if (mHeadCoarse.group(4) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
else if (mHeadCoarse.group(5) != null)
|
else if (mHeadCoarse.group(5) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
|
|
||||||
final int locationId = Integer.parseInt(mHeadCoarse.group(3));
|
final int locationId = Integer.parseInt(mHeadCoarse.group(3));
|
||||||
|
|
||||||
|
@ -536,7 +541,9 @@ public class RmvProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
|
|
||||||
final String[] nameAndPlace = splitNameAndPlace(location);
|
final String[] nameAndPlace = splitNameAndPlace(location);
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, nameAndPlace[0], nameAndPlace[1]), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, locationId, nameAndPlace[0], nameAndPlace[1]),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -32,6 +32,7 @@ import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,6 +116,9 @@ public class SbbProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
|
// scrape page
|
||||||
final String uri = departuresQueryUri(stationId, maxDepartures);
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
final CharSequence page = ParserUtils.scrape(uri);
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
|
@ -124,12 +128,15 @@ public class SbbProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
// messages
|
// messages
|
||||||
if (mHeadCoarse.group(3) != null)
|
if (mHeadCoarse.group(3) != null)
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId)),
|
{
|
||||||
Collections.<Departure> emptyList(), null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId)), Collections
|
||||||
|
.<Departure> emptyList(), null));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
else if (mHeadCoarse.group(5) != null)
|
else if (mHeadCoarse.group(5) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
else if (mHeadCoarse.group(6) != null)
|
else if (mHeadCoarse.group(6) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
|
|
||||||
final String head = mHeadCoarse.group(1) + mHeadCoarse.group(4);
|
final String head = mHeadCoarse.group(1) + mHeadCoarse.group(4);
|
||||||
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(head);
|
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(head);
|
||||||
|
@ -182,7 +189,8 @@ public class SbbProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, locationId, null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, locationId, null, location), departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -34,6 +34,7 @@ import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -154,6 +155,8 @@ public class SeptaProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
// scrape page
|
// scrape page
|
||||||
final String uri = departuresQueryUri(stationId, maxDepartures);
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
final CharSequence page = ParserUtils.scrape(uri);
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
@ -164,12 +167,15 @@ public class SeptaProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
// messages
|
// messages
|
||||||
if (mPageCoarse.group(5) != null)
|
if (mPageCoarse.group(5) != null)
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId)),
|
{
|
||||||
Collections.<Departure> emptyList(), null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId)), Collections
|
||||||
|
.<Departure> emptyList(), null));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
else if (mPageCoarse.group(6) != null)
|
else if (mPageCoarse.group(6) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
else if (mPageCoarse.group(7) != null)
|
else if (mPageCoarse.group(7) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
|
|
||||||
final String location = ParserUtils.resolveEntities(mPageCoarse.group(1));
|
final String location = ParserUtils.resolveEntities(mPageCoarse.group(1));
|
||||||
final Date currentTime = ParserUtils.joinDateTime(ParserUtils.parseAmericanDate(mPageCoarse.group(2)),
|
final Date currentTime = ParserUtils.joinDateTime(ParserUtils.parseAmericanDate(mPageCoarse.group(2)),
|
||||||
|
@ -234,7 +240,9 @@ public class SeptaProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -31,6 +31,7 @@ import de.schildbach.pte.dto.Location;
|
||||||
import de.schildbach.pte.dto.LocationType;
|
import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -108,7 +109,11 @@ public class SncbProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
final CharSequence page = ParserUtils.scrape(departuresQueryUri(stationId, maxDepartures));
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
|
// scrape page
|
||||||
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
// parse page
|
// parse page
|
||||||
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
||||||
|
@ -116,9 +121,9 @@ public class SncbProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
// messages
|
// messages
|
||||||
if (mHeadCoarse.group(3) != null)
|
if (mHeadCoarse.group(3) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
else if (mHeadCoarse.group(4) != null)
|
else if (mHeadCoarse.group(4) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
|
|
||||||
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(mHeadCoarse.group(1));
|
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(mHeadCoarse.group(1));
|
||||||
if (mHeadFine.matches())
|
if (mHeadFine.matches())
|
||||||
|
@ -161,7 +166,9 @@ public class SncbProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -36,6 +36,7 @@ import de.schildbach.pte.dto.LocationType;
|
||||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||||
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
import de.schildbach.pte.dto.QueryDeparturesResult.Status;
|
||||||
|
import de.schildbach.pte.dto.StationDepartures;
|
||||||
import de.schildbach.pte.util.ParserUtils;
|
import de.schildbach.pte.util.ParserUtils;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -133,8 +134,11 @@ public class VgsProvider extends AbstractHafasProvider
|
||||||
|
|
||||||
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
public QueryDeparturesResult queryDepartures(final String stationId, final int maxDepartures) throws IOException
|
||||||
{
|
{
|
||||||
|
final QueryDeparturesResult result = new QueryDeparturesResult();
|
||||||
|
|
||||||
// scrape page
|
// scrape page
|
||||||
final CharSequence page = ParserUtils.scrape(departuresQueryUri(stationId, maxDepartures));
|
final String uri = departuresQueryUri(stationId, maxDepartures);
|
||||||
|
final CharSequence page = ParserUtils.scrape(uri);
|
||||||
|
|
||||||
// parse page
|
// parse page
|
||||||
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
final Matcher mHeadCoarse = P_DEPARTURES_HEAD_COARSE.matcher(page);
|
||||||
|
@ -142,12 +146,15 @@ public class VgsProvider extends AbstractHafasProvider
|
||||||
{
|
{
|
||||||
// messages
|
// messages
|
||||||
if (mHeadCoarse.group(3) != null)
|
if (mHeadCoarse.group(3) != null)
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId)),
|
{
|
||||||
Collections.<Departure> emptyList(), null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId)), Collections
|
||||||
|
.<Departure> emptyList(), null));
|
||||||
|
return result;
|
||||||
|
}
|
||||||
else if (mHeadCoarse.group(4) != null)
|
else if (mHeadCoarse.group(4) != null)
|
||||||
return new QueryDeparturesResult(Status.INVALID_STATION, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.INVALID_STATION);
|
||||||
else if (mHeadCoarse.group(5) != null)
|
else if (mHeadCoarse.group(5) != null)
|
||||||
return new QueryDeparturesResult(Status.SERVICE_DOWN, Integer.parseInt(stationId));
|
return new QueryDeparturesResult(Status.SERVICE_DOWN);
|
||||||
|
|
||||||
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(mHeadCoarse.group(1));
|
final Matcher mHeadFine = P_DEPARTURES_HEAD_FINE.matcher(mHeadCoarse.group(1));
|
||||||
if (mHeadFine.matches())
|
if (mHeadFine.matches())
|
||||||
|
@ -214,7 +221,9 @@ public class VgsProvider extends AbstractHafasProvider
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return new QueryDeparturesResult(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location), departures, null);
|
result.stationDepartures.add(new StationDepartures(new Location(LocationType.STATION, Integer.parseInt(stationId), null, location),
|
||||||
|
departures, null));
|
||||||
|
return result;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
|
|
||||||
package de.schildbach.pte.dto;
|
package de.schildbach.pte.dto;
|
||||||
|
|
||||||
|
import java.util.LinkedList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -30,24 +31,16 @@ public final class QueryDeparturesResult
|
||||||
}
|
}
|
||||||
|
|
||||||
public final Status status;
|
public final Status status;
|
||||||
public final Location location;
|
public final List<StationDepartures> stationDepartures = new LinkedList<StationDepartures>();
|
||||||
public final List<Departure> departures;
|
|
||||||
public final List<Line> lines;
|
|
||||||
|
|
||||||
public QueryDeparturesResult(final Location location, final List<Departure> departures, final List<Line> lines)
|
public QueryDeparturesResult()
|
||||||
{
|
{
|
||||||
this.status = Status.OK;
|
this.status = Status.OK;
|
||||||
this.location = location;
|
|
||||||
this.departures = departures;
|
|
||||||
this.lines = lines;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public QueryDeparturesResult(final Status status, final int locationId)
|
public QueryDeparturesResult(final Status status)
|
||||||
{
|
{
|
||||||
this.status = status;
|
this.status = status;
|
||||||
this.location = new Location(LocationType.STATION, locationId);
|
|
||||||
this.departures = null;
|
|
||||||
this.lines = null;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -55,10 +48,7 @@ public final class QueryDeparturesResult
|
||||||
{
|
{
|
||||||
final StringBuilder builder = new StringBuilder(getClass().getName());
|
final StringBuilder builder = new StringBuilder(getClass().getName());
|
||||||
builder.append("[").append(this.status);
|
builder.append("[").append(this.status);
|
||||||
if (location != null)
|
builder.append(" ").append(stationDepartures);
|
||||||
builder.append(" ").append(location.toDebugString());
|
|
||||||
if (departures != null)
|
|
||||||
builder.append(" ").append(departures.size()).append(" departures");
|
|
||||||
builder.append("]");
|
builder.append("]");
|
||||||
return builder.toString();
|
return builder.toString();
|
||||||
}
|
}
|
||||||
|
|
50
src/de/schildbach/pte/dto/StationDepartures.java
Normal file
50
src/de/schildbach/pte/dto/StationDepartures.java
Normal file
|
@ -0,0 +1,50 @@
|
||||||
|
/*
|
||||||
|
* Copyright 2010 the original author or authors.
|
||||||
|
*
|
||||||
|
* This program is free software: you can redistribute it and/or modify
|
||||||
|
* it under the terms of the GNU General Public License as published by
|
||||||
|
* the Free Software Foundation, either version 3 of the License, or
|
||||||
|
* (at your option) any later version.
|
||||||
|
*
|
||||||
|
* This program is distributed in the hope that it will be useful,
|
||||||
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||||
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||||
|
* GNU General Public License for more details.
|
||||||
|
*
|
||||||
|
* You should have received a copy of the GNU General Public License
|
||||||
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package de.schildbach.pte.dto;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author Andreas Schildbach
|
||||||
|
*/
|
||||||
|
public final class StationDepartures
|
||||||
|
{
|
||||||
|
public final Location location;
|
||||||
|
public final List<Departure> departures;
|
||||||
|
public final List<Line> lines;
|
||||||
|
|
||||||
|
public StationDepartures(final Location location, final List<Departure> departures, final List<Line> lines)
|
||||||
|
{
|
||||||
|
this.location = location;
|
||||||
|
this.departures = departures;
|
||||||
|
this.lines = lines;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString()
|
||||||
|
{
|
||||||
|
final StringBuilder builder = new StringBuilder(getClass().getName());
|
||||||
|
builder.append("[");
|
||||||
|
if (location != null)
|
||||||
|
builder.append(location.toDebugString());
|
||||||
|
if (departures != null)
|
||||||
|
builder.append(" ").append(departures.size()).append(" departures");
|
||||||
|
builder.append("]");
|
||||||
|
return builder.toString();
|
||||||
|
}
|
||||||
|
}
|
|
@ -43,6 +43,6 @@ public class AtcProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("Bologna", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("Bologna", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class AvvProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("100", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("100", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -39,10 +39,11 @@ public class BahnProviderLiveTest
|
||||||
protected static final String ALL_PRODUCTS = "IRSUTBFC";
|
protected static final String ALL_PRODUCTS = "IRSUTBFC";
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void departures() throws Exception
|
public void queryDepartures() throws Exception
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult queryDepartures = provider.queryDepartures("692991", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("692991", 0);
|
||||||
System.out.println(queryDepartures.departures);
|
|
||||||
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class BvbProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("10000", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("10000", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -63,10 +63,11 @@ public class BvgProviderLiveTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void departures() throws Exception
|
public void queryDepartures() throws Exception
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult queryDepartures = provider.queryDepartures("309557", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("309557", 0);
|
||||||
System.out.println(queryDepartures.departures);
|
|
||||||
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class DingProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("Ulm", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("Ulm", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class InvgProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("80301", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("80301", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class KvvProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("119", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("119", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class MariborProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("63203067", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("63203067", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class MetProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("10001167", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("10001167", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class NaldoProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("53019174", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("53019174", 0);
|
||||||
|
|
||||||
System.out.println(result.location.toDebugString() + " " + result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class NasaProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("13000", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("13000", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class NsProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("100080", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("100080", 0);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -39,10 +39,10 @@ public class RmvProviderLiveTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void departures() throws Exception
|
public void queryDepartures() throws Exception
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult queryDepartures = provider.queryDepartures("3000001", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("3000001", 0);
|
||||||
|
|
||||||
System.out.println(queryDepartures.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -67,7 +67,7 @@ public class SbbProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("8500010", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("8500010", 0);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class SeptaProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("1000002", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("1000002", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class SfProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("10010813", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("10010813", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,7 +42,7 @@ public class SncbProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("100080", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("100080", 0);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class StvProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("Graz", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("Graz", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class SvvProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("60650002", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("60650002", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class TflProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("1000086", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("1000086", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class TlemProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("London", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("London", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class TlswProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("247616", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("247616", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class VblProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("717", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("717", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class VgsProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("8000244", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("8000244", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class VmsProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("Chemnitz", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("Chemnitz", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class VmvProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("6118", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("6118", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -81,10 +82,10 @@ public class VrnProviderLiveTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void departures() throws Exception
|
public void queryDepartures() throws Exception
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("6032236", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("6032236", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
@ -73,10 +74,10 @@ public class VrrProviderLiveTest
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void departures() throws Exception
|
public void queryDepartures() throws Exception
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("1007258", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("1007258", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class VrtProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("17001301", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("17001301", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -43,6 +43,6 @@ public class VvmProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("3000510", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("3000510", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class VvoProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("100", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("100", 0);
|
||||||
|
|
||||||
System.out.println(result.status + " " + result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -14,6 +14,7 @@
|
||||||
* You should have received a copy of the GNU General Public License
|
* You should have received a copy of the GNU General Public License
|
||||||
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
package de.schildbach.pte.live;
|
package de.schildbach.pte.live;
|
||||||
|
|
||||||
import org.junit.Test;
|
import org.junit.Test;
|
||||||
|
@ -42,6 +43,6 @@ public class VvsProviderLiveTest
|
||||||
{
|
{
|
||||||
final QueryDeparturesResult result = provider.queryDepartures("6118", 0);
|
final QueryDeparturesResult result = provider.queryDepartures("6118", 0);
|
||||||
|
|
||||||
System.out.println(result.departures.size() + " " + result.departures);
|
System.out.println(result.stationDepartures);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue