final MVELConsequenceBuilder builder = new MVELConsequenceBuilder();
builder.build( context, Rule.DEFAULT_CONSEQUENCE_NAME );
InternalRuleBase ruleBase = (InternalRuleBase) RuleBaseFactory.newRuleBase();
PropagationContextFactory pctxFactory = ruleBase.getConfiguration().getComponentFactory().getPropagationContextFactory();
ruleBase.addPackage( pkg );
final WorkingMemory wm = ruleBase.newStatefulSession();
MockLeftTupleSink sink = new MockLeftTupleSink();
final Cheese cheddar = new Cheese( "cheddar",
10 );
final InternalFactHandle f0 = (InternalFactHandle) wm.insert( cheddar );
final LeftTupleImpl tuple = new LeftTupleImpl( f0,
sink,
true );
f0.removeLeftTuple(tuple);
final AgendaItem item = new AgendaItemImpl( 0, tuple, 10,
pctxFactory.createPropagationContext(1, 1, null, tuple, null),
new RuleTerminalNode(0, new CompositeObjectSinkAdapterTest.MockBetaNode(), context.getRule(), subrule, 0, new BuildContext( (InternalRuleBase) ruleBase, null )), null, null);
final DefaultKnowledgeHelper kbHelper = new DefaultKnowledgeHelper( wm );
kbHelper.setActivation( item );
((MVELConsequence) context.getRule().getConsequence()).compile( (MVELDialectRuntimeData) pkgBuilder.getPackageRegistry( pkg.getName() ).getDialectRuntimeRegistry().getDialectData( "mvel" ));
context.getRule().getConsequence().evaluate( kbHelper,