Package org.onebusaway.gtfs.services

Examples of org.onebusaway.gtfs.services.MockGtfs


    @Test
    public void testNoBikesByDefault() throws IOException {
        // We configure two trip: one with unknown bikes_allowed and the second with bikes
        // allowed.
        MockGtfs gtfs = getSimpleGtfs();
        gtfs.putTrips(2, "r0", "sid0", "bikes_allowed=0,1");
        gtfs.putStopTimes("t0,t1", "s0,s1");

        GtfsBundles bundles = getGtfsAsBundles(gtfs);
        bundles.getBundles().get(0).setDefaultBikesAllowed(false);
        _builder.setGtfsBundles(bundles);
View Full Code Here


    @Test
    public void testBikesByDefault() throws IOException {
        // We configure two trip: one with unknown bikes_allowed and the second with no bikes
        // allowed.
        MockGtfs gtfs = getSimpleGtfs();
        gtfs.putTrips(2, "r0", "sid0", "bikes_allowed=0,2");
        gtfs.putStopTimes("t0,t1", "s0,s1");

        GtfsBundles bundles = getGtfsAsBundles(gtfs);
        bundles.getBundles().get(0).setDefaultBikesAllowed(true);
        _builder.setGtfsBundles(bundles);
View Full Code Here

        assertEquals(BikeAccess.NOT_ALLOWED,
                BikeAccess.fromTrip(withId(trips, new AgencyAndId("a0", "t1"))));
    }

    private MockGtfs getSimpleGtfs() throws IOException {
        MockGtfs gtfs = MockGtfs.create();
        gtfs.putAgencies(1);
        gtfs.putRoutes(1);
        gtfs.putStops(2);
        gtfs.putCalendars(1);
        gtfs.putTrips(1, "r0", "sid0");
        gtfs.putStopTimes("t0", "s0,s1");
        return gtfs;
    }
View Full Code Here

public class GTFSPatternHopFactoryTest {

    @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");

        GTFSPatternHopFactory factory = new GTFSPatternHopFactory(GtfsLibrary.createContext(gtfs
                .read()));
        Graph graph = new Graph();
        factory.run(graph);

        for (Edge edge : graph.getEdges()) {
View Full Code Here

TOP

Related Classes of org.onebusaway.gtfs.services.MockGtfs

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.