pkg.getRules().size() );
final RuleDescr rule = (RuleDescr) pkg.getRules().get( 0 );
assertEquals( 1,
rule.getLhs().getDescrs().size() );
final PatternDescr out = (PatternDescr) rule.getLhs().getDescrs().get( 0 );
final AccumulateDescr accum = (AccumulateDescr) out.getSource();
assertEqualsIgnoreWhitespace( "int x = 0 ;",
accum.getInitCode() );
assertEqualsIgnoreWhitespace( "x++;",
accum.getActionCode() );
assertEqualsIgnoreWhitespace( "x--;",
accum.getReverseCode() );
assertEqualsIgnoreWhitespace( "new Integer(x)",
accum.getResultCode() );
assertFalse( accum.isExternalFunction() );
final PatternDescr pattern = (PatternDescr) accum.getInputPattern();
assertEquals( "Person",
pattern.getObjectType() );
}