use of org.opentripplanner.gtfs.GtfsContextBuilder in project OpenTripPlanner by opentripplanner.
the class GeometryAndBlockProcessorTest method testBikesAllowed.
@Test
public void testBikesAllowed() throws IOException {
MockGtfs gtfs = MockGtfs.create();
gtfs.putAgencies(1);
gtfs.putRoutes(1);
gtfs.putStops(2);
gtfs.putCalendars(1);
gtfs.putTrips(1, "r0", "sid0", "bikes_allowed=1");
gtfs.putStopTimes("t0", "s0,s1");
gtfs.putLines("frequencies.txt", "trip_id,start_time,end_time,headway_secs", "t0,09:00:00,17:00:00,300");
GtfsFeedId feedId = new GtfsFeedId.Builder().id("FEED").build();
Graph graph = new Graph();
GtfsContext context = new GtfsContextBuilder(feedId, gtfs.read()).withIssueStoreAndDeduplicator(graph).build();
GeometryAndBlockProcessor factory = new GeometryAndBlockProcessor(context);
factory.run(graph);
}
use of org.opentripplanner.gtfs.GtfsContextBuilder in project OpenTripPlanner by opentripplanner.
the class OtpTransitServiceImplTest method setup.
@BeforeClass
public static void setup() throws IOException {
GtfsContextBuilder contextBuilder = contextBuilder(FEED_ID, ConstantsForTests.FAKE_GTFS);
OtpTransitServiceBuilder builder = contextBuilder.getTransitBuilder();
agency = first(builder.getAgenciesById().values());
// Supplement test data with at least one entity in all collections
FareRule rule = createFareRule();
builder.getFareAttributes().add(rule.getFare());
builder.getFareRules().add(rule);
builder.getFeedInfos().add(new FeedInfo());
subject = builder.build();
}
use of org.opentripplanner.gtfs.GtfsContextBuilder in project OpenTripPlanner by opentripplanner.
the class CalendarServiceDataFactoryImplTest method createCtxBuilder.
private static GtfsContext createCtxBuilder() throws IOException {
GtfsContextBuilder ctxBuilder = contextBuilder(FEED_ID, ConstantsForTests.FAKE_GTFS);
OtpTransitServiceBuilder builder = ctxBuilder.withDataImportIssueStore(new DataImportIssueStore(false)).getTransitBuilder();
Agency agency = agency(builder);
// Supplement test data with at least one entity in all collections
builder.getCalendarDates().add(removeMondayFromAlldays());
builder.getFareAttributes().add(createFareAttribute(agency));
builder.getFareRules().add(new FareRule());
builder.getFeedInfos().add(new FeedInfo());
return ctxBuilder.build();
}
Aggregations