use of org.opentripplanner.model.calendar.ServiceCalendarDate in project OpenTripPlanner by opentripplanner.
the class OtpTransitServiceBuilderLimitPeriodTest method setUp.
@Before
public void setUp() {
subject = new OtpTransitServiceBuilder();
// Add a service calendar that overlap with the period limit
subject.getCalendars().add(createServiceCalendar(SERVICE_C_IN, D1, D3));
// Add a service calendar that is outside the period limit, expected deleted later
subject.getCalendars().add(createServiceCalendar(SERVICE_C_OUT, D0, D1));
// Add a service calendar date that is within the period limit
subject.getCalendarDates().add(new ServiceCalendarDate(SERVICE_D_IN, D2, 1));
// Add a service calendar date that is OUTSIDE the period limit, expected deleted later
subject.getCalendarDates().add(new ServiceCalendarDate(SERVICE_D_OUT, D1, 1));
// Add 2 stops
subject.getStops().add(STOP_1);
subject.getStops().add(STOP_2);
// Add Route
route.setId(newId());
route.setType(3);
route.setMode(TransitMode.BUS);
subject.getRoutes().add(route);
// Add trips; one for each day and calendar
subject.getTripsById().addAll(List.of(tripCSIn, tripCSOut, tripCSDIn, tripCSDOut));
// Pattern with trips that is partially deleted later
patternInT1 = createTripPattern(List.of(tripCSIn, tripCSOut));
// Pattern with trip that is inside period
patternInT2 = createTripPattern(List.of(tripCSDIn));
// Pattern with trip outside limiting period - pattern is deleted later
TripPattern patternOut = createTripPattern(List.of(tripCSDOut));
subject.getTripPatterns().put(STOP_PATTERN, patternInT1);
subject.getTripPatterns().put(STOP_PATTERN, patternInT2);
subject.getTripPatterns().put(STOP_PATTERN, patternOut);
}
Aggregations