Skip to content

Commit

Permalink
Merge pull request #309 from pailakka/realtime-fixes-v2
Browse files Browse the repository at this point in the history
Do not use modified trip processing it trip matches but stops doesn't
  • Loading branch information
optionsome authored Jul 16, 2019
2 parents 6555ba6 + faf287b commit 0f72c0e
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -877,6 +877,9 @@ private boolean handleModifiedTrip(final Graph graph, final Trip trip, final Tri
LOG.warn("MODIFIED trip {} matches existing SCHEDULED trip. Treating as such.", trip.getId().getId());
return handleScheduledTrip(tripUpdate, feedId, serviceDate);
}
// Do not modify scheduled trips as it causes canceled trip to appear in indexes and replacement trip not added to indexes
LOG.error("MODIFIED trip {} matches existing SCHEDULED trip. Stop patterns do not match SKIPPING", trip.getId().getId());
return false;
}

// Cancel scheduled trip
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
package org.opentripplanner.updater.stoptime;

import static org.junit.Assert.assertEquals;
import static org.junit.Assert.assertFalse;
import static org.junit.Assert.assertNotNull;
import static org.junit.Assert.assertNotSame;
import static org.junit.Assert.assertSame;
import static org.junit.Assert.assertTrue;
import static org.junit.Assert.*;
import static org.opentripplanner.calendar.impl.CalendarServiceDataFactoryImpl.createCalendarServiceData;

import java.io.File;
Expand Down Expand Up @@ -429,7 +424,12 @@ public void testHandleModifiedTrip() throws ParseException {

// THEN
final TimetableSnapshot snapshot = updater.getTimetableSnapshot();
assertNull(snapshot);

// Current temporary changes to tripUpdate handling doesn't allow modifying trips
// if stop sequence does not exactly match existing scheduled trip
// TODO: Teemu Peltonen 27.6.2019 Fix this test after fixing handling MODIFIED tripupdates
/*
// Original trip pattern
{
final FeedScopedId tripId = new FeedScopedId(feedId, modifiedTripId);
Expand Down Expand Up @@ -470,6 +470,8 @@ public void testHandleModifiedTrip() throws ParseException {
assertEquals("New trip should not be found in scheduled time table", -1, newTimetableScheduled.getTripIndex(modifiedTripId));
}
*/
}

@Test
Expand Down

0 comments on commit 0f72c0e

Please sign in to comment.