//check the "&&" part
final AndDescr join = (AndDescr) and.getDescrs().get( 0 );
assertEquals( 2,
join.getDescrs().size() );
PatternDescr left = (PatternDescr) join.getDescrs().get( 0 );
PatternDescr right = (PatternDescr) join.getDescrs().get( 1 );
assertEquals( "Person",
left.getObjectType() );
assertEquals( "Cheese",
right.getObjectType() );
assertEquals( 1,
left.getConstraint().getDescrs().size() );
FieldConstraintDescr fld = (FieldConstraintDescr) left.getConstraint().getDescrs().get( 0 );
LiteralRestrictionDescr literal = (LiteralRestrictionDescr) fld.getRestrictions().get( 0 );
assertEquals( "==",
literal.getEvaluator() );
assertEquals( "name",
fld.getFieldName() );
assertEquals( "mark",
literal.getText() );
assertEquals( 1,
right.getConstraint().getDescrs().size() );
fld = (FieldConstraintDescr) right.getConstraint().getDescrs().get( 0 );
literal = (LiteralRestrictionDescr) fld.getRestrictions().get( 0 );
assertEquals( "==",
literal.getEvaluator() );
assertEquals( "type",
fld.getFieldName() );
assertEquals( "stilton",
literal.getText() );
//now the "||" part
final OrDescr or = (OrDescr) and.getDescrs().get( 1 );
assertEquals( 2,
or.getDescrs().size() );
left = (PatternDescr) or.getDescrs().get( 0 );
right = (PatternDescr) or.getDescrs().get( 1 );
assertEquals( "Person",
left.getObjectType() );
assertEquals( "Cheese",
right.getObjectType() );
assertEquals( 1,
left.getConstraint().getDescrs().size() );
fld = (FieldConstraintDescr) left.getConstraint().getDescrs().get( 0 );
literal = (LiteralRestrictionDescr) fld.getRestrictions().get( 0 );
assertEquals( "==",
literal.getEvaluator() );
assertEquals( "name",
fld.getFieldName() );
assertEquals( "mark",
literal.getText() );
assertEquals( 1,
right.getConstraint().getDescrs().size() );
fld = (FieldConstraintDescr) right.getConstraint().getDescrs().get( 0 );
literal = (LiteralRestrictionDescr) fld.getRestrictions().get( 0 );
assertEquals( "==",
literal.getEvaluator() );
assertEquals( "type",