m.name );
//LHS Pattern
assertEquals( 1,
m.lhs.length );
IPattern p = m.lhs[ 0 ];
assertTrue( p instanceof CompositeFactPattern );
CompositeFactPattern cfp = (CompositeFactPattern) p;
assertEquals( CompositeFactPattern.COMPOSITE_TYPE_OR,
cfp.getType() );
//LHS sub-patterns
assertEquals( 2,
cfp.getPatterns().length );
IPattern cfp_p1 = cfp.getPatterns()[ 0 ];
assertTrue( cfp_p1 instanceof FactPattern );
FactPattern fp1 = (FactPattern) cfp_p1;
assertEquals( "Person",
fp1.getFactType() );
assertEquals( 1,
fp1.getConstraintList().getConstraints().length );
assertTrue( fp1.getConstraint( 0 ) instanceof SingleFieldConstraint );
SingleFieldConstraint cfp_sfp1 = (SingleFieldConstraint) fp1.getConstraint( 0 );
assertEquals( "Person",
cfp_sfp1.getFactType() );
assertEquals( "age",
cfp_sfp1.getFieldName() );
assertEquals( "==",
cfp_sfp1.getOperator() );
assertEquals( "42",
cfp_sfp1.getValue() );
assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
cfp_sfp1.getConstraintValueType() );
IPattern cfp_p2 = cfp.getPatterns()[ 1 ];
assertTrue( cfp_p2 instanceof FactPattern );
FactPattern fp2 = (FactPattern) cfp_p2;
assertEquals( 1,
fp2.getConstraintList().getConstraints().length );
assertTrue( fp2.getConstraint( 0 ) instanceof CompositeFieldConstraint );