str += " intValue, !=, p1;\n";
NodeTestResult result = executeTest( str );
Map<String, Object> map = result.context;
JoinNode join1 = (JoinNode) map.get( "join1" );
assertNotNull( join1 );
PropagationContext context = new PropagationContextImpl( 0,
PropagationContext.INSERTION,
null,
null,
null );
ReteooWorkingMemory workingMemory = new ReteooWorkingMemory( 1,
(ReteooRuleBase) RuleBaseFactory.newRuleBase() );
BetaMemory memory = (BetaMemory) workingMemory.getNodeMemory( join1 );
final DefaultFactHandle f0 = new DefaultFactHandle( 0,
0 );
final LeftTupleImpl tuple0 = new LeftTupleImpl( f0,
join1,
true );
// assert tuple, should add one to left memory
join1.assertLeftTuple( tuple0,
context,
workingMemory );
// check memories, left memory is populated, right memory is emptys
assertEquals( 1,
memory.getLeftTupleMemory().size() );
assertEquals( 0,
memory.getRightTupleMemory().size() );
// assert tuple, should add left memory should be 2
final DefaultFactHandle f1 = new DefaultFactHandle( 1,
0 );
final LeftTupleImpl tuple1 = new LeftTupleImpl( f1,
join1,
true );
join1.assertLeftTuple( tuple1,
context,
workingMemory );
assertEquals( 2,
memory.getLeftTupleMemory().size() );