Examples of Agency


Examples of org.onebusaway.gtfs.model.Agency

                assertEquals(index_vertex, vertex);
            }
        }

        /* Agencies */
        Agency agency;
        agency = graph.index.agencyForId.get("azerty");
        assertNull(agency);
        agency = graph.index.agencyForId.get("agency");
        assertEquals(agency.getId(), "agency");
        assertEquals(agency.getName(), "Fake Agency");

        /* Stops */
        graph.index.stopForId.get(new AgencyAndId("X", "Y"));

        /* Trips */
 
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

    public void setId(String id) {
        this.id = id;
    }

    public void apply(Graph graph) {
        Agency agency = this.agency != null ? graph.index.agencyForId.get(this.agency) : null;
        Route route = this.route != null ? graph.index.routeForId.get(this.route) : null;
        Stop stop = this.stop != null ? graph.index.stopForId.get(this.stop) : null;
        Trip trip = this.trip != null ? graph.index.tripForId.get(this.trip) : null;

        if (route != null || trip != null || agency != null) {
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

            }
        }
    }

    public void remove(Graph graph) {
        Agency agency = this.agency != null ? graph.index.agencyForId.get(this.agency) : null;
        Route route = this.route != null ? graph.index.routeForId.get(this.route) : null;
        Stop stop = this.stop != null ? graph.index.stopForId.get(this.stop) : null;
        Trip trip = this.trip != null ? graph.index.tripForId.get(this.trip) : null;

        if (route != null || trip != null || agency != null) {
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

  }

  @Test
  public void testGenerateAgencyNarratives() {

    Agency agency = new Agency();
    agency.setId("1");
    agency.setLang("en");
    agency.setName("Agency");
    agency.setPhone("555-1234");
    agency.setTimezone("America/New_York");
    agency.setUrl("http://agency.gov/");

    Mockito.when(_gtfsDao.getAllAgencies()).thenReturn(Arrays.asList(agency));

    Modification mod = new Modification();
    mod.setType(AgencyNarrative.class);
    mod.setId("1");
    mod.setProperty("disclaimer");
    mod.setValue("Use at your own risk.");

    _modifications.setModifications(Arrays.asList(mod));

    _task.generateAgencyNarratives(_provider);

    AgencyNarrative narrative = _provider.getNarrativeForAgencyId("1");
    assertEquals(mod.getValue(), narrative.getDisclaimer());
    assertEquals(agency.getLang(), narrative.getLang());
    assertEquals(agency.getName(), narrative.getName());
    assertEquals(agency.getPhone(), narrative.getPhone());
    assertEquals(agency.getTimezone(), narrative.getTimezone());
    assertEquals(agency.getUrl(), narrative.getUrl());
  }
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

  @Test
  public void test() {

    GtfsRelationalDao gtfsDao = Mockito.mock(GtfsRelationalDao.class);

    Agency agency = new Agency();
    agency.setId("1");
    agency.setTimezone("America/Los_Angeles");
    // gtfsDao.saveEntity(agency);

    Route route = new Route();
    route.setId(new AgencyAndId("1", "routeA"));
    route.setAgency(agency);
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

    stopC.setId(aid("stopC"));
    graph.putStopEntry(stop("stopC", 47.66847942216854, -122.37545336180114));

    graph.refreshStopMapping();

    Agency agency = new Agency();
    agency.setId("1");
    agency.setTimezone("America/Los_Angeles");

    Route route = new Route();
    route.setAgency(agency);

    Trip trip = new Trip();
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

    stopD.setId(aid("stopD"));
    graph.putStopEntry(stop("stopD", 47.66947942216854, -122.37545336180114));

    graph.refreshStopMapping();

    Agency agency = new Agency();
    agency.setId("1");
    agency.setTimezone("America/Los_Angeles");

    Route route = new Route();
    route.setAgency(agency);

    Trip trip = new Trip();
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

    stopC.setId(aid("stopC"));
    graph.putStopEntry(stop("stopC", 47.66847942216854, -122.37545336180114));

    graph.refreshStopMapping();

    Agency agency = new Agency();
    agency.setId("1");
    agency.setTimezone("America/Los_Angeles");

    Route route = new Route();
    route.setAgency(agency);

    Trip trip = new Trip();
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

  @Test
  public void testProcessAgencies() {

    GtfsRelationalDao gtfsDao = Mockito.mock(GtfsRelationalDao.class);

    Agency agencyA = new Agency();
    agencyA.setId("A");

    Agency agencyB = new Agency();
    agencyB.setId("B");

    Mockito.when(gtfsDao.getAllAgencies()).thenReturn(
        Arrays.asList(agencyA, agencyB));

    TransitGraphImpl graph = new TransitGraphImpl();
View Full Code Here

Examples of org.onebusaway.gtfs.model.Agency

  @Test
  public void testProcessRoutes() {

    GtfsRelationalDao gtfsDao = Mockito.mock(GtfsRelationalDao.class);

    Agency agency = new Agency();
    agency.setId("A");

    Route routeA = new Route();
    routeA.setAgency(agency);
    routeA.setId(new AgencyAndId("A", "routeA"));
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.