final IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator();
EntryPointNode epn = nFacotry.buildEntryPointNode( kBase.getReteooBuilder().getIdGenerator().getNextId(), RuleBasePartitionId.MAIN_PARTITION, kBase.getConfiguration().isMultithreadEvaluation(),
@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 ); }
@Test public void testAttach() throws Exception { when(constraint.isAllowedCachedLeft(any(ContextEntry.class), any(InternalFactHandle.class ) ) ).thenReturn( true ); when( constraint.isAllowedCachedRight( any( LeftTupleImpl.class ), any( ContextEntry.class ) ) ).thenReturn( true ); final Field objectFfield = ObjectSource.class.getDeclaredField( "sink" ); objectFfield.setAccessible( true ); ObjectSinkPropagator objectSink = (ObjectSinkPropagator) objectFfield.get( this.objectSource ); final Field tupleField = LeftTupleSource.class.getDeclaredField( "sink" ); tupleField.setAccessible( true ); LeftTupleSinkPropagator tupleSink = (LeftTupleSinkPropagator) tupleField.get( this.tupleSource ); assertEquals( 15, this.node.getId() ); assertNotNull( objectSink ); assertNotNull( tupleSink ); InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); BuildContext context = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator() ); this.node.attach(context); objectSink = (ObjectSinkPropagator) objectFfield.get( this.objectSource ); tupleSink = (LeftTupleSinkPropagator) tupleField.get( this.tupleSource ); assertEquals( 1, objectSink.getSinks().length ); assertEquals( 1, tupleSink.getSinks().length ); assertSame( this.node, objectSink.getSinks()[0] ); assertSame( this.node, tupleSink.getSinks()[0] ); }
@Before public void setUp() throws Exception { kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); buildContext = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator()); pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); }
@Before public void setUp() { this.kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); this.buildContext = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator()); PropagationContextFactory pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); this.context = pctxFactory.createPropagationContext(0, PropagationContext.INSERTION, null, null, null); StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession(); }
@Before public void setUp() throws Exception { RuleBaseConfiguration config = new RuleBaseConfiguration(); config.setPhreakEnabled(false); kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); buildContext = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator()); pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); }
BuildContext buildContext = new BuildContext( kBase, kBase.getReteooBuilder().getIdGenerator() );
@Before public void setUp() throws Exception { kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); buildContext = new BuildContext(kBase, kBase.getReteooBuilder().getIdGenerator()); this.entryPoint = new EntryPointNode(0, this.kBase.getRete(), buildContext); this.entryPoint.attach(buildContext); pctxFactory = kBase.getConfiguration().getComponentFactory().getPropagationContextFactory(); }
BuildContext buildContext = new BuildContext( kBase, kBase.getReteooBuilder().getIdGenerator() ); buildContext.setTupleMemoryEnabled( false ); buildContext.setObjectTypeNodeMemoryEnabled( false );
@Test public void testScheduledActivation() throws Exception { IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator(); StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();
BuildContext buildContext = new BuildContext(kBase2, kBase2.getReteooBuilder().getIdGenerator());
@Test public void testDoLoopScheduledActivation() throws Exception { IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator();
@Test public void testNoLoopScheduledActivation() throws Exception { InternalKnowledgeBase kBase = (InternalKnowledgeBase) KnowledgeBaseFactory.newKnowledgeBase(); IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator();
BuildContext buildContext = new BuildContext( kBase, kBase.getReteooBuilder().getIdGenerator() );
IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator();
@Test @Ignore public <M extends ModedAssertion<M>> void testSingleLogicalRelationship() throws Exception { IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator();
IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator();
IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator();
IdGenerator idGenerator = kBase.getReteooBuilder().getIdGenerator(); StatefulKnowledgeSessionImpl ksession = (StatefulKnowledgeSessionImpl)kBase.newStatefulKnowledgeSession();