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 );
CompositeFieldConstraint cfp_p2_cfp = (CompositeFieldConstraint) fp2.getConstraint( 0 );
assertEquals( "||",
cfp_p2_cfp.getCompositeJunctionType() );
assertEquals( 2,
cfp_p2_cfp.getNumberOfConstraints() );
assertTrue( cfp_p2_cfp.getConstraint( 0 ) instanceof SingleFieldConstraint );
assertTrue( cfp_p2_cfp.getConstraint( 1 ) instanceof SingleFieldConstraint );
SingleFieldConstraint cfp_p2_sfp1 = (SingleFieldConstraint) cfp_p2_cfp.getConstraint( 0 );
assertEquals( "Person",
cfp_p2_sfp1.getFactType() );
assertEquals( "age",
cfp_p2_sfp1.getFieldName() );
assertEquals( "==",
cfp_p2_sfp1.getOperator() );
assertEquals( "43",
cfp_p2_sfp1.getValue() );
assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
cfp_p2_sfp1.getConstraintValueType() );
SingleFieldConstraint cfp_p2_sfp2 = (SingleFieldConstraint) cfp_p2_cfp.getConstraint( 1 );
assertEquals( "Person",
cfp_p2_sfp2.getFactType() );
assertEquals( "age",
cfp_p2_sfp2.getFieldName() );
assertEquals( "==",
cfp_p2_sfp2.getOperator() );
assertEquals( "44",
cfp_p2_sfp2.getValue() );
assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
cfp_p2_sfp2.getConstraintValueType() );
}