use of org.whole.lang.grammars.codebase.XmlGrammar in project whole by wholeplatform.
the class GrammarsUtilsTest method testGrammarToModelMapping.
@Test
public void testGrammarToModelMapping() {
Model m = new XmlModel().create();
Grammar g = new XmlGrammar().create();
Model m1 = GrammarsUtils.deriveModel(g, true);
Assert.assertTrue(Matcher.match(m, m1));
}
use of org.whole.lang.grammars.codebase.XmlGrammar in project whole by wholeplatform.
the class GrammarsUtilsTest method setUp.
@Before
public void setUp() throws Exception {
// TODO fix and remove workaround
ReflectionFactory.deployWholePlatform();
Grammar testGrammar1 = new TestGrammar1().create();
testGrammarURI = testGrammar1.getUri().getValue();
if (// TODO fix and remove workaround
!GrammarsRegistry.instance().containsGrammar(testGrammarURI))
InterpreterOperation.interpret(testGrammar1);
Grammar xmlGrammar = new XmlGrammar().create();
xmlGrammarURI = xmlGrammar.getUri().getValue();
if (// TODO fix and remove workaround
!GrammarsRegistry.instance().containsGrammar(xmlGrammarURI))
InterpreterOperation.interpret(xmlGrammar);
}
Aggregations