private BetaNode createBetaNode(int id, int type, LeftTupleSource leftTupleSource) { MockObjectSource mockObjectSource = new MockObjectSource( 8 ); BetaNode betaNode = null; switch ( type ) { case JOIN_NODE : { betaNode = new JoinNode( id, leftTupleSource, mockObjectSource, new EmptyBetaConstraints(), buildContext ); break; } case EXISTS_NODE : { betaNode = new ExistsNode( id, leftTupleSource, mockObjectSource, new EmptyBetaConstraints(), buildContext ); break; } case NOT_NODE : { betaNode = new NotNode( id, leftTupleSource, mockObjectSource, new EmptyBetaConstraints(), buildContext ); break; } } mockObjectSource.attach(buildContext); betaNode.attach(buildContext); return betaNode; }
return new JoinNode(0, leftInput, rightInput, betaConstraints, buildContext); case NodeTypeEnums.NotNode: return new NotNode(0, leftInput, rightInput, betaConstraints, buildContext);
BetaNode n1 = new JoinNode( 10, new LeftInputAdapterNode(3, otn, buildContext ), mockObjectSource, new EmptyBetaConstraints(), buildContext ); BetaNode n2 = new JoinNode( 11, n1, mockObjectSource, new EmptyBetaConstraints(), buildContext ); BetaNode n3 = new JoinNode( 12, n1, mockObjectSource, new EmptyBetaConstraints(), buildContext ); BetaNode n4 = new JoinNode( 13, n2, mockObjectSource, new EmptyBetaConstraints(), buildContext ); BetaNode n5 = new JoinNode( 14, n2, mockObjectSource, new EmptyBetaConstraints(), buildContext );
switch ( type ) { case JOIN_NODE : { networkNode = new JoinNode( id, leftTupleSource, mockObjectSource, new EmptyBetaConstraints(), buildContext ); break;
switch ( type ) { case JOIN_NODE : { networkNode = new JoinNode( id, leftTupleSource, mockObjectSource, new EmptyBetaConstraints(), buildContext ); break;
@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 ); }
BuildContext buildContext = new BuildContext( kBase, kBase.getReteooBuilder().getIdGenerator() ); final JoinNode joinNode = new JoinNode( 1, this.tupleSource, this.objectSource, EmptyBetaConstraints.getInstance(), buildContext );
this.node = new JoinNode( 15, this.tupleSource,
BuildContext buildContext = new BuildContext(kBase2, kBase2.getReteooBuilder().getIdGenerator()); this.node = new JoinNode(15, this.tupleSource, this.objectSource, new DefaultBetaConstraints( new BetaNodeFieldConstraint[]{this.constraint},
BuildContext buildContext = new BuildContext( kBase, kBase.getReteooBuilder().getIdGenerator() ); final JoinNode joinNode = new JoinNode(1, this.tupleSource, this.objectSource, EmptyBetaConstraints.getInstance(), buildContext);