public IncrementalBdpAnswerElement() { _bgpBestPathRibRoutesByIteration = new TreeMap<>(); _bgpMultipathRibRoutesByIteration = new TreeMap<>(); _mainRibRoutesByIteration = new TreeMap<>(); _warnings = new Warnings(); }
public void addRedFlagWarning(String name, Warning warning) { _warnings.computeIfAbsent(name, n -> new Warnings()).getRedFlagWarnings().add(warning); }
public void addUnimplementedWarning(String name, Warning warning) { _warnings.computeIfAbsent(name, n -> new Warnings()).getUnimplementedWarnings().add(warning); }
@Override public ParseVendorConfigurationAnswerElement loadParseVendorConfigurationAnswerElement() { ParseVendorConfigurationAnswerElement pvcae = new ParseVendorConfigurationAnswerElement(); Warnings warnings = new Warnings(); warnings.getParseWarnings().add(new ParseWarning(3, "text", "ctx", "comment")); pvcae.setWarnings(ImmutableSortedMap.of("nowarnings", new Warnings(), "f", warnings)); return pvcae; } }
@Override public ConvertConfigurationAnswerElement loadConvertConfigurationAnswerElementOrReparse() { ConvertConfigurationAnswerElement ccae = new ConvertConfigurationAnswerElement(); Warnings warnings1 = new Warnings(true, true, true); warnings1.unimplemented("unimplemented1"); Warnings warnings2 = new Warnings(true, true, true); warnings2.redFlag("redflag2"); ccae.setWarnings(ImmutableSortedMap.of("node1", warnings1, "node2", warnings2)); return ccae; } }
public static Warnings buildWarnings(Settings settings) { return new Warnings( settings.getPedanticRecord() && settings.getLogger().isActive(BatfishLogger.LEVEL_PEDANTIC), settings.getRedFlagRecord() && settings.getLogger().isActive(BatfishLogger.LEVEL_REDFLAG), settings.getUnimplementedRecord() && settings.getLogger().isActive(BatfishLogger.LEVEL_UNIMPLEMENTED)); }
@Test public void testAggregateDuplicateWarnings() { Warnings f1Warnings = new Warnings(); f1Warnings .getParseWarnings() .addAll( ImmutableList.of( new ParseWarning(3, "dup", "[configuration]", null), new ParseWarning(4, "dup", "[configuration]", null), new ParseWarning(5, "unique", "[configuration]", null))); Warnings f2Warnings = new Warnings(); f2Warnings .getParseWarnings() .addAll(ImmutableList.of(new ParseWarning(23, "dup", "[configuration]", null))); Map<String, Warnings> fileWarnings = ImmutableMap.of("f1", f1Warnings, "f2", f2Warnings); assertThat( aggregateDuplicateWarnings(fileWarnings), equalTo( ImmutableMap.of( new WarningTriplet("dup", "[configuration]", null), ImmutableMap.of("f1", ImmutableSortedSet.of(3, 4), "f2", ImmutableSortedSet.of(23)), new WarningTriplet("unique", "[configuration]", null), ImmutableMap.of("f1", ImmutableSortedSet.of(5))))); }
@Before public void initializeFactory() { NetworkFactory nf = new NetworkFactory(); _c = nf.configurationBuilder().setConfigurationFormat(ConfigurationFormat.CISCO_IOS).build(); _rpb = nf.routingPolicyBuilder().setOwner(_c); _w = new Warnings(true, true, true); }
Warnings w = new Warnings(); c.computeRoutingPolicySources(w);