ruleDescr.getName() );
AndDescr lhs = ruleDescr.getLhs();
PatternDescr patternDescr = (PatternDescr) lhs.getDescrs().get( 0 );
assertEquals( "Person",
patternDescr.getObjectType() );
ExprConstraintDescr expr = ( ExprConstraintDescr ) ((AndDescr)patternDescr.getConstraint()).getDescrs().get( 0 );
assertEquals( "name == \"darth\"", expr.getExpression() );
ruleDescr = (RuleDescr) packageDescr.getRules().get( 1 );
assertEquals( "simple_rule2",
ruleDescr.getName() );
lhs = ruleDescr.getLhs();
patternDescr = (PatternDescr) lhs.getDescrs().get( 0 );
assertEquals( "Person",
patternDescr.getObjectType() );
expr = ( ExprConstraintDescr ) ((AndDescr)patternDescr.getConstraint()).getDescrs().get( 0 );
assertEquals( "age == 35 || == -3.5", expr.getExpression() );
ruleDescr = (RuleDescr) packageDescr.getRules().get( 2 );
assertEquals( "simple_rule3",
ruleDescr.getName() );
lhs = ruleDescr.getLhs();
patternDescr = (PatternDescr) lhs.getDescrs().get( 0 );
assertEquals( "Person",
patternDescr.getObjectType() );
expr = ( ExprConstraintDescr ) ((AndDescr)patternDescr.getConstraint()).getDescrs().get( 0 );
assertEquals( "age == 35 || (!= 7.0 && != -70)", expr.getExpression() );
ruleDescr = (RuleDescr) packageDescr.getRules().get( 3 );
assertEquals( "simple_rule3",
ruleDescr.getName() );
lhs = ruleDescr.getLhs();
patternDescr = (PatternDescr) lhs.getDescrs().get( 1 );
assertEquals( "Person",
patternDescr.getObjectType() );
expr = ( ExprConstraintDescr ) ((AndDescr)patternDescr.getConstraint()).getDescrs().get( 0 );
assertEquals( "name == $s", expr.getExpression() );
ruleDescr = (RuleDescr) packageDescr.getRules().get( 4 );
assertEquals( "simple_rule4",
ruleDescr.getName() );
lhs = ruleDescr.getLhs();
patternDescr = (PatternDescr) lhs.getDescrs().get( 1 );
assertEquals( "Person",
patternDescr.getObjectType() );
expr = ( ExprConstraintDescr ) ((AndDescr)patternDescr.getConstraint()).getDescrs().get( 0 );
assertEquals( "(name == $s) || (age == 35 || (!= 7.0 && != -70))", expr.getExpression() );
ruleDescr = (RuleDescr) packageDescr.getRules().get( 5 );
assertEquals( "simple_rule5",
ruleDescr.getName() );
lhs = ruleDescr.getLhs();
patternDescr = (PatternDescr) lhs.getDescrs().get( 1 );
assertEquals( "Person",
patternDescr.getObjectType() );
expr = ( ExprConstraintDescr ) ((AndDescr)patternDescr.getConstraint()).getDescrs().get( 0 );
assertEquals( "(name == $s) || ((age != 34) && (age != 37) && (name != \"yoda\"))", expr.getExpression() );
}