use of org.whole.lang.grammars.model.Production in project whole by wholeplatform.
the class ControlQueriesTest method testCall4.
@Test
public void testCall4() {
Grammar grammar = new TestXmlGrammar().create();
IBindingManager bm = BindingManagerFactory.instance.createArguments();
ITemplateManager tm = ControlQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("call4");
int count = 0;
for (IEntity p : BehaviorUtils.compileAndLazyEvaluate(query, grammar, bm)) {
assertTrue(Matcher.match(GrammarsEntityDescriptorEnum.Production, p));
assertEquals("IContent", ((Production) p).getName().getValue());
count++;
}
assertEquals(1, count);
}
use of org.whole.lang.grammars.model.Production in project whole by wholeplatform.
the class ControlQueriesTest method testCall6.
@Test
public void testCall6() {
Grammar grammar = new TestXmlGrammar().create();
IBindingManager bm = BindingManagerFactory.instance.createArguments();
ITemplateManager tm = ControlQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("call6");
int count = 0;
for (IEntity p : BehaviorUtils.compileAndLazyEvaluate(query, grammar, bm)) {
assertTrue(Matcher.match(GrammarsEntityDescriptorEnum.Production, p));
assertEquals("IContent", ((Production) p).getName().getValue());
count++;
}
assertEquals(1, count);
}
use of org.whole.lang.grammars.model.Production in project whole by wholeplatform.
the class ControlQueriesTest method testCall3.
@Test
public void testCall3() {
Grammar grammar = new TestXmlGrammar().create();
IBindingManager bm = BindingManagerFactory.instance.createArguments();
ITemplateManager tm = ControlQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("call3");
int count = 0;
for (IEntity p : BehaviorUtils.compileAndLazyEvaluate(query, grammar, bm)) {
assertTrue(Matcher.match(GrammarsEntityDescriptorEnum.Production, p));
assertEquals("IContent", ((Production) p).getName().getValue());
count++;
}
assertEquals(1, count);
}
use of org.whole.lang.grammars.model.Production in project whole by wholeplatform.
the class ControlQueriesTest method testQueryDecl2.
@Test
public void testQueryDecl2() {
Grammar grammar = new TestXmlGrammar().create();
IBindingManager bm = BindingManagerFactory.instance.createArguments();
ITemplateManager tm = ControlQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("queryDecl2");
int count = 0;
for (IEntity p : BehaviorUtils.compileAndLazyEvaluate(query, grammar, bm)) {
assertTrue(Matcher.match(GrammarsEntityDescriptorEnum.Production, p));
assertEquals("IContent", ((Production) p).getName().getValue());
count++;
}
assertEquals(1, count);
}
use of org.whole.lang.grammars.model.Production in project whole by wholeplatform.
the class ControlQueriesTest method testQueryDecl1.
@Test
public void testQueryDecl1() {
Grammar grammar = new TestXmlGrammar().create();
IBindingManager bm = BindingManagerFactory.instance.createArguments();
ITemplateManager tm = ControlQueriesTemplateManager.instance();
PathExpression query = (PathExpression) tm.create("queryDecl1");
int count = 0;
for (IEntity p : BehaviorUtils.compileAndLazyEvaluate(query, grammar, bm)) {
assertTrue(Matcher.match(GrammarsEntityDescriptorEnum.Production, p));
assertEquals("IContent", ((Production) p).getName().getValue());
count++;
}
assertEquals(1, count);
}
Aggregations