@Test public void testConversionError() { AsPath unsupportedRegex = new AsPath("this is not a valid as-path regex"); Warnings w = new Warnings(true, true, true); BooleanExpr ret = PsFromAsPath.toBooleanExpr(unsupportedRegex, w); assertThat(ret, is(BooleanExprs.FALSE)); assertThat(w.getRedFlagWarnings(), hasSize(1)); assertThat( Iterables.getOnlyElement(w.getRedFlagWarnings()).getText(), containsString("Error converting Juniper as-path regex")); }
@Override public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) { Map<String, AsPath> asPaths = jc.getMasterLogicalSystem().getAsPaths(); return toBooleanExpr(asPaths.get(_asPathName), warnings); }
PsFromAsPath extends PsFrom { @Override public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) { Map<String, AsPath> asPaths = jc.getMasterLogicalSystem().getAsPaths(); return toBooleanExpr(asPaths.get(_asPathName), warnings); } }
PsFromAsPath extends PsFrom { @Override public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) { Map<String, AsPath> asPaths = jc.getMasterLogicalSystem().getAsPaths(); return toBooleanExpr(asPaths.get(_asPathName), warnings); } PsFromAsPath(String asPathName); }
PsFromAsPath extends PsFrom { @Override public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) { Map<String, AsPath> asPaths = jc.getMasterLogicalSystem().getAsPaths(); return toBooleanExpr(asPaths.get(_asPathName), warnings); } PsFromAsPath(String asPathName); @Override BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings); }
PsFromAsPath extends PsFrom { @Override public BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings) { Map<String, AsPath> asPaths = jc.getMasterLogicalSystem().getAsPaths(); return toBooleanExpr(asPaths.get(_asPathName), warnings); } PsFromAsPath(String asPathName); @Override BooleanExpr toBooleanExpr(JuniperConfiguration jc, Configuration c, Warnings warnings);  }