Skip to content

Commit

Permalink
Add test for AreaStop
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardehrenfried committed Jun 17, 2024
1 parent 711c59d commit 1ddadf2
Show file tree
Hide file tree
Showing 17 changed files with 30 additions and 94,344 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,19 @@

import static graphql.Assert.assertTrue;

import gnu.trove.set.hash.TIntHashSet;
import java.io.File;
import java.time.LocalDate;
import java.time.LocalTime;
import java.util.List;
import java.util.Map;
import org.opentripplanner.ConstantsForTests;
import org.opentripplanner.TestOtpModel;
import org.opentripplanner.ext.flex.flexpathcalculator.DirectFlexPathCalculator;
import org.opentripplanner.ext.flex.template.FlexServiceDate;
import org.opentripplanner.framework.application.OTPFeature;
import org.opentripplanner.gtfs.graphbuilder.GtfsBundle;
import org.opentripplanner.gtfs.graphbuilder.GtfsModule;
import org.opentripplanner.model.calendar.ServiceDateInterval;
import org.opentripplanner.routing.graph.Graph;
import org.opentripplanner.test.support.ResourceLoader;
import org.opentripplanner.transit.model.framework.Deduplicator;
import org.opentripplanner.transit.model.timetable.booking.RoutingBookingInfo;
import org.opentripplanner.transit.service.StopModel;
import org.opentripplanner.transit.service.TransitModel;

Expand All @@ -31,19 +26,8 @@ public final class FlexIntegrationTestData {
static final File COBB_BUS_30_GTFS = RES.file("cobblinc-bus-30-only.gtfs.zip");
static final File COBB_FLEX_GTFS = RES.file("cobblinc-scheduled-deviated-flex.gtfs");
private static final File COBB_OSM = RES.file("cobb-county.filtered.osm.pbf");
private static final File LINCOLN_COUNTY_GTFS = RES.file("lincoln-county-flex.gtfs");
static final File MARTA_BUS_856_GTFS = RES.file("marta-bus-856-only.gtfs.zip");

public static final DirectFlexPathCalculator CALCULATOR = new DirectFlexPathCalculator();
private static final LocalDate SERVICE_DATE = LocalDate.of(2021, 4, 11);
private static final int SECONDS_SINCE_MIDNIGHT = LocalTime.of(10, 0).toSecondOfDay();
public static final FlexServiceDate FLEX_DATE = new FlexServiceDate(
SERVICE_DATE,
SECONDS_SINCE_MIDNIGHT,
RoutingBookingInfo.NOT_SET,
new TIntHashSet()
);

public static TestOtpModel aspenGtfs() {
return buildFlexGraph(ASPEN_GTFS);
}
Expand All @@ -52,18 +36,6 @@ public static TestOtpModel cobbFlexGtfs() {
return buildFlexGraph(COBB_FLEX_GTFS);
}

public static TestOtpModel cobbBus30Gtfs() {
return buildFlexGraph(COBB_BUS_30_GTFS);
}

public static TestOtpModel martaBus856Gtfs() {
return buildFlexGraph(MARTA_BUS_856_GTFS);
}

public static TestOtpModel lincolnCountyGtfs() {
return buildFlexGraph(LINCOLN_COUNTY_GTFS);
}

public static TestOtpModel cobbOsm() {
return ConstantsForTests.buildOsmGraph(COBB_OSM);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import static org.junit.jupiter.api.Assertions.assertEquals;
import static org.junit.jupiter.api.Assertions.assertFalse;
import static org.junit.jupiter.api.Assertions.assertNotNull;
import static org.opentripplanner.test.support.PolylineAssert.assertThatPolylinesAreEqual;

import java.time.LocalDateTime;
Expand Down Expand Up @@ -188,15 +187,6 @@ void shouldNotInterpolateFlexTimes() {
assertEquals(StopTime.MISSING_VALUE, arrivalTime);
}

/**
* Checks that trips which have continuous pick up/drop off set are parsed correctly.
*/
@Test
void parseContinuousPickup() {
var lincolnGraph = FlexIntegrationTestData.lincolnCountyGtfs();
assertNotNull(lincolnGraph);
}

@BeforeAll
static void setup() {
TestOtpModel model = FlexIntegrationTestData.cobbFlexGtfs();
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Loading

0 comments on commit 1ddadf2

Please sign in to comment.