Package org.drools

Examples of org.drools.RuleBaseConfiguration


        assertNotNull( memory );
    }

    public void testAssertTupleSequentialMode() {
        RuleBaseConfiguration conf = new RuleBaseConfiguration();
        conf.setSequential( true );

        this.workingMemory = new ReteooWorkingMemory( 1,
                                                      (ReteooRuleBase) RuleBaseFactory.newRuleBase( conf ) );

        this.memory = (CollectMemory) this.workingMemory.getNodeMemory( this.node );
View Full Code Here


                                                   null,
                                                   null );
        this.workingMemory = new ReteooWorkingMemory( 1,
                                                      (ReteooRuleBase) RuleBaseFactory.newRuleBase() );

        final RuleBaseConfiguration configuration = new RuleBaseConfiguration();

        ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
        BuildContext buildContext = new BuildContext( ruleBase,
                                                      ruleBase.getReteooBuilder().getIdGenerator() );
View Full Code Here

                                                             with( any( ContextEntry.class ) ) );
                will( returnValue( true ) );
            }
        } );

        RuleBaseConfiguration conf = new RuleBaseConfiguration();
        conf.setSequential( true );

        ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase( conf );

        this.workingMemory = new ReteooWorkingMemory( 1,
                                                      ruleBase );
View Full Code Here

     * Test just tuple assertions
     *
     * @throws AssertionException
     */
    public void testAssertTupleSequentialMode() throws Exception {
        RuleBaseConfiguration conf = new RuleBaseConfiguration();
        conf.setSequential( true );

        ReteooRuleBase ruleBase = (ReteooRuleBase) RuleBaseFactory.newRuleBase();
        BuildContext buildContext = new BuildContext( ruleBase,
                                                      ruleBase.getReteooBuilder().getIdGenerator() );
        buildContext.setTupleMemoryEnabled( false );
View Full Code Here

        props.setProperty( "file",
                           path );

        // Check a default value for the RuleBase's RuleBaseConfiguration
        RuleAgent agent = RuleAgent.newRuleAgent( props );
        RuleBaseConfiguration conf = ((InternalRuleBase) agent.getRuleBase()).getConfiguration();
        assertEquals( false,
                      conf.isSequential() );

        // Pass in a RuleBaseConfiguration and make sure the RuleBase was created with it
        conf = new RuleBaseConfiguration();
        conf.setSequential( true );
        agent = RuleAgent.newRuleAgent( props,
                                        conf );
        conf = ((InternalRuleBase) agent.getRuleBase()).getConfiguration();
        assertEquals( true,
                      conf.isSequential() );
    }
View Full Code Here

        assertEquals( true,
                      conf.isSequential() );
    }

    public void testLoadSampleConfig() {
        RuleAgent ag = new RuleAgent( new RuleBaseConfiguration() );
        Properties props = ag.loadFromProperties( "/sample-agent-config.properties" );
        assertEquals( "10",
                      props.getProperty( RuleAgent.POLL_INTERVAL ) );
        assertEquals( "/home/packages",
                      props.getProperty( RuleAgent.DIRECTORY ) );
View Full Code Here

        assertEquals( cleanExpected,
                      cleanActual );
    }

    public void testEventListenerSetup() throws Exception {
        RuleAgent ag = new RuleAgent( new RuleBaseConfiguration() );
        assertNotNull( ag.listener );

        final String[] name = new String[1];

        AgentEventListener list = new AgentEventListener() {
View Full Code Here

        public int     secondsToRefresh;
        public List    provs;
        public boolean newInstance;

        public AnotherRuleAgentMock() {
            super( new RuleBaseConfiguration() );
        }
View Full Code Here

   
    public boolean refreshCalled = false;
   
    public MockRuleAgent() {
        super( new RuleBaseConfiguration() );
    }
View Full Code Here

            }
        }

        // If there is no ruleBase and config file had rule base properties, set properties.
        if ( lookForRuleBaseConfigurations && !droolsProperties.isEmpty() ) {
            ruleBaseConf = new RuleBaseConfiguration( droolsProperties );
        }

        configure( newInstance,
                   provs,
                   secondsToRefresh );
View Full Code Here

TOP

Related Classes of org.drools.RuleBaseConfiguration

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.