mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 16:20:34 +00:00
Update API base for Neckar-Alb-Donau.
This commit is contained in:
parent
d9a0470f20
commit
2aed1b3af4
2 changed files with 13 additions and 15 deletions
|
@ -17,23 +17,19 @@
|
|||
|
||||
package de.schildbach.pte;
|
||||
|
||||
import java.io.IOException;
|
||||
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
*/
|
||||
public class NaldoProvider extends AbstractEfaProvider
|
||||
{
|
||||
public static final NetworkId NETWORK_ID = NetworkId.NALDO;
|
||||
private final static String API_BASE = "http://efa.naldo.de/naldo/";
|
||||
private final static String API_BASE = "http://efa2.naldo.de/naldo/";
|
||||
|
||||
public NaldoProvider()
|
||||
{
|
||||
super(API_BASE);
|
||||
|
||||
setIncludeRegionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
@ -53,10 +49,4 @@ public class NaldoProvider extends AbstractEfaProvider
|
|||
|
||||
return super.parseLine(mot, symbol, name, longName, trainType, trainNum, trainName);
|
||||
}
|
||||
|
||||
@Override
|
||||
public SuggestLocationsResult suggestLocations(final CharSequence constraint) throws IOException
|
||||
{
|
||||
return xmlStopfinderRequest(new Location(LocationType.STATION, null, null, constraint.toString()));
|
||||
}
|
||||
}
|
||||
|
|
|
@ -69,6 +69,13 @@ public class NaldoProviderLiveTest extends AbstractProviderLiveTest
|
|||
print(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void queryDeparturesInvalidStation() throws Exception
|
||||
{
|
||||
final QueryDeparturesResult result = queryDepartures("999999", false);
|
||||
assertEquals(QueryDeparturesResult.Status.INVALID_STATION, result.status);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void suggestLocationsIncomplete() throws Exception
|
||||
{
|
||||
|
@ -88,8 +95,9 @@ public class NaldoProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void shortTrip() throws Exception
|
||||
{
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "3019697", null, "Amberg Kurfürstenbad"), null, new Location(
|
||||
LocationType.STATION, "3019500", null, "Amberg Bahnhof"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "8029333", 48492484, 9207456, "Reutlingen", "ZOB"), null,
|
||||
new Location(LocationType.STATION, "8029109", 48496968, 9213320, "Reutlingen", "Bismarckstr."), new Date(), true, Product.ALL,
|
||||
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
print(result);
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
assertTrue(result.trips.size() > 0);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue