@Test
public void testUpdateSinkWithoutMemory() throws FactException,
IntrospectionException {
// An AlphaNode should try and repropagate from its source
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.INSERTION,
null,
null,
null );
final MockObjectSource source = new MockObjectSource( buildContext.getNextId() );
final InternalReadAccessor extractor = store.getReader( Cheese.class,
"type",
getClass().getClassLoader() );
final FieldValue field = FieldFactory.getInstance().getFieldValue( "cheddar" );
final MvelConstraint constraint = new MvelConstraintTestUtil("type == \"cheddar\"", field, extractor);
final AlphaNode alphaNode = new AlphaNode( buildContext.getNextId(),
constraint,
source,
buildContext ); // no memory
alphaNode.attach();