public void testFrequencies() {
Vertex stop_u = graph.getVertex("agency:U_depart");
Vertex stop_v = graph.getVertex("agency:V_arrive");
ShortestPathTree spt;
GraphPath path;
RoutingRequest options = new RoutingRequest();
options.setModes(new TraverseModeSet("TRANSIT"));
options.dateTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 7, 0, 0, 0);
options.setRoutingContext(graph, stop_u, stop_v);
// U to V - original stop times - shouldn't be used
spt = aStar.getShortestPathTree(options);
path = spt.getPath(stop_v, false);
assertNotNull(path);
assertEquals(4, path.states.size());
long endTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 7, 6, 40, 0);
assertEquals(endTime, path.getEndTime());
// U to V - first frequency
options.dateTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 7, 7, 0, 0);
options.setRoutingContext(graph, stop_u, stop_v);
spt = aStar.getShortestPathTree(options);
path = spt.getPath(stop_v, false);
assertNotNull(path);
assertEquals(4, path.states.size());
endTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 7, 7, 40, 0);
assertEquals(endTime, path.getEndTime());
// U to V - second frequency
options.dateTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 7, 14, 0, 0);
options.setRoutingContext(graph, stop_u, stop_v);
spt = aStar.getShortestPathTree(options);
path = spt.getPath(stop_v, false);
assertNotNull(path);
assertEquals(4, path.states.size());
endTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 7, 14, 40, 0);
assertEquals(endTime, path.getEndTime());
// TODO more detailed testing of frequencies
}