Package org.onebusaway.gtfs.model.calendar

Examples of org.onebusaway.gtfs.model.calendar.ServiceDate


                1414272600L /* 2014-10-25T23:30:00+02:00 */,
                1414276200L /* 2014-10-26T00:30:00+02:00 */,
                1414279800L /* 2014-10-26T01:30:00+02:00 */
            );

        verifyServiceDays(routingRequest, graph, new ServiceDate(201431), new ServiceDate(201432), new ServiceDate(201433));

        verifyServiceDays(routingRequest, graph, new ServiceDate(20143, 28), new ServiceDate(20143, 29), new ServiceDate(20143, 30));
        verifyServiceDays(routingRequest, graph, new ServiceDate(20143, 28), new ServiceDate(20143, 29), new ServiceDate(20143, 30));
        verifyServiceDays(routingRequest, graph, new ServiceDate(20143, 29), new ServiceDate(20143, 30), new ServiceDate(20143, 31));

        verifyServiceDays(routingRequest, graph, new ServiceDate(201461), new ServiceDate(201462), new ServiceDate(201463));

        verifyServiceDays(routingRequest, graph, new ServiceDate(2014, 10, 24), new ServiceDate(2014, 10, 25), new ServiceDate(2014, 10, 26));
        verifyServiceDays(routingRequest, graph, new ServiceDate(2014, 10, 25), new ServiceDate(2014, 10, 26), new ServiceDate(2014, 10, 27));
        verifyServiceDays(routingRequest, graph, new ServiceDate(2014, 10, 25), new ServiceDate(2014, 10, 26), new ServiceDate(2014, 10, 27));
    }
View Full Code Here


    }

    @Test
    public void testCompare() {
        Timetable orig = new Timetable(null);
        Timetable a = new Timetable(orig, new ServiceDate().previous());
        Timetable b = new Timetable(orig, new ServiceDate());
        assertEquals(-1, (new TimetableResolver.SortedTimetableComparator()).compare(a, b));
    }
View Full Code Here

        assertEquals(-1, (new TimetableResolver.SortedTimetableComparator()).compare(a, b));
    }

    @Test
    public void testResolve() {
        ServiceDate today = new ServiceDate();
        ServiceDate yesterday = today.previous();
        ServiceDate tomorrow = today.next();
        TripPattern pattern = patternIndex.get(new AgencyAndId("agency", "1.1"));
        TimetableResolver resolver = new TimetableResolver();

        Timetable scheduled = resolver.resolve(pattern, today);
        assertEquals(scheduled, resolver.resolve(pattern, null));
View Full Code Here

        assertEquals(scheduled, resolver.resolve(pattern, null));
    }

    @Test(expected=ConcurrentModificationException.class)
    public void testUpdate() {
        ServiceDate today = new ServiceDate();
        ServiceDate yesterday = today.previous();
        TripPattern pattern = patternIndex.get(new AgencyAndId("agency", "1.1"));

        TimetableResolver resolver = new TimetableResolver();
        Timetable origNow = resolver.resolve(pattern, today);
View Full Code Here

        snapshot.update(pattern, tripUpdate, "agency", timeZone, yesterday);
    }

    @Test(expected=ConcurrentModificationException.class)
    public void testCommit() {
        ServiceDate today = new ServiceDate();
        ServiceDate yesterday = today.previous();
        TripPattern pattern = patternIndex.get(new AgencyAndId("agency", "1.1"));

        TimetableResolver resolver = new TimetableResolver();

        // only return a new snapshot if there are changes
View Full Code Here

        snapshot.commit();
    }

    @Test
    public void testPurge() {
        ServiceDate today = new ServiceDate();
        ServiceDate yesterday = today.previous();
        TripPattern pattern = patternIndex.get(new AgencyAndId("agency", "1.1"));

        TripDescriptor.Builder tripDescriptorBuilder = TripDescriptor.newBuilder();

        tripDescriptorBuilder.setTripId("1.1");
View Full Code Here

        // Revert the graph, thus using the original transfer table again
        reset(graph);
    }

    public void testTimedStopToStopTransfer() throws ParseException {
        ServiceDate serviceDate = new ServiceDate(2009, 10, 01);

        // Plan short trip
        TestPlanner planner = new TestPlanner(
                "portland", "45.506077,-122.621139", "45.464637,-122.706061");
View Full Code Here

            assertEquals(expectedLegs, itinerary.legs.size());
        }
    }

    public void testTripToTripTransfer() throws ParseException {
        ServiceDate serviceDate = new ServiceDate(2009, 10, 01);

        // Plan short trip
        TestPlanner planner = new TestPlanner(
                "portland", "45.5264892578125,-122.60479259490967", "45.511622,-122.645564");
View Full Code Here

        reset(graph);
    }
    */

    public void testTimedTripToTripTransfer() throws ParseException {
        ServiceDate serviceDate = new ServiceDate(2009, 10, 01);

        // Plan short trip
        TestPlanner planner = new TestPlanner(
                "portland", "45.506077,-122.621139", "45.464637,-122.706061");

View Full Code Here

     */
    public ServiceDay(Graph graph, long time, CalendarService cs, String agencyId) {
        TimeZone timeZone = cs.getTimeZoneForAgencyId(agencyId);
        GregorianCalendar calendar = new GregorianCalendar(timeZone);
        calendar.setTime(new Date(time * 1000));
        serviceDate = new ServiceDate(calendar);

        init(graph, cs, timeZone);
    }
View Full Code Here

TOP

Related Classes of org.onebusaway.gtfs.model.calendar.ServiceDate

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.