use of org.drools.drl.ast.descr.CollectDescr in project drools by kiegroup.
the class RuleParserTest method testCollect.
@Test
public void testCollect() throws Exception {
final PackageDescr pkg = (PackageDescr) parseResource("compilationUnit", "collect.drl");
assertEquals(1, pkg.getRules().size());
final RuleDescr rule = (RuleDescr) pkg.getRules().get(0);
assertEquals(1, rule.getLhs().getDescrs().size());
final PatternDescr outPattern = (PatternDescr) rule.getLhs().getDescrs().get(0);
final CollectDescr collect = (CollectDescr) outPattern.getSource();
final PatternDescr pattern = (PatternDescr) collect.getInputPattern();
assertEquals("Person", pattern.getObjectType());
}
Aggregations