@Test
public void testActivateGrammars() throws Exception, JVoiceXMLEvent {

    final String lf = System.getProperty("line.separator");
    final String grammar = "#JSGF V1.0;" + lf + "grammar test;" + lf
            + "public <test> = a|b|c;";
    final File file = File.createTempFile("jvxmltest", ".gram");
    final URI uri = writeToFile(file, grammar);
    final RuleGrammarImplementation impl = (RuleGrammarImplementation) recognizer
            .loadGrammar(uri, GrammarType.JSGF);
    final Collection<GrammarImplementation<?>> implementations = new java.util.ArrayList<GrammarImplementation<?>>();
    implementations.add(impl);
    recognizer.activateGrammars(implementations);
    final Collection<RuleGrammar> active = recognizer.getActiveGrammars();
    Assert.assertEquals(1, active.size());
    Assert.assertTrue(contains("test", active));
}