@Test
    void testAutomataRuleBase() {
        RuleBase ruleBase = searcher.getDefaultRuleBase();
        assertEquals(RuleBase.class, ruleBase.getClass());
        assertTrue(ruleBase.getSource().endsWith(root + "automatarules.sr"));
        assertEquals(root + "semantics.fsa", ruleBase.getAutomataFile());

        Query query = new Query("?query=sony+digital+camera");
        ruleBase.analyze(query, 0);
        assertEquals("RANK (WEAKAND(100) sony digital camera) dsp1:sony dsp5:digicamera", query.getModel().getQueryTree().getRoot().toString());

        query = new Query("?query=sony+digital+camera&rules.reload");
        ruleBase = searcher.getDefaultRuleBase();
        assertTrue(ruleBase.getSource().endsWith(root + "automatarules.sr"));
        assertEquals(root + "semantics.fsa", ruleBase.getAutomataFile());
        ruleBase.analyze(query, 0);
        assertEquals("RANK (WEAKAND(100) sony digital camera) dsp1:sony dsp5:digicamera", query.getModel().getQueryTree().getRoot().toString());
    }
Tests rule bases using automatas for matching

@author bratseth
container-search/src/test/java/com/yahoo/prelude/semantics/test/AutomataTestCase.java