Search in sources :

Example 1 with PriorityQueueAgendaGroupFactory

use of org.drools.core.common.PriorityQueueAgendaGroupFactory in project drools by kiegroup.

the class RuleBaseConfigurationTest method testSequential.

@Test
public void testSequential() {
    Properties properties = new Properties();
    properties.setProperty("drools.sequential", "false");
    RuleBaseConfiguration cfg = new RuleBaseConfiguration(properties);
    assertFalse(cfg.isSequential());
    assertTrue(cfg.getAgendaGroupFactory() instanceof PriorityQueueAgendaGroupFactory);
    properties = new Properties();
    properties.setProperty("drools.sequential.agenda", "sequential");
    properties.setProperty("drools.sequential", "true");
    cfg = new RuleBaseConfiguration(properties);
    assertTrue(cfg.isSequential());
    assertEquals(SequentialAgenda.SEQUENTIAL, cfg.getSequentialAgenda());
    properties = new Properties();
    properties.setProperty("drools.sequential.agenda", "dynamic");
    properties.setProperty("drools.sequential", "true");
    cfg = new RuleBaseConfiguration(properties);
    assertTrue(cfg.isSequential());
    assertEquals(SequentialAgenda.DYNAMIC, cfg.getSequentialAgenda());
    assertTrue(cfg.getAgendaGroupFactory() instanceof PriorityQueueAgendaGroupFactory);
}
Also used : RuleBaseConfiguration(org.drools.core.RuleBaseConfiguration) PriorityQueueAgendaGroupFactory(org.drools.core.common.PriorityQueueAgendaGroupFactory) Properties(java.util.Properties) Test(org.junit.Test)

Aggregations

Properties (java.util.Properties)1 RuleBaseConfiguration (org.drools.core.RuleBaseConfiguration)1 PriorityQueueAgendaGroupFactory (org.drools.core.common.PriorityQueueAgendaGroupFactory)1 Test (org.junit.Test)1