@Test
public void testLoadGrammar() 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);
    Assert.assertNotNull(impl);
    final RuleGrammar ruleGrammar = impl.getGrammarDocument();
    Assert.assertEquals("test", ruleGrammar.getName());
    final RuleAlternatives alternatives = (RuleAlternatives) ruleGrammar
            .getRule("test");
    Assert.assertNotNull(alternatives);
    final Rule[] rules = alternatives.getRules();
    Assert.assertEquals(3, rules.length);
    Assert.assertEquals("a", rules[0].toString());
    Assert.assertEquals("b", rules[1].toString());
    Assert.assertEquals("c", rules[2].toString());
}