p1.getChildColumns().add( c1 );
dt.getConditions().add( p1 );
BRLConditionColumn brlCondition = new BRLConditionColumn();
FactPattern fp = new FactPattern( "Driver" );
fp.setBoundName( "$brl1" );
SingleFieldConstraint sfc1 = new SingleFieldConstraint();
sfc1.setFieldBinding( "$sfc1" );
sfc1.setOperator( "==" );
sfc1.setFieldName( "name" );
sfc1.setFieldType( SuggestionCompletionEngine.TYPE_STRING );
fp.addConstraint( sfc1 );
brlCondition.getDefinition().add( fp );
dt.getConditions().add( brlCondition );
ActionInsertFactCol52 ins = new ActionInsertFactCol52();
ins.setBoundName( "$ins" );
ins.setFactField( "rating" );
ins.setFactType( "Person" );
ins.setType( SuggestionCompletionEngine.TYPE_STRING );
dt.getActionCols().add( ins );
BRLRuleModel model = new BRLRuleModel( dt );
assertNotNull( model.getLHSBoundFacts() );
assertEquals( 2,
model.getLHSBoundFacts().size() );
assertTrue( model.getLHSBoundFacts().contains( "$p1" ) );
assertTrue( model.getLHSBoundFacts().contains( "$brl1" ) );
assertNotNull( model.getLHSBindingType( "$p1" ) );
assertEquals( "Driver",
model.getLHSBindingType( "$p1" ) );
assertNotNull( model.getLHSBindingType( "$brl1" ) );
assertEquals( "Driver",
model.getLHSBindingType( "$brl1" ) );
FactPattern r1 = model.getLHSBoundFact( "$p1" );
assertNotNull( r1 );
assertTrue( r1 instanceof BRLRuleModel.Pattern52FactPatternAdaptor );
BRLRuleModel.Pattern52FactPatternAdaptor raif1 = (BRLRuleModel.Pattern52FactPatternAdaptor) r1;
assertEquals( "Driver",
raif1.getFactType() );
FactPattern r2 = model.getLHSBoundFact( "$brl1" );
assertNotNull( r2 );
assertEquals( "Driver",
r2.getFactType() );
}