pattern.getObjectType() );
assertEquals( 1,
pattern.getConstraint().getDescrs().size() );
AndDescr and = (AndDescr) pattern.getConstraint();
FieldConstraintDescr fld = (FieldConstraintDescr) and.getDescrs().get( 0 );
assertEquals( RestrictionConnectiveDescr.AND,
((RestrictionConnectiveDescr) fld.getRestriction()).getConnective() );
assertEquals( 2,
fld.getRestrictions().size() );
assertEquals( "age",
fld.getFieldName() );
LiteralRestrictionDescr lit = (LiteralRestrictionDescr) fld.getRestrictions().get( 0 );
assertEquals( ">",
lit.getEvaluator() );
assertEquals( "30",
lit.getText() );
lit = (LiteralRestrictionDescr) fld.getRestrictions().get( 1 );
assertEquals( "<",
lit.getEvaluator() );
assertEquals( "40",
lit.getText() );
//the second col, with 2 fields, the first with 2 restrictions, the second field with one
pattern = (PatternDescr) rule.getLhs().getDescrs().get( 1 );
assertEquals( "Vehicle",
pattern.getObjectType() );
assertEquals( 2,
pattern.getConstraint().getDescrs().size() );
and = (AndDescr) pattern.getConstraint();
fld = (FieldConstraintDescr) and.getDescrs().get( 0 );
assertEquals( "type",
fld.getFieldName() );
assertEquals( 1,
fld.getRestrictions().size() );
RestrictionConnectiveDescr or = (RestrictionConnectiveDescr) fld.getRestrictions().get( 0 );
assertEquals( RestrictionConnectiveDescr.OR,
or.getConnective() );
assertEquals( 2,
or.getRestrictions().size() );
lit = (LiteralRestrictionDescr) or.getRestrictions().get( 0 );
assertEquals( "==",
lit.getEvaluator() );
assertEquals( "sedan",
lit.getText() );
lit = (LiteralRestrictionDescr) or.getRestrictions().get( 1 );
assertEquals( "==",
lit.getEvaluator() );
assertEquals( "wagon",
lit.getText() );
//now the second field
fld = (FieldConstraintDescr) and.getDescrs().get( 1 );
assertEquals( 1,
fld.getRestrictions().size() );
lit = (LiteralRestrictionDescr) fld.getRestrictions().get( 0 );
assertEquals( "<",
lit.getEvaluator() );
assertEquals( "3",
lit.getText() );