use of org.onebusaway.transit_data_federation.impl.blocks.BlockIndexFactoryServiceImpl in project onebusaway-application-modules by camsys.
the class StopTimeServiceImplTest method setup.
@Before
public void setup() {
_factory = new BlockIndexFactoryServiceImpl();
_stop = stop("stopId", 47.0, -122.0);
_stopId = _stop.getId();
TransitGraphDao graph = Mockito.mock(TransitGraphDao.class);
Mockito.when(graph.getStopEntryForId(_stop.getId(), true)).thenReturn(_stop);
CalendarServiceData data = new CalendarServiceData();
data.putDatesForLocalizedServiceId(lsid("sA"), Arrays.asList(date("2009-09-01 00:00"), date("2009-09-02 00:00")));
data.putDatesForLocalizedServiceId(lsid("sB"), Arrays.asList(date("2009-09-03 00:00")));
CalendarServiceImpl calendarService = new CalendarServiceImpl();
calendarService.setData(data);
_calendarService = new ExtendedCalendarServiceImpl();
_calendarService.setCalendarService(calendarService);
_blockIndexService = Mockito.mock(BlockIndexService.class);
_service = new StopTimeServiceImpl();
_service.setTransitGraphDao(graph);
_service.setCalendarService(_calendarService);
_service.setBlockIndexService(_blockIndexService);
BlockConfigurationEntry bcA = blockConfiguration(block("bA"), serviceIds(lsids("sA"), lsids()));
BlockConfigurationEntry bcB = blockConfiguration(block("bB"), serviceIds(lsids("sB"), lsids()));
_transitGraphDao = Mockito.mock(TransitGraphDao.class);
Mockito.when(_transitGraphDao.getAllBlocks()).thenReturn(Arrays.asList(bcA.getBlock(), bcB.getBlock()));
_calendarService.setTransitGraphDao(_transitGraphDao);
_calendarService.start();
}
use of org.onebusaway.transit_data_federation.impl.blocks.BlockIndexFactoryServiceImpl in project onebusaway-application-modules by camsys.
the class UnitTestingSupport method blockTripIndices.
public static List<BlockTripIndex> blockTripIndices(BlockEntryImpl... blocks) {
List<BlockEntry> list = new ArrayList<BlockEntry>();
for (BlockEntryImpl block : blocks) list.add(block);
BlockIndexFactoryService factory = new BlockIndexFactoryServiceImpl();
return factory.createTripIndices(list);
}
Aggregations