@Test public void testAsyncRouteAdd() { Route route = new Route(Route.Source.STATIC, V4_PREFIX1, V4_NEXT_HOP1); reset(hostService); expect(hostService.getHostsByIp(anyObject(IpAddress.class))).andReturn( Collections.emptySet()).anyTimes(); hostService.startMonitoringIp(V4_NEXT_HOP1); replay(hostService); replay(routeListener); routeManager.update(Collections.singleton(route)); verify(routeListener); reset(routeListener); routeListener.event(new RouteEvent(RouteEvent.Type.ROUTE_ADDED, new ResolvedRoute(route, MAC1))); replay(routeListener); Host host = createHost(MAC1, V4_NEXT_HOP1); hostListener.event(new HostEvent(HostEvent.Type.HOST_ADDED, host)); verify(routeListener); }
@Override public void update(Collection<Route> routes) { synchronized (this) { routes.forEach(route -> { log.debug("Received update {}", route); routeStore.updateRoute(route); resolve(route); }); } }
RouteManager implements ListenerService<RouteEvent, RouteListener>,
        RouteService, RouteAdminService { @Override public void update(Collection<Route> routes) { synchronized (this) { routes.forEach(route -> { log.debug("Received update {}", route); routeStore.updateRoute(route); resolve(route); }); } } }
RouteManager implements ListenerService<RouteEvent, RouteListener>,
        RouteService, RouteAdminService { @Override public void update(Collection<Route> routes) { synchronized (this) { routes.forEach(route -> { log.debug("Received update {}", route); routeStore.updateRoute(route); resolve(route); }); } }  }
RouteManager implements ListenerService<RouteEvent, RouteListener>,
        RouteService, RouteAdminService { @Override public void update(Collection<Route> routes) { synchronized (this) { routes.forEach(route -> { log.debug("Received update {}", route); routeStore.updateRoute(route); resolve(route); }); } }  @Override void addListener(RouteListener listener); @Override void removeListener(RouteListener listener); @Override Map<RouteTableId, Collection<Route>> getAllRoutes(); @Override Route longestPrefixMatch(IpAddress ip); @Override Collection<Route> getRoutesForNextHop(IpAddress nextHop); @Override Set<NextHop> getNextHops(); @Override void update(Collection<Route> routes); @Override void withdraw(Collection<Route> routes); }
RouteManager implements ListenerService<RouteEvent, RouteListener>,
        RouteService, RouteAdminService { @Override public void update(Collection<Route> routes) { synchronized (this) { routes.forEach(route -> { log.debug("Received update {}", route); routeStore.updateRoute(route); resolve(route); }); } }  @Override void addListener(RouteListener listener); @Override void removeListener(RouteListener listener); @Override Map<RouteTableId, Collection<Route>> getAllRoutes(); @Override Route longestPrefixMatch(IpAddress ip); @Override Collection<Route> getRoutesForNextHop(IpAddress nextHop); @Override Set<NextHop> getNextHops(); @Override void update(Collection<Route> routes); @Override void withdraw(Collection<Route> routes);  }