mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-20 09:19:57 +00:00
AbstractProviderLiveTest: Use TripOptions in queryTrips() and simplify live tests by passing null to use defaults where appropriate.
This commit is contained in:
parent
79ff93b80f
commit
0831d0f8e6
63 changed files with 291 additions and 579 deletions
|
@ -1,5 +1,5 @@
|
|||
/*
|
||||
* Copyright 2010-2015 the original author or authors.
|
||||
* Copyright 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
|
||||
|
@ -23,13 +23,10 @@ import java.util.Date;
|
|||
|
||||
import org.junit.Test;
|
||||
|
||||
import de.schildbach.pte.NetworkProvider.Accessibility;
|
||||
import de.schildbach.pte.NetworkProvider.WalkSpeed;
|
||||
import de.schildbach.pte.SbbProvider;
|
||||
import de.schildbach.pte.dto.Location;
|
||||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyLocationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
import de.schildbach.pte.dto.SuggestLocationsResult;
|
||||
|
@ -88,7 +85,7 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest {
|
|||
public void shortTrip() throws Exception {
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, "8503000", null, "Zürich HB"),
|
||||
null, new Location(LocationType.STATION, "8507785", null, "Bern, Hauptbahnhof"), new Date(), true,
|
||||
Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
null);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
@ -98,8 +95,7 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest {
|
|||
public void slowTrip() throws Exception {
|
||||
final QueryTripsResult result = queryTrips(
|
||||
new Location(LocationType.STATION, "8587210", null, "Schocherswil, Alte Post"), null,
|
||||
new Location(LocationType.STATION, "8592972", null, "Laconnex, Mollach"), new Date(), true, Product.ALL,
|
||||
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
new Location(LocationType.STATION, "8592972", null, "Laconnex, Mollach"), new Date(), true, null);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
@ -110,7 +106,7 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest {
|
|||
final QueryTripsResult result = queryTrips(
|
||||
new Location(LocationType.ADDRESS, null, 46689354, 7683444, null, "Spiez, Seestraße 62"), null,
|
||||
new Location(LocationType.ADDRESS, null, 47133169, 8767425, null, "Einsiedeln, Erlenmoosweg 24"),
|
||||
new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
new Date(), true, null);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
@ -120,8 +116,7 @@ public class SbbProviderLiveTest extends AbstractProviderLiveTest {
|
|||
public void tripFromAddress() throws Exception {
|
||||
final QueryTripsResult result = queryTrips(
|
||||
new Location(LocationType.ADDRESS, null, 47438595, 8437369, null, "Dorfstrasse 10, Dällikon, Schweiz"),
|
||||
null, new Location(LocationType.STATION, "8500010", null, "Basel"), new Date(), true, Product.ALL,
|
||||
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
null, new Location(LocationType.STATION, "8500010", null, "Basel"), new Date(), true, null);
|
||||
print(result);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
print(laterResult);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue