assertEquals( patterncheese.getIdentifier(),
"cheese" );
assertEquals( patterncheese.getObjectType(),
"Cheese" );
AccumulateDescr accumulatedescr = (AccumulateDescr) patterncheese.getSource();
assertEquals( "total += $cheese.getPrice();",
accumulatedescr.getActionCode() );
assertEquals( "int total = 0;",
accumulatedescr.getInitCode() );
assertEquals( "new Integer( total ) );",
accumulatedescr.getResultCode() );
patternobj = obj.getLhs().getDescrs().get( 1 );
assertTrue( patternobj instanceof PatternDescr );
final PatternDescr patternmax = (PatternDescr) patternobj;
assertEquals( patternmax.getIdentifier(),
"max" );
assertEquals( patternmax.getObjectType(),
"Number" );
accumulatedescr = (AccumulateDescr) patternmax.getSource();
assertTrue( accumulatedescr.isExternalFunction() );
assertEquals( "max",
accumulatedescr.getFunctions().get( 0 ).getFunction() );
assertNull( accumulatedescr.getInitCode() );
assertNull( accumulatedescr.getActionCode() );
assertNull( accumulatedescr.getResultCode() );
assertNull( accumulatedescr.getReverseCode() );
}