@Test public void testGetIncrementalCost() { assertThat(_routingProcess.getIncrementalCost(ACTIVE_IFACE_NAME, false), equalTo(10L)); final long overrideMetric = 8888L; Builder ospfProcess = OspfProcess.builder() .setProcessId("1") .setRouterId(Ip.ZERO) .setReferenceBandwidth(10e9) .setAreas(ImmutableSortedMap.of(0L, AREA0_CONFIG)) .setMaxMetricTransitLinks(overrideMetric); assertThat( new OspfRoutingProcess(ospfProcess.build(), VRF_NAME, _c, _emptyOspfTopology) .getIncrementalCost(ACTIVE_IFACE_NAME, false), equalTo(overrideMetric)); ospfProcess.setMaxMetricTransitLinks(null).setMaxMetricStubNetworks(overrideMetric); assertThat( new OspfRoutingProcess(ospfProcess.build(), VRF_NAME, _c, _emptyOspfTopology) .getIncrementalCost(ACTIVE_IFACE_NAME, false), equalTo(10L)); assertThat( new OspfRoutingProcess(ospfProcess.build(), VRF_NAME, _c, _emptyOspfTopology) .getIncrementalCost(ACTIVE_IFACE_NAME, true), equalTo(overrideMetric)); assertThat( new OspfRoutingProcess(ospfProcess.build(), VRF_NAME, _c, _emptyOspfTopology) .getIncrementalCost(PASSIVE_IFACE_NAME, false), equalTo(overrideMetric)); }
@VisibleForTesting long getIncrementalCost(String interfaceName, boolean considerP2PasStub) { Interface iface = _c.getAllInterfaces().get(interfaceName); assert iface != null; return getIncrementalCost(iface, considerP2PasStub); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @VisibleForTesting long getIncrementalCost(String interfaceName, boolean considerP2PasStub) { Interface iface = _c.getAllInterfaces().get(interfaceName); assert iface != null; return getIncrementalCost(iface, considerP2PasStub); } }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @VisibleForTesting long getIncrementalCost(String interfaceName, boolean considerP2PasStub) { Interface iface = _c.getAllInterfaces().get(interfaceName); assert iface != null; return getIncrementalCost(iface, considerP2PasStub); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @VisibleForTesting long getIncrementalCost(String interfaceName, boolean considerP2PasStub) { Interface iface = _c.getAllInterfaces().get(interfaceName); assert iface != null; return getIncrementalCost(iface, considerP2PasStub); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); @Override void initialize(Node n); @Override void executeIteration(Map<String, Node> allNodes); @Override void updateTopology(OspfTopology topology); @Nonnull @Override RibDelta<OspfRoute> getUpdatesForMainRib(); @Override void redistribute(RibDelta<? extends AnnotatedRoute<AbstractRoute>> mainRibDelta); @Override boolean isDirty(); }
OspfRoutingProcess implements RoutingProcess<OspfTopology, OspfRoute> { @VisibleForTesting long getIncrementalCost(String interfaceName, boolean considerP2PasStub) { Interface iface = _c.getAllInterfaces().get(interfaceName); assert iface != null; return getIncrementalCost(iface, considerP2PasStub); } OspfRoutingProcess(
      OspfProcess process, String vrfName, Configuration configuration, OspfTopology topology); @Override void initialize(Node n); @Override void executeIteration(Map<String, Node> allNodes); @Override void updateTopology(OspfTopology topology); @Nonnull @Override RibDelta<OspfRoute> getUpdatesForMainRib(); @Override void redistribute(RibDelta<? extends AnnotatedRoute<AbstractRoute>> mainRibDelta); @Override boolean isDirty();  }