Search in sources :

Example 1 with Flat_juniper_configurationContext

use of org.batfish.grammar.flatjuniper.FlatJuniperParser.Flat_juniper_configurationContext in project batfish by batfish.

the class FlatJuniperGrammarTest method testParsingRecovery.

@Test
public void testParsingRecovery() {
    String recoveryText = CommonUtil.readResource("org/batfish/grammar/juniper/testconfigs/recovery");
    Settings settings = new Settings();
    FlatJuniperCombinedParser cp = new FlatJuniperCombinedParser(recoveryText, settings);
    Flat_juniper_configurationContext ctx = cp.parse();
    FlatJuniperRecoveryExtractor extractor = new FlatJuniperRecoveryExtractor();
    ParseTreeWalker walker = new ParseTreeWalker();
    walker.walk(extractor, ctx);
    assertThat(extractor.getNumSets(), equalTo(8));
    assertThat(extractor.getNumErrorNodes(), equalTo(8));
}
Also used : Flat_juniper_configurationContext(org.batfish.grammar.flatjuniper.FlatJuniperParser.Flat_juniper_configurationContext) Settings(org.batfish.config.Settings) ParseTreeWalker(org.antlr.v4.runtime.tree.ParseTreeWalker) Test(org.junit.Test)

Aggregations

ParseTreeWalker (org.antlr.v4.runtime.tree.ParseTreeWalker)1 Settings (org.batfish.config.Settings)1 Flat_juniper_configurationContext (org.batfish.grammar.flatjuniper.FlatJuniperParser.Flat_juniper_configurationContext)1 Test (org.junit.Test)1