Skip to content

Commit

Permalink
refactor(Fixed broken unit tests): Fixed broken unit tests as a resul…
Browse files Browse the repository at this point in the history
…t of pattern stop updates

BREAKING CHANGE: This PR contains schema changes to the following tables routes, stop times, stop
and feed info
  • Loading branch information
Robin Beer authored and Robin Beer committed May 21, 2021
1 parent e0ade58 commit 38b5e34
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/main/java/com/conveyal/gtfs/TripPatternKey.java
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ public class TripPatternKey {
public TIntList arrivalTimes = new TIntArrayList();
public TIntList departureTimes = new TIntArrayList();
public TIntList timepoints = new TIntArrayList();
public TIntList continuous_pickup = new TIntArrayList();
public TIntList continuous_drop_off = new TIntArrayList();
public TDoubleList shapeDistances = new TDoubleArrayList();

public TripPatternKey (String routeId) {
Expand All @@ -39,6 +41,8 @@ public void addStopTime (StopTime st) {
departureTimes.add(st.departure_time);
timepoints.add(st.timepoint);
shapeDistances.add(st.shape_dist_traveled);
continuous_pickup.add(st.continuous_pickup);
continuous_drop_off.add(st.continuous_drop_off);
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -158,6 +158,8 @@ public void complete(ValidationResult validationResult) {
setIntParameter(insertPatternStopStatement,7, key.pickupTypes.get(i));
setDoubleParameter(insertPatternStopStatement, 8, key.shapeDistances.get(i));
setIntParameter(insertPatternStopStatement,9, key.timepoints.get(i));
setIntParameter(insertPatternStopStatement,10, key.continuous_pickup.get(i));
setIntParameter(insertPatternStopStatement,11, key.continuous_drop_off.get(i));
patternStopTracker.addBatch();
}
// Finally, update all trips on this pattern to reference this pattern's ID.
Expand Down
2 changes: 2 additions & 0 deletions src/test/java/com/conveyal/gtfs/dto/PatternStopDTO.java
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ public class PatternStopDTO {
public Integer pickup_type;
public Integer stop_sequence;
public Integer timepoint;
public Integer continuous_pickup;
public Integer continuous_drop_off;

/** Empty constructor for deserialization */
public PatternStopDTO() {}
Expand Down

0 comments on commit 38b5e34

Please sign in to comment.