MockBetaNode(final int id, final LeftTupleSource leftInput, final ObjectSource rightInput, BuildContext buildContext) { super( id, leftInput, rightInput, EmptyBetaConstraints.getInstance(), buildContext ); }
MockBetaNode(final int id, final LeftTupleSource leftInput, final ObjectSource rightInput) { super( id, leftInput, rightInput, EmptyBetaConstraints.getInstance(), null ); }
ts, os, EmptyBetaConstraints.getInstance(), buildContext ); final BetaNode j2 = new JoinNode( 2, ts, os, EmptyBetaConstraints.getInstance(), buildContext ); final BetaNode n1 = new NotNode( 3, ts, os, EmptyBetaConstraints.getInstance(), buildContext ); final BetaNode n2 = new NotNode( 4, ts, os, EmptyBetaConstraints.getInstance(), buildContext );
@Test public void testMemory() { when( constraint.isAllowedCachedLeft( any( ContextEntry.class ), any( InternalFactHandle.class ) ) ).thenReturn( true ); when( constraint.isAllowedCachedRight( any( LeftTupleImpl.class ), any( ContextEntry.class ) ) ).thenReturn( true ); final StatefulKnowledgeSessionImpl workingMemory = new StatefulKnowledgeSessionImpl( 1L, (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase()); final MockObjectSource objectSource = new MockObjectSource( 1 ); final MockTupleSource tupleSource = new MockTupleSource( 1 ); InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); BuildContext buildContext = new BuildContext( kBase, kBase.getReteooBuilder().getIdGenerator() ); final JoinNode joinNode = new JoinNode( 2, tupleSource, objectSource, EmptyBetaConstraints.getInstance(), buildContext ); final BetaMemory memory = (BetaMemory) workingMemory .getNodeMemory( joinNode ); assertNotNull( memory ); }
this.objectSource, EmptyBetaConstraints.getInstance(), buildContext );
this.objectSource, EmptyBetaConstraints.getInstance(), buildContext);