use of org.onebusaway.collections.beans.PropertyMethod in project onebusaway-gtfs-modules by OneBusAway.
the class PropertyMethodResolverImplTest method testRouteTripsVirtualMethod.
@Test
public void testRouteTripsVirtualMethod() throws IllegalArgumentException, IllegalAccessException, InvocationTargetException {
Route route = new Route();
route.setId(new AgencyAndId("1", "r0"));
_dao.saveEntity(route);
Trip trip = new Trip();
trip.setId(new AgencyAndId("1", "t0"));
trip.setRoute(route);
_dao.saveEntity(trip);
PropertyMethod method = _resolver.getPropertyMethod(Route.class, "trips");
assertEquals(Arrays.asList(trip), method.invoke(route));
}
Aggregations