mirror of
https://gitlab.com/oeffi/public-transport-enabler.git
synced 2025-07-13 16:20:34 +00:00
don't use non-unique efa routeIndex/routeTripIndex'es
This commit is contained in:
parent
47a2e6dc78
commit
c99ad70e1b
23 changed files with 279 additions and 13 deletions
|
@ -86,6 +86,7 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
private final boolean needsSpEncId;
|
||||
private Charset requestUrlEncoding = ISO_8859_1;
|
||||
private boolean suppressPositions = false;
|
||||
private boolean useRouteIndexAsConnectionId = true;
|
||||
private final XmlPullParserFactory parserFactory;
|
||||
|
||||
private static class Context implements QueryConnectionsContext
|
||||
|
@ -160,6 +161,11 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
this.suppressPositions = suppressPositions;
|
||||
}
|
||||
|
||||
public void setUseRouteIndexAsConnectionId(final boolean useRouteIndexAsConnectionId)
|
||||
{
|
||||
this.useRouteIndexAsConnectionId = useRouteIndexAsConnectionId;
|
||||
}
|
||||
|
||||
protected TimeZone timeZone()
|
||||
{
|
||||
return TimeZone.getTimeZone("Europe/Berlin");
|
||||
|
@ -1901,7 +1907,8 @@ public abstract class AbstractEfaProvider extends AbstractNetworkProvider
|
|||
|
||||
while (XmlPullUtil.test(pp, "itdRoute"))
|
||||
{
|
||||
final String id = pp.getAttributeValue(null, "routeIndex") + "-" + pp.getAttributeValue(null, "routeTripIndex");
|
||||
final String id = useRouteIndexAsConnectionId ? pp.getAttributeValue(null, "routeIndex") + "-"
|
||||
+ pp.getAttributeValue(null, "routeTripIndex") : null;
|
||||
final int numChanges = XmlPullUtil.intAttr(pp, "changes");
|
||||
XmlPullUtil.enter(pp, "itdRoute");
|
||||
|
||||
|
|
|
@ -28,6 +28,8 @@ public class AvvProvider extends AbstractEfaProvider
|
|||
public AvvProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -35,6 +35,8 @@ public class DubProvider extends AbstractEfaProvider
|
|||
public DubProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -28,6 +28,8 @@ public class IvbProvider extends AbstractEfaProvider
|
|||
public IvbProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -36,6 +36,8 @@ public class MetProvider extends AbstractEfaProvider
|
|||
public MetProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -34,6 +34,8 @@ public class NvbwProvider extends AbstractEfaProvider
|
|||
public NvbwProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -34,6 +34,8 @@ public class SfProvider extends AbstractEfaProvider
|
|||
public SfProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -30,6 +30,8 @@ public class SydneyProvider extends AbstractEfaProvider
|
|||
public SydneyProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -35,6 +35,8 @@ public class TlswProvider extends AbstractEfaProvider
|
|||
public TlswProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -38,6 +38,8 @@ public class VagfrProvider extends AbstractEfaProvider
|
|||
public VagfrProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -28,6 +28,8 @@ public class VblProvider extends AbstractEfaProvider
|
|||
public VblProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -28,6 +28,8 @@ public class VvtProvider extends AbstractEfaProvider
|
|||
public VvtProvider()
|
||||
{
|
||||
super(API_BASE, null);
|
||||
|
||||
setUseRouteIndexAsConnectionId(false);
|
||||
}
|
||||
|
||||
public NetworkId id()
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -87,7 +90,25 @@ public class AvvProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 101, null, "Königsplatz"), null, new Location(
|
||||
LocationType.STATION, 100, null, "Hauptbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -71,7 +74,25 @@ public class DubProviderLiveTest extends AbstractProviderLiveTest
|
|||
null, new Location(LocationType.STATION, 3505445, null, "Airport Terminal 3"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -87,7 +90,25 @@ public class IvbProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 60466402, null, "Kochstraße"), null, new Location(
|
||||
LocationType.STATION, 60461679, null, "Messe/Zeughaus"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -76,10 +79,29 @@ public class MetProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 0, null, "Hauptwache"), null, new Location(
|
||||
LocationType.STATION, 0, null, "Südbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 10002717, "Melbourne City",
|
||||
"6-Franklin St/Elizabeth St"), null, new Location(LocationType.STATION, 10002722, "Melbourne City",
|
||||
"1-Flinders Street Railway Station/Elizabeth St"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -87,7 +90,25 @@ public class NvbwProviderLiveTest extends AbstractProviderLiveTest
|
|||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 17002402, null, "Bahnhof"), null, new Location(
|
||||
LocationType.STATION, 17009001, null, "Bahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -76,10 +79,29 @@ public class SfProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 0, null, "Hauptwache"), null, new Location(
|
||||
LocationType.STATION, 0, null, "Südbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 10001032, 37784976, -122406784, "San Francisco",
|
||||
"BART Powell"), null, new Location(LocationType.STATION, 10001026, 37789376, -122401320, "San Francisco", "BART Montgomery"),
|
||||
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -80,7 +83,25 @@ public class SydneyProviderLiveTest extends AbstractProviderLiveTest
|
|||
new Location(LocationType.STATION, 0, "Sydney", "Capitol Square"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -76,10 +79,29 @@ public class TlswProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 0, null, "70003023"), null, new Location(
|
||||
LocationType.STATION, 0, null, "70003025"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 60011202, 51850168, -1094302, "Upper Arncott",
|
||||
"Bullingdon Prison"), null, new Location(LocationType.STATION, 60006576, 51856352, -1113127, "Lower Arncott", "The Plough"),
|
||||
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -76,10 +79,29 @@ public class VagfrProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 0, null, "Hauptwache"), null, new Location(
|
||||
LocationType.STATION, 0, null, "Südbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 6930100, null, "Freiburg Bertoldsbrunnen"), null,
|
||||
new Location(LocationType.STATION, 6930101, null, "Freiburg Siegesdenkmal"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL,
|
||||
Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -84,10 +87,29 @@ public class VblProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 0, null, "Hauptwache"), null, new Location(
|
||||
LocationType.STATION, 0, null, "Südbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryConnectionsResult result = queryConnections(
|
||||
new Location(LocationType.STATION, 119, 47050760, 8310252, "Luzern", "Luzern, Bahnhof"), null, new Location(LocationType.STATION,
|
||||
118, 47048844, 8306433, "Luzern", "Kantonalbank"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -17,6 +17,9 @@
|
|||
|
||||
package de.schildbach.pte.live;
|
||||
|
||||
import static org.junit.Assert.assertEquals;
|
||||
import static org.junit.Assert.assertTrue;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
|
||||
|
@ -84,10 +87,29 @@ public class VvtProviderLiveTest extends AbstractProviderLiveTest
|
|||
@Test
|
||||
public void shortConnection() throws Exception
|
||||
{
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 0, null, "Hauptwache"), null, new Location(
|
||||
LocationType.STATION, 0, null, "Südbahnhof"), new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
final QueryConnectionsResult result = queryConnections(new Location(LocationType.STATION, 60161512, 47268336, 11355532, "Innsbruck",
|
||||
"Allerheiligen"), null, new Location(LocationType.STATION, 60161510, 47267272, 11350938, "Innsbruck", "Tschiggfreystraße"),
|
||||
new Date(), true, ALL_PRODUCTS, WalkSpeed.NORMAL, Accessibility.NEUTRAL);
|
||||
System.out.println(result);
|
||||
assertEquals(QueryConnectionsResult.Status.OK, result.status);
|
||||
assertTrue(result.connections.size() > 0);
|
||||
|
||||
if (!result.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult laterResult = queryMoreConnections(result.context, true);
|
||||
System.out.println(laterResult);
|
||||
|
||||
if (!laterResult.context.canQueryLater())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult later2Result = queryMoreConnections(laterResult.context, true);
|
||||
System.out.println(later2Result);
|
||||
|
||||
if (!later2Result.context.canQueryEarlier())
|
||||
return;
|
||||
|
||||
final QueryConnectionsResult earlierResult = queryMoreConnections(later2Result.context, false);
|
||||
System.out.println(earlierResult);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue