diff --git a/src/de/schildbach/pte/AbstractEfaProvider.java b/src/de/schildbach/pte/AbstractEfaProvider.java index 1de119d0..0987f8ba 100644 --- a/src/de/schildbach/pte/AbstractEfaProvider.java +++ b/src/de/schildbach/pte/AbstractEfaProvider.java @@ -17,6 +17,7 @@ package de.schildbach.pte; +import java.io.FileNotFoundException; import java.io.IOException; import java.io.StringReader; import java.util.ArrayList; @@ -34,9 +35,9 @@ import org.xmlpull.v1.XmlPullParserFactory; import de.schildbach.pte.dto.Autocomplete; import de.schildbach.pte.dto.Departure; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryDeparturesResult; import de.schildbach.pte.dto.Station; -import de.schildbach.pte.dto.QueryDeparturesResult.Status; import de.schildbach.pte.util.Color; import de.schildbach.pte.util.ParserUtils; import de.schildbach.pte.util.XmlPullUtil; @@ -88,7 +89,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider protected abstract String nearbyStationUri(String stationId); - public List nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) + public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException { String uri = null; @@ -104,7 +105,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider final CharSequence page = ParserUtils.scrape(uri); if (P_NEARBY_MESSAGES.matcher(page).find()) - return null; + return new NearbyStationsResult(uri, NearbyStationsResult.Status.SERVICE_DOWN); final XmlPullParserFactory factory = XmlPullParserFactory.newInstance(System.getProperty(XmlPullParserFactory.PROPERTY_NAME), null); final XmlPullParser pp = factory.newPullParser(); @@ -157,13 +158,13 @@ public abstract class AbstractEfaProvider implements NetworkProvider } if (maxStations == 0 || maxStations >= stations.size()) - return stations; + return new NearbyStationsResult(uri, stations); else - return stations.subList(0, maxStations); + return new NearbyStationsResult(uri, stations.subList(0, maxStations)); } else if (nameState.equals("notidentified")) { - return null; + return new NearbyStationsResult(uri, NearbyStationsResult.Status.INVALID_STATION); } else { @@ -174,6 +175,10 @@ public abstract class AbstractEfaProvider implements NetworkProvider { throw new RuntimeException(x); } + catch (final FileNotFoundException x) + { + return new NearbyStationsResult(uri, NearbyStationsResult.Status.SERVICE_DOWN); + } } private static final Pattern P_LINE_IRE = Pattern.compile("IRE\\d+"); @@ -497,7 +502,7 @@ public abstract class AbstractEfaProvider implements NetworkProvider } else if (nameState.equals("notidentified")) { - return new QueryDeparturesResult(uri, Status.INVALID_STATION); + return new QueryDeparturesResult(uri, QueryDeparturesResult.Status.INVALID_STATION); } else { diff --git a/src/de/schildbach/pte/AbstractHafasProvider.java b/src/de/schildbach/pte/AbstractHafasProvider.java index e1c6acd4..f6c63a28 100644 --- a/src/de/schildbach/pte/AbstractHafasProvider.java +++ b/src/de/schildbach/pte/AbstractHafasProvider.java @@ -25,6 +25,7 @@ import java.util.Map; import java.util.regex.Matcher; import java.util.regex.Pattern; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.Station; import de.schildbach.pte.util.Color; import de.schildbach.pte.util.ParserUtils; @@ -41,7 +42,7 @@ public abstract class AbstractHafasProvider implements NetworkProvider protected abstract String nearbyStationUri(String stationId); - public List nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) + public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException { if (stationId == null) @@ -89,9 +90,9 @@ public abstract class AbstractHafasProvider implements NetworkProvider } if (maxStations == 0 || maxStations >= stations.size()) - return stations; + return new NearbyStationsResult(uri, stations); else - return stations.subList(0, maxStations); + return new NearbyStationsResult(uri, stations.subList(0, maxStations)); } protected static final Pattern P_NORMALIZE_LINE = Pattern.compile("([A-Za-zÄÖÜäöüßáàâéèêíìîóòôúùû/-]+)[\\s-]*(.*)"); diff --git a/src/de/schildbach/pte/BahnProvider.java b/src/de/schildbach/pte/BahnProvider.java index 65438d08..f25b5994 100644 --- a/src/de/schildbach/pte/BahnProvider.java +++ b/src/de/schildbach/pte/BahnProvider.java @@ -34,6 +34,7 @@ import de.schildbach.pte.dto.Autocomplete; import de.schildbach.pte.dto.Connection; import de.schildbach.pte.dto.Departure; import de.schildbach.pte.dto.GetConnectionDetailsResult; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryConnectionsResult; import de.schildbach.pte.dto.QueryDeparturesResult; import de.schildbach.pte.dto.Station; @@ -89,7 +90,7 @@ public final class BahnProvider implements NetworkProvider private final static Pattern P_NEARBY_STATIONS = Pattern .compile("(.+?)"); - public List nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) + public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException { if (lat == 0 && lon == 0) @@ -97,9 +98,9 @@ public final class BahnProvider implements NetworkProvider final List stations = new ArrayList(); - final String url = API_BASE + "query.exe/dox" + "?performLocating=2&tpl=stopsnear&look_maxdist=" + (maxDistance > 0 ? maxDistance : 5000) + final String uri = API_BASE + "query.exe/dox" + "?performLocating=2&tpl=stopsnear&look_maxdist=" + (maxDistance > 0 ? maxDistance : 5000) + "&look_stopclass=1023" + "&look_x=" + lon + "&look_y=" + lat; - final CharSequence page = ParserUtils.scrape(url); + final CharSequence page = ParserUtils.scrape(uri); final Matcher m = P_NEARBY_STATIONS.matcher(page); while (m.find()) @@ -116,9 +117,9 @@ public final class BahnProvider implements NetworkProvider } if (maxStations == 0 || maxStations >= stations.size()) - return stations; + return new NearbyStationsResult(uri, stations); else - return stations.subList(0, maxStations); + return new NearbyStationsResult(uri, stations.subList(0, maxStations)); } public StationLocationResult stationLocation(final String stationId) throws IOException diff --git a/src/de/schildbach/pte/MvvProvider.java b/src/de/schildbach/pte/MvvProvider.java index bc8bf1d8..d860b9ea 100644 --- a/src/de/schildbach/pte/MvvProvider.java +++ b/src/de/schildbach/pte/MvvProvider.java @@ -33,6 +33,7 @@ import java.util.regex.Pattern; import de.schildbach.pte.dto.Autocomplete; import de.schildbach.pte.dto.Connection; import de.schildbach.pte.dto.GetConnectionDetailsResult; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryConnectionsResult; import de.schildbach.pte.dto.Station; import de.schildbach.pte.dto.StationLocationResult; @@ -133,7 +134,7 @@ public class MvvProvider extends AbstractEfaProvider private static final Pattern P_NEARBY_FINE = Pattern.compile(".*?(.*?).*?.*?(.*?).*?.*?(?:(\\d+),(\\d+).*?)?"); @Override - public List nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) + public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException { String uri; @@ -169,9 +170,9 @@ public class MvvProvider extends AbstractEfaProvider } if (maxStations == 0 || maxStations >= stations.size()) - return stations; + return new NearbyStationsResult(uri, stations); else - return stations.subList(0, maxStations); + return new NearbyStationsResult(uri, stations.subList(0, maxStations)); } public StationLocationResult stationLocation(final String stationId) throws IOException diff --git a/src/de/schildbach/pte/NetworkProvider.java b/src/de/schildbach/pte/NetworkProvider.java index 26fca74e..7af4b4ae 100644 --- a/src/de/schildbach/pte/NetworkProvider.java +++ b/src/de/schildbach/pte/NetworkProvider.java @@ -23,9 +23,9 @@ import java.util.List; import de.schildbach.pte.dto.Autocomplete; import de.schildbach.pte.dto.GetConnectionDetailsResult; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryConnectionsResult; import de.schildbach.pte.dto.QueryDeparturesResult; -import de.schildbach.pte.dto.Station; import de.schildbach.pte.dto.StationLocationResult; /** @@ -78,7 +78,7 @@ public interface NetworkProvider * @return nearby stations * @throws IOException */ - List nearbyStations(String stationId, int lat, int lon, int maxDistance, int maxStations) throws IOException; + NearbyStationsResult nearbyStations(String stationId, int lat, int lon, int maxDistance, int maxStations) throws IOException; /** * Look up location of station. diff --git a/src/de/schildbach/pte/RmvProvider.java b/src/de/schildbach/pte/RmvProvider.java index 12d45d11..7469481b 100644 --- a/src/de/schildbach/pte/RmvProvider.java +++ b/src/de/schildbach/pte/RmvProvider.java @@ -34,6 +34,7 @@ import de.schildbach.pte.dto.Autocomplete; import de.schildbach.pte.dto.Connection; import de.schildbach.pte.dto.Departure; import de.schildbach.pte.dto.GetConnectionDetailsResult; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryConnectionsResult; import de.schildbach.pte.dto.QueryDeparturesResult; import de.schildbach.pte.dto.Station; @@ -100,13 +101,13 @@ public class RmvProvider extends AbstractHafasProvider } @Override - public List nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) + public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException { if (lat != 0 || lon != 0) { - final String url = API_BASE + "dox?input=" + latLonToDouble(lat) + "%20" + latLonToDouble(lon); - final CharSequence page = ParserUtils.scrape(url); + final String uri = API_BASE + "dox?input=" + latLonToDouble(lat) + "%20" + latLonToDouble(lon); + final CharSequence page = ParserUtils.scrape(uri); final List stations = new ArrayList(); @@ -122,9 +123,9 @@ public class RmvProvider extends AbstractHafasProvider } if (maxStations == 0 || maxStations >= stations.size()) - return stations; + return new NearbyStationsResult(uri, stations); else - return stations.subList(0, maxStations); + return new NearbyStationsResult(uri, stations.subList(0, maxStations)); } else if (stationId != null) { diff --git a/src/de/schildbach/pte/TflProvider.java b/src/de/schildbach/pte/TflProvider.java index 3b7109b3..f4613639 100644 --- a/src/de/schildbach/pte/TflProvider.java +++ b/src/de/schildbach/pte/TflProvider.java @@ -29,9 +29,9 @@ import java.util.regex.Pattern; import de.schildbach.pte.dto.Autocomplete; import de.schildbach.pte.dto.Departure; import de.schildbach.pte.dto.GetConnectionDetailsResult; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryConnectionsResult; import de.schildbach.pte.dto.QueryDeparturesResult; -import de.schildbach.pte.dto.Station; import de.schildbach.pte.dto.StationLocationResult; import de.schildbach.pte.dto.QueryDeparturesResult.Status; import de.schildbach.pte.util.Color; @@ -54,7 +54,7 @@ public class TflProvider implements NetworkProvider throw new UnsupportedOperationException(); } - public List nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) + public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException { throw new UnsupportedOperationException(); diff --git a/src/de/schildbach/pte/VbbProvider.java b/src/de/schildbach/pte/VbbProvider.java index 101deb4b..e5d9707f 100644 --- a/src/de/schildbach/pte/VbbProvider.java +++ b/src/de/schildbach/pte/VbbProvider.java @@ -35,9 +35,9 @@ import de.schildbach.pte.dto.Autocomplete; import de.schildbach.pte.dto.Connection; import de.schildbach.pte.dto.Departure; import de.schildbach.pte.dto.GetConnectionDetailsResult; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryConnectionsResult; import de.schildbach.pte.dto.QueryDeparturesResult; -import de.schildbach.pte.dto.Station; import de.schildbach.pte.dto.StationLocationResult; import de.schildbach.pte.dto.QueryDeparturesResult.Status; import de.schildbach.pte.util.Color; @@ -107,7 +107,7 @@ public final class VbbProvider implements NetworkProvider return results; } - public List nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) + public NearbyStationsResult nearbyStations(final String stationId, final int lat, final int lon, final int maxDistance, final int maxStations) throws IOException { throw new UnsupportedOperationException(); diff --git a/src/de/schildbach/pte/dto/NearbyStationsResult.java b/src/de/schildbach/pte/dto/NearbyStationsResult.java new file mode 100644 index 00000000..7b23d146 --- /dev/null +++ b/src/de/schildbach/pte/dto/NearbyStationsResult.java @@ -0,0 +1,49 @@ +/* + * 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 . + */ + +package de.schildbach.pte.dto; + +import java.util.List; + +/** + * @author Andreas Schildbach + */ +public final class NearbyStationsResult +{ + public enum Status + { + OK, INVALID_STATION, SERVICE_DOWN + } + + public final String uri; + public final Status status; + public final List stations; + + public NearbyStationsResult(final String uri, List stations) + { + this.uri = uri; + this.status = Status.OK; + this.stations = stations; + } + + public NearbyStationsResult(final String uri, final Status status) + { + this.uri = uri; + this.status = status; + this.stations = null; + } +} diff --git a/test/de/schildbach/pte/live/GvhProviderLiveTest.java b/test/de/schildbach/pte/live/GvhProviderLiveTest.java index 0a44cb2d..ede45cff 100644 --- a/test/de/schildbach/pte/live/GvhProviderLiveTest.java +++ b/test/de/schildbach/pte/live/GvhProviderLiveTest.java @@ -22,7 +22,7 @@ import org.junit.Test; import de.schildbach.pte.GvhProvider; import de.schildbach.pte.dto.Autocomplete; -import de.schildbach.pte.dto.Station; +import de.schildbach.pte.dto.NearbyStationsResult; /** * @author Andreas Schildbach @@ -42,8 +42,8 @@ public class GvhProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("25000031", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("25000031", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } } diff --git a/test/de/schildbach/pte/live/NasaProviderLiveTest.java b/test/de/schildbach/pte/live/NasaProviderLiveTest.java index 0e976eba..97d0358f 100644 --- a/test/de/schildbach/pte/live/NasaProviderLiveTest.java +++ b/test/de/schildbach/pte/live/NasaProviderLiveTest.java @@ -16,13 +16,11 @@ */ package de.schildbach.pte.live; -import java.util.List; - import org.junit.Test; import de.schildbach.pte.NasaProvider; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryDeparturesResult; -import de.schildbach.pte.dto.Station; /** * @author Andreas Schildbach @@ -34,9 +32,9 @@ public class NasaProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("13000", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("13000", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } @Test diff --git a/test/de/schildbach/pte/live/OebbProviderLiveTest.java b/test/de/schildbach/pte/live/OebbProviderLiveTest.java index 8861af9a..a6870b1b 100644 --- a/test/de/schildbach/pte/live/OebbProviderLiveTest.java +++ b/test/de/schildbach/pte/live/OebbProviderLiveTest.java @@ -18,15 +18,14 @@ package de.schildbach.pte.live; import java.util.Date; -import java.util.List; import org.junit.Test; import de.schildbach.pte.OebbProvider; import de.schildbach.pte.NetworkProvider.LocationType; import de.schildbach.pte.NetworkProvider.WalkSpeed; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryConnectionsResult; -import de.schildbach.pte.dto.Station; /** * @author Andreas Schildbach @@ -38,9 +37,9 @@ public class OebbProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("902006", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("902006", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } @Test diff --git a/test/de/schildbach/pte/live/RmvProviderLiveTest.java b/test/de/schildbach/pte/live/RmvProviderLiveTest.java index 173e8dad..e637ae5f 100644 --- a/test/de/schildbach/pte/live/RmvProviderLiveTest.java +++ b/test/de/schildbach/pte/live/RmvProviderLiveTest.java @@ -16,12 +16,10 @@ */ package de.schildbach.pte.live; -import java.util.List; - import org.junit.Test; import de.schildbach.pte.RmvProvider; -import de.schildbach.pte.dto.Station; +import de.schildbach.pte.dto.NearbyStationsResult; /** * @author Andreas Schildbach @@ -33,8 +31,8 @@ public class RmvProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("3000001", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("3000001", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } } diff --git a/test/de/schildbach/pte/live/SbbProviderLiveTest.java b/test/de/schildbach/pte/live/SbbProviderLiveTest.java index 1b79c411..93be74e7 100644 --- a/test/de/schildbach/pte/live/SbbProviderLiveTest.java +++ b/test/de/schildbach/pte/live/SbbProviderLiveTest.java @@ -26,8 +26,8 @@ import de.schildbach.pte.SbbProvider; import de.schildbach.pte.NetworkProvider.LocationType; import de.schildbach.pte.NetworkProvider.WalkSpeed; import de.schildbach.pte.dto.Autocomplete; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryConnectionsResult; -import de.schildbach.pte.dto.Station; /** * @author Andreas Schildbach @@ -39,11 +39,11 @@ public class SbbProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("8500010", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("8500010", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } - + @Test public void shortConnection() throws Exception { diff --git a/test/de/schildbach/pte/live/SncbProviderLiveTest.java b/test/de/schildbach/pte/live/SncbProviderLiveTest.java index 8d38dd01..78cae5c6 100644 --- a/test/de/schildbach/pte/live/SncbProviderLiveTest.java +++ b/test/de/schildbach/pte/live/SncbProviderLiveTest.java @@ -16,12 +16,10 @@ */ package de.schildbach.pte.live; -import java.util.List; - import org.junit.Test; import de.schildbach.pte.SncbProvider; -import de.schildbach.pte.dto.Station; +import de.schildbach.pte.dto.NearbyStationsResult; /** * @author Andreas Schildbach @@ -33,8 +31,8 @@ public class SncbProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("100080", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("100080", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } } diff --git a/test/de/schildbach/pte/live/VgsProviderLiveTest.java b/test/de/schildbach/pte/live/VgsProviderLiveTest.java index c2f67528..da86fa38 100644 --- a/test/de/schildbach/pte/live/VgsProviderLiveTest.java +++ b/test/de/schildbach/pte/live/VgsProviderLiveTest.java @@ -16,13 +16,11 @@ */ package de.schildbach.pte.live; -import java.util.List; - import org.junit.Test; import de.schildbach.pte.VgsProvider; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryDeparturesResult; -import de.schildbach.pte.dto.Station; /** * @author Andreas Schildbach @@ -34,9 +32,9 @@ public class VgsProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("8000244", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("8000244", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } @Test diff --git a/test/de/schildbach/pte/live/VrnProviderLiveTest.java b/test/de/schildbach/pte/live/VrnProviderLiveTest.java index f2b42b8b..efff3c3f 100644 --- a/test/de/schildbach/pte/live/VrnProviderLiveTest.java +++ b/test/de/schildbach/pte/live/VrnProviderLiveTest.java @@ -16,13 +16,11 @@ */ package de.schildbach.pte.live; -import java.util.List; - import org.junit.Test; import de.schildbach.pte.VrnProvider; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryDeparturesResult; -import de.schildbach.pte.dto.Station; /** * @author Andreas Schildbach @@ -34,9 +32,9 @@ public class VrnProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("6032236", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("6032236", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } @Test diff --git a/test/de/schildbach/pte/live/VrrProviderLiveTest.java b/test/de/schildbach/pte/live/VrrProviderLiveTest.java index cda2741c..d4531cf4 100644 --- a/test/de/schildbach/pte/live/VrrProviderLiveTest.java +++ b/test/de/schildbach/pte/live/VrrProviderLiveTest.java @@ -16,13 +16,11 @@ */ package de.schildbach.pte.live; -import java.util.List; - import org.junit.Test; import de.schildbach.pte.VrrProvider; +import de.schildbach.pte.dto.NearbyStationsResult; import de.schildbach.pte.dto.QueryDeparturesResult; -import de.schildbach.pte.dto.Station; /** * @author Andreas Schildbach @@ -34,9 +32,9 @@ public class VrrProviderLiveTest @Test public void nearbyStation() throws Exception { - final List results = provider.nearbyStations("20019904", 0, 0, 0, 0); + final NearbyStationsResult result = provider.nearbyStations("20019904", 0, 0, 0, 0); - System.out.println(results.size() + " " + results); + System.out.println(result.stations.size() + " " + result.stations); } @Test