Package org.onebusaway.transit_data_federation.model.narrative

Examples of org.onebusaway.transit_data_federation.model.narrative.RouteCollectionNarrative


    Mockito.when(_gtfsDao.getRouteForId(r1.getId())).thenReturn(route1);
    Mockito.when(_gtfsDao.getRouteForId(r2.getId())).thenReturn(route2);

    _task.generateRouteNarratives(_provider);

    RouteCollectionNarrative narrative = _provider.getNarrativeForRouteCollectionId(rc.getId());
    assertEquals(route2.getColor(), narrative.getColor());
    assertEquals(route2.getDesc(), narrative.getDescription());
    assertEquals(route2.getLongName(), narrative.getLongName());
    assertEquals(route2.getShortName(), narrative.getShortName());
    assertEquals(route2.getTextColor(), narrative.getTextColor());
    assertEquals(route2.getType(), narrative.getType());
    assertEquals(route2.getUrl(), narrative.getUrl());
  }
View Full Code Here


    routeBuilder.setLongName("route long name");
    routeBuilder.setShortName("route short name");
    routeBuilder.setTextColor("red");
    routeBuilder.setType(3);
    routeBuilder.setUrl("http://wwww.route.com");
    RouteCollectionNarrative route = routeBuilder.create();

    AgencyBean agency = new AgencyBean();
    Mockito.when(_agencyBeanService.getAgencyForId("1")).thenReturn(agency);

    Mockito.when(_narrativeService.getRouteCollectionForId(routeId)).thenReturn(
        route);
    RouteBean bean = _service.getRouteForId(routeId);

    assertEquals(route.getColor(), bean.getColor());
    assertEquals(route.getDescription(), bean.getDescription());
    assertEquals(AgencyAndIdLibrary.convertToString(routeId), bean.getId());
    assertEquals(route.getLongName(), bean.getLongName());
    assertEquals(route.getShortName(), bean.getShortName());
    assertEquals(route.getTextColor(), bean.getTextColor());
    assertEquals(route.getType(), bean.getType());
    assertEquals(route.getUrl(), bean.getUrl());
  }
View Full Code Here

    _blockIndexService = blockIndexService;
  }

  @Cacheable
  public RouteBean getRouteForId(AgencyAndId id) {
    RouteCollectionNarrative rc = _narrativeService.getRouteCollectionForId(id);
    if (rc == null)
      return null;
    return getRouteBeanForRouteCollection(id, rc);
  }
View Full Code Here

  }

  @Cacheable
  public StopsForRouteBean getStopsForRoute(AgencyAndId routeId) {
    RouteCollectionEntry routeCollectionEntry = _transitGraphDao.getRouteCollectionForId(routeId);
    RouteCollectionNarrative narrative = _narrativeService.getRouteCollectionForId(routeId);
    if (routeCollectionEntry == null || narrative == null)
      return null;
    return getStopsForRouteCollectionAndNarrative(routeCollectionEntry,
        narrative);
  }
View Full Code Here

  private void buildIndex() throws IOException, ParseException {
    IndexWriter writer = new IndexWriter(_bundle.getRouteSearchIndexPath(),
        new StandardAnalyzer(), true, IndexWriter.MaxFieldLength.LIMITED);
    for (RouteCollectionEntry routeCollection : _transitGraphDao.getAllRouteCollections()) {
      RouteCollectionNarrative narrative = _narrativeService.getRouteCollectionForId(routeCollection.getId());
      Document document = getRouteCollectionAsDocument(routeCollection,
          narrative);
      writer.addDocument(document);
    }
    writer.optimize();
View Full Code Here

TOP

Related Classes of org.onebusaway.transit_data_federation.model.narrative.RouteCollectionNarrative

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.