Search in sources :

Example 11 with LocalizedServiceId

use of org.onebusaway.gtfs.model.calendar.LocalizedServiceId in project onebusaway-gtfs-modules by OneBusAway.

the class CalendarServiceImplSyntheticTest method testGetServiceDatesWithinRange01.

@Test
public void testGetServiceDatesWithinRange01() {
    Date from = date("2010-02-01 07:00 Pacific Standard Time");
    Date to = date("2010-02-01 08:00 Pacific Standard Time");
    Map<LocalizedServiceId, List<Date>> result = service.getServiceDatesWithinRange(intervals, from, to);
    assertEquals(2, result.size());
    List<Date> dates = result.get(lsid1);
    assertEquals(1, dates.size());
    assertEquals(d1.getAsDate(tz), dates.get(0));
    dates = result.get(lsid3);
    assertEquals(1, dates.size());
    assertEquals(d1.getAsDate(tz), dates.get(0));
}
Also used : LocalizedServiceId(org.onebusaway.gtfs.model.calendar.LocalizedServiceId) ArrayList(java.util.ArrayList) List(java.util.List) ServiceDate(org.onebusaway.gtfs.model.calendar.ServiceDate) Date(java.util.Date) Test(org.junit.Test)

Aggregations

Date (java.util.Date)11 LocalizedServiceId (org.onebusaway.gtfs.model.calendar.LocalizedServiceId)11 ServiceDate (org.onebusaway.gtfs.model.calendar.ServiceDate)11 ArrayList (java.util.ArrayList)9 Test (org.junit.Test)9 List (java.util.List)8 CalendarServiceData (org.onebusaway.gtfs.model.calendar.CalendarServiceData)4 TimeZone (java.util.TimeZone)3 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)3 GtfsRelationalDaoImpl (org.onebusaway.gtfs.impl.GtfsRelationalDaoImpl)2 ServiceCalendarDate (org.onebusaway.gtfs.model.ServiceCalendarDate)2 HashMap (java.util.HashMap)1 HashSet (java.util.HashSet)1 Map (java.util.Map)1 Agency (org.onebusaway.gtfs.model.Agency)1 ServiceCalendar (org.onebusaway.gtfs.model.ServiceCalendar)1 Trip (org.onebusaway.gtfs.model.Trip)1 ServiceInterval (org.onebusaway.gtfs.model.calendar.ServiceInterval)1