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());
}
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);
}
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);
}
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());
}
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());
}
Aggregations