mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-17 19:59:50 +00:00
Migrate Norway to binary trips query.
This commit is contained in:
parent
9fd1ccb1dd
commit
3bc1faf533
2 changed files with 4 additions and 24 deletions
|
@ -17,18 +17,11 @@
|
||||||
|
|
||||||
package de.schildbach.pte;
|
package de.schildbach.pte;
|
||||||
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.util.Date;
|
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
import javax.annotation.Nullable;
|
|
||||||
|
|
||||||
import com.google.common.base.Charsets;
|
import com.google.common.base.Charsets;
|
||||||
|
|
||||||
import de.schildbach.pte.dto.Location;
|
|
||||||
import de.schildbach.pte.dto.Product;
|
import de.schildbach.pte.dto.Product;
|
||||||
import de.schildbach.pte.dto.QueryTripsContext;
|
|
||||||
import de.schildbach.pte.dto.QueryTripsResult;
|
|
||||||
|
|
||||||
import okhttp3.HttpUrl;
|
import okhttp3.HttpUrl;
|
||||||
|
|
||||||
|
@ -62,19 +55,6 @@ public class NriProvider extends AbstractHafasLegacyProvider {
|
||||||
return Product.ALL;
|
return Product.ALL;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public QueryTripsResult queryTrips(final Location from, final @Nullable Location via, final Location to,
|
|
||||||
final Date date, final boolean dep, final @Nullable Set<Product> products,
|
|
||||||
final @Nullable Optimize optimize, final @Nullable WalkSpeed walkSpeed,
|
|
||||||
final @Nullable Accessibility accessibility, final @Nullable Set<Option> options) throws IOException {
|
|
||||||
return queryTripsXml(from, via, to, date, dep, products, walkSpeed, accessibility, options);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public QueryTripsResult queryMoreTrips(final QueryTripsContext context, final boolean later) throws IOException {
|
|
||||||
return queryMoreTripsXml(context, later);
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected Product normalizeType(final String type) {
|
protected Product normalizeType(final String type) {
|
||||||
final String ucType = type.toUpperCase();
|
final String ucType = type.toUpperCase();
|
||||||
|
|
|
@ -79,10 +79,10 @@ public class NriProviderLiveTest extends AbstractProviderLiveTest {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void shortTrip() throws Exception {
|
public void trip() throws Exception {
|
||||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "8059", null, "Oslo"), null,
|
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "760000645", "Oslo", "sentrum"),
|
||||||
new Location(LocationType.STATION, "6642", null, "Bergen BGO"), new Date(), true, Product.ALL,
|
null, new Location(LocationType.STATION, "760009404", "Bergen", "sentrum"), new Date(), true,
|
||||||
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||||
print(result);
|
print(result);
|
||||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||||
print(laterResult);
|
print(laterResult);
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue