/**
* Test method for {@link org.drools.reteoo.AccumulateNode#assertLeftTuple(org.drools.reteoo.LeftTupleImpl, org.drools.spi.PropagationContext, org.drools.reteoo.ReteooWorkingMemory)}.
*/
@Test
public void testAssertTuple() {
final DefaultFactHandle f0 = (DefaultFactHandle) this.workingMemory.getFactHandleFactory().newFactHandle( "cheese",
null,
null,
workingMemory );
final LeftTupleImpl tuple0 = new LeftTupleImpl( f0,
null,
true );
// assert tuple, should add one to left memory
this.node.assertLeftTuple( tuple0,
this.context,
this.workingMemory );
// check memories
assertEquals( 1,
this.memory.getLeftTupleMemory().size() );
assertEquals( 0,
this.memory.getRightTupleMemory().size() );
assertTrue( "An empty matching objects list should be propagated",
this.accumulator.getMatchingObjects().isEmpty() );
// assert tuple, should add left memory
final DefaultFactHandle f1 = (DefaultFactHandle) this.workingMemory.getFactHandleFactory().newFactHandle( "other cheese",
null,
null,
workingMemory );
final LeftTupleImpl tuple1 = new LeftTupleImpl( f1,