aif.getFieldValues()[ 0 ].setNature( BaseSingleFieldConstraint.TYPE_LITERAL );
brlAction.getDefinition().add( aif );
dt.getActionCols().add( brlAction );
BRLRuleModel model = new BRLRuleModel( dt );
assertNotNull( model.getRHSBoundFacts() );
assertEquals( 3,
model.getRHSBoundFacts().size() );
assertTrue( model.getRHSBoundFacts().contains( "$ins" ) );
assertTrue( model.getRHSBoundFacts().contains( "$ins2" ) );
assertTrue( model.getRHSBoundFacts().contains( "$aif" ) );
ActionInsertFact r1 = model.getRHSBoundFact( "$ins" );
assertNotNull( r1 );
assertTrue( r1 instanceof ActionInsertFactCol52ActionInsertFactAdaptor );
ActionInsertFactCol52ActionInsertFactAdaptor raif1 = (ActionInsertFactCol52ActionInsertFactAdaptor) r1;
assertEquals( "Person",
raif1.getFactType() );
assertEquals( "rating",
raif1.getFieldValues()[ 0 ].getField() );
assertEquals( DataType.TYPE_STRING,
raif1.getFieldValues()[ 0 ].getType() );
assertNull( raif1.getFieldValues()[ 0 ].getValue() );
assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
raif1.getFieldValues()[ 0 ].getNature() );
ActionInsertFact r2 = model.getRHSBoundFact( "$ins2" );
assertNotNull( r2 );
assertTrue( r2 instanceof ActionInsertFactCol52ActionInsertLogicalFactAdaptor);
ActionInsertFactCol52ActionInsertLogicalFactAdaptor raif2 = (ActionInsertFactCol52ActionInsertLogicalFactAdaptor) r2;
assertEquals( "Person2",
raif2.getFactType() );
assertEquals( "rating2",
raif2.getFieldValues()[ 0 ].getField() );
assertEquals( DataType.TYPE_STRING,
raif2.getFieldValues()[ 0 ].getType() );
assertNull( raif2.getFieldValues()[ 0 ].getValue() );
assertEquals( BaseSingleFieldConstraint.TYPE_LITERAL,
raif2.getFieldValues()[ 0 ].getNature() );
ActionInsertFact r3 = model.getRHSBoundFact( "$aif" );
assertNotNull( r3 );
assertTrue( r3 instanceof ActionInsertFact );
ActionInsertFact raif3 = (ActionInsertFact) r3;
assertEquals( "Person",
raif3.getFactType() );