endTime = TestUtils.dateInSeconds("America/New_York", 2009, 8, 19, 15, 10, 0);
assertEquals(endTime, path.getEndTime());
}
public void testTransfers() throws Exception {
TransferTable transferTable = graph.getTransferTable();
// create dummy routes and trips
Route fromRoute = new Route();
fromRoute.setId(new AgencyAndId("agency", "1"));
Trip fromTrip = new Trip();
fromTrip.setId(new AgencyAndId("agency", "1.1"));
fromTrip.setRoute(fromRoute);
Route toRoute = new Route();
toRoute.setId(new AgencyAndId("agency", "2"));
Trip toTrip = new Trip();
toTrip.setId(new AgencyAndId("agency", "2.1"));
toTrip.setRoute(toRoute);
Trip toTrip2 = new Trip();
toTrip2.setId(new AgencyAndId("agency", "2.2"));
toTrip2.setRoute(toRoute);
// find stops
Stop stopK = ((TransitStopArrive)graph.getVertex("agency:K_arrive")).getStop();
Stop stopN = ((TransitStopDepart)graph.getVertex("agency:N_depart")).getStop();
Stop stopM = ((TransitStopDepart)graph.getVertex("agency:M_depart")).getStop();
assertTrue(transferTable.hasPreferredTransfers());
assertEquals(StopTransfer.UNKNOWN_TRANSFER, transferTable.getTransferTime(stopN, stopM, fromTrip, toTrip, true));
assertEquals(StopTransfer.FORBIDDEN_TRANSFER, transferTable.getTransferTime(stopK, stopM, fromTrip, toTrip, true));
assertEquals(StopTransfer.PREFERRED_TRANSFER, transferTable.getTransferTime(stopN, stopK, toTrip, toTrip2, true));
assertEquals(StopTransfer.TIMED_TRANSFER, transferTable.getTransferTime(stopN, stopK, fromTrip, toTrip, true));
assertEquals(15, transferTable.getTransferTime(stopN, stopK, fromTrip, toTrip2, true));
TransitStop e_arrive = (TransitStop) graph.getVertex("agency:E");
TransitStop f_depart = (TransitStop) graph.getVertex("agency:F");
Edge edge = new TransferEdge(e_arrive, f_depart, 10000, 10000);