mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-19 00:39:58 +00:00
rename Connection to Trip
This commit is contained in:
parent
fde90f7b87
commit
2852aedbd5
139 changed files with 1195 additions and 1236 deletions
|
@ -32,8 +32,8 @@ import de.schildbach.pte.dto.Location;
|
|||
import de.schildbach.pte.dto.LocationType;
|
||||
import de.schildbach.pte.dto.NearbyStationsResult;
|
||||
import de.schildbach.pte.dto.Product;
|
||||
import de.schildbach.pte.dto.QueryConnectionsResult;
|
||||
import de.schildbach.pte.dto.QueryDeparturesResult;
|
||||
import de.schildbach.pte.dto.QueryTripsResult;
|
||||
|
||||
/**
|
||||
* @author Andreas Schildbach
|
||||
|
@ -110,62 +110,61 @@ public class GvhProviderLiveTest extends AbstractProviderLiveTest
|
|||
}
|
||||
|
||||
@Test
|
||||
public void incompleteConnection() throws Exception
|
||||
public void incompleteTrip() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.ANY, 0, null, "hann"), null, new Location(LocationType.ANY,
|
||||
0, null, "laat"), new Date(), true, Product.ALL, WalkSpeed.FAST, Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, 0, null, "hann"), null, new Location(LocationType.ANY, 0, null,
|
||||
"laat"), new Date(), true, Product.ALL, WalkSpeed.FAST, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
public void shortTrip() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 25000031, null, "Hannover Hauptbahnhof"), null,
|
||||
new Location(LocationType.STATION, 25001141, null, "Hannover Bismarckstraße"), new Date(), true, Product.ALL, WalkSpeed.FAST,
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.STATION, 25000031, null, "Hannover Hauptbahnhof"), null, new Location(
|
||||
LocationType.STATION, 25001141, null, "Hannover Bismarckstraße"), new Date(), true, Product.ALL, WalkSpeed.FAST,
|
||||
Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
assertEquals(QueryTripsResult.Status.OK, result.status);
|
||||
assertTrue(result.trips.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
final QueryTripsResult later2Result = queryMoreTrips(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
final QueryTripsResult earlierResult = queryMoreTrips(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void connectionBetweenAnyAndAddress() throws Exception
|
||||
public void tripBetweenAnyAndAddress() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(
|
||||
new Location(LocationType.ANY, 0, 53069619, 8799202, null, "bremen, neustadtswall 12"), null, new Location(LocationType.ADDRESS, 0,
|
||||
53104124, 8788575, null, "Bremen Glücksburger Straße 37"), new Date(), true, Product.ALL, WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ANY, 0, 53069619, 8799202, null, "bremen, neustadtswall 12"), null,
|
||||
new Location(LocationType.ADDRESS, 0, 53104124, 8788575, null, "Bremen Glücksburger Straße 37"), new Date(), true, Product.ALL,
|
||||
WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
}
|
||||
|
||||
@Test
|
||||
public void connectionBetweenAddresses() throws Exception
|
||||
public void tripBetweenAddresses() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.ADDRESS, 0, 53622859, 10133545, null,
|
||||
final QueryTripsResult result = queryTrips(new Location(LocationType.ADDRESS, 0, 53622859, 10133545, null,
|
||||
"Zamenhofweg 14, 22159 Hamburg, Deutschland"), null, new Location(LocationType.ADDRESS, 0, 53734260, 9674990, null,
|
||||
"Lehmkuhlen 5, 25337 Elmshorn, Deutschland"), new Date(), true, Product.ALL, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
final QueryTripsResult laterResult = queryMoreTrips(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue