/*
* This just test AlphaNode With a different Constraint type.
*/
public void testReturnValueConstraintAssertObject() throws Exception {
ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
BuildContext buildContext = new BuildContext( ruleBase,
((ReteooRuleBase) ruleBase).getReteooBuilder().getIdGenerator() );
ReteooWorkingMemory workingMemory = (ReteooWorkingMemory) ruleBase.newStatefulSession();
final Rule rule = new Rule( "test-rule" );
final PropagationContext context = new PropagationContextImpl( 0,
PropagationContext.ASSERTION,
null,
null,
null );
final MockObjectSource source = new MockObjectSource( buildContext.getNextId() );
final InternalReadAccessor extractor = store.getReader( Cheese.class,
"type",
getClass().getClassLoader() );
final FieldValue field = FieldFactory.getFieldValue( "cheddar" );
final Evaluator evaluator = equals.getEvaluator( ValueType.OBJECT_TYPE,
Operator.EQUAL );
final LiteralConstraint constraint = new LiteralConstraint( extractor,
evaluator,
field );
final AlphaNode alphaNode = new AlphaNode( buildContext.getNextId(),
constraint,
source,
buildContext );
final MockObjectSink sink = new MockObjectSink();
alphaNode.addObjectSink( sink );