Search in sources :

Example 81 with Stop

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

the class EntityRetentionGraphTest method testRetainStop.

@Test
public void testRetainStop() {
    Stop stop = _dao.getStopForId(aid("A"));
    _graph.retainUp(stop);
    // 9 stop_times + 3 trips + 1 route + 1 agency + 3 stops + 1 service id + 1
    // calendar
    assertEquals(19, _graph.getSize());
    assertTrue(_graph.isRetained(_dao.getStopForId(aid("A"))));
    assertTrue(_graph.isRetained(_dao.getStopForId(aid("B"))));
    assertTrue(_graph.isRetained(_dao.getStopForId(aid("C"))));
    assertFalse(_graph.isRetained(_dao.getStopForId(aid("D"))));
    assertTrue(_graph.isRetained(_dao.getTripForId(aid("1.1"))));
    assertTrue(_graph.isRetained(_dao.getTripForId(aid("1.2"))));
    assertTrue(_graph.isRetained(_dao.getTripForId(aid("1.3"))));
    assertFalse(_graph.isRetained(_dao.getTripForId(aid("2.1"))));
    assertTrue(_graph.isRetained(_dao.getRouteForId(aid("1"))));
    assertFalse(_graph.isRetained(_dao.getRouteForId(aid("2"))));
    assertTrue(_graph.isRetained(_dao.getAgencyForId("agency")));
    _graph.retainUp(stop);
    assertEquals(19, _graph.getSize());
}
Also used : Stop(org.onebusaway.gtfs.model.Stop) Test(org.junit.Test)

Example 82 with Stop

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

the class DeferredValueConverterTest method testAgencAndId_ExistingAgencyId.

@Test
public void testAgencAndId_ExistingAgencyId() {
    Stop stop = new Stop();
    stop.setId(new AgencyAndId("2", "456"));
    Object value = convert(stop, "id", "123");
    assertEquals(new AgencyAndId("2", "123"), value);
}
Also used : AgencyAndId(org.onebusaway.gtfs.model.AgencyAndId) Stop(org.onebusaway.gtfs.model.Stop) Test(org.junit.Test)

Example 83 with Stop

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

the class DeferredValueConverterTest method testDouble.

@Test
public void testDouble() {
    Object value = convert(new Stop(), "lat", "47.1");
    assertEquals(new Double(47.1), value);
}
Also used : Stop(org.onebusaway.gtfs.model.Stop) Test(org.junit.Test)

Example 84 with Stop

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

the class DeferredValueSetterTest method testInteger.

@Test
public void testInteger() {
    DeferredValueSetter setter = createSetter(1);
    Stop stop = new Stop();
    setter.setValue(BeanWrapperFactory.wrap(stop), "locationType");
    assertEquals(1, stop.getLocationType());
}
Also used : Stop(org.onebusaway.gtfs.model.Stop) Test(org.junit.Test)

Example 85 with Stop

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

the class ReplaceValueSetterTest method test.

@Test
public void test() {
    ReplaceValueSetter setter = new ReplaceValueSetter("cats", "dogs");
    Stop stop = new Stop();
    stop.setName("I like cats.");
    setter.setValue(BeanWrapperFactory.wrap(stop), "name");
    assertEquals("I like dogs.", stop.getName());
}
Also used : Stop(org.onebusaway.gtfs.model.Stop) Test(org.junit.Test)

Aggregations

Stop (org.onebusaway.gtfs.model.Stop)160 AgencyAndId (org.onebusaway.gtfs.model.AgencyAndId)75 TransitStop (org.opentripplanner.routing.vertextype.TransitStop)49 Trip (org.onebusaway.gtfs.model.Trip)40 Test (org.junit.Test)39 ArrayList (java.util.ArrayList)33 StopTime (org.onebusaway.gtfs.model.StopTime)33 Route (org.onebusaway.gtfs.model.Route)28 TripPattern (org.opentripplanner.routing.edgetype.TripPattern)23 Agency (org.onebusaway.gtfs.model.Agency)19 Vertex (org.opentripplanner.routing.graph.Vertex)18 HashMap (java.util.HashMap)14 TripTimes (org.opentripplanner.routing.trippattern.TripTimes)13 GtfsMutableRelationalDao (org.onebusaway.gtfs.services.GtfsMutableRelationalDao)11 LineString (com.vividsolutions.jts.geom.LineString)10 List (java.util.List)10 GET (javax.ws.rs.GET)10 ShapePoint (org.onebusaway.gtfs.model.ShapePoint)10 GraphPath (org.opentripplanner.routing.spt.GraphPath)10 Coordinate (com.vividsolutions.jts.geom.Coordinate)9