@Test public void testConstraintPropagations() throws Exception { when( constraint.isAllowedCachedLeft( any( ContextEntry.class ), any( InternalFactHandle.class ) ) ).thenReturn( false ); when( constraint.isAllowedCachedRight( any( LeftTupleImpl.class ), any( ContextEntry.class ) ) ).thenReturn( false ); // assert first right object final DefaultFactHandle f0 = (DefaultFactHandle) this.workingMemory .insert( "test0" ); this.node.assertObject( f0, this.context, this.workingMemory ); // assert tuple, should add left memory should be 2 final DefaultFactHandle f1 = new DefaultFactHandle( 1, "cheese" ); final LeftTupleImpl tuple1 = new LeftTupleImpl( f1, this.node, true ); this.node.assertLeftTuple( tuple1, this.context, this.workingMemory ); // Should be no assertions assertLength( 0, this.sink.getAsserted() ); this.node.retractRightTuple( f0.getFirstRightTuple(), this.context, this.workingMemory ); assertLength( 0, this.sink.getRetracted() ); }
this.node.assertLeftTuple( tuple0, this.context, this.workingMemory ); this.node.assertLeftTuple( tuple1, this.context, this.workingMemory );
this.node.assertLeftTuple( tuple1, this.context, this.workingMemory ); this.node.assertLeftTuple( tuple2, this.context, this.workingMemory );
.insert( "test1" ); final LeftTupleImpl tuple1 = new LeftTupleImpl( f1, this.node, true ); this.node.assertLeftTuple( tuple1, this.context, this.workingMemory ); .insert( "test2" ); final LeftTupleImpl tuple2 = new LeftTupleImpl( f2, this.node, true ); this.node.assertLeftTuple( tuple2, this.context, this.workingMemory );
this.node.assertLeftTuple( tuple0, pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, f0), this.workingMemory );