final RuleDescr rule = (RuleDescr) pkg.getRules().get( 0 );
assertEquals( "simple_rule",
rule.getName() );
// we will have 3 children under the main And node
final AndDescr and = rule.getLhs();
assertEquals( 3,
and.getDescrs().size() );
PatternDescr left = (PatternDescr) and.getDescrs().get( 0 );
PatternDescr right = (PatternDescr) and.getDescrs().get( 1 );
assertEquals( "Person",
left.getObjectType() );
assertEquals( "Cheese",
right.getObjectType() );
assertEquals( 1,
left.getConstraint().getDescrs().size() );
ExprConstraintDescr fld = (ExprConstraintDescr) left.getConstraint().getDescrs().get( 0 );
assertEquals( "name == \"mark\"",
fld.getExpression() );
assertEquals( 1,
right.getConstraint().getDescrs().size() );
fld = (ExprConstraintDescr) right.getConstraint().getDescrs().get( 0 );
assertEquals( "type == \"stilton\"",
fld.getExpression() );
// now the "||" part
final OrDescr or = (OrDescr) and.getDescrs().get( 2 );
assertEquals( 2,
or.getDescrs().size() );
left = (PatternDescr) or.getDescrs().get( 0 );
right = (PatternDescr) or.getDescrs().get( 1 );
assertEquals( "Person",