use of org.drools.core.common.EventFactHandle in project drools by kiegroup.
the class TemporalEvaluatorFactoryTest method testOverlapedBy.
@Test
public void testOverlapedBy() {
registry.addEvaluatorDefinition(DuringEvaluatorDefinition.class.getName());
EventFactHandle foo = new EventFactHandle(1, "foo", 1, 7, 8, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle bar = new EventFactHandle(2, "bar", 1, 2, 8, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle drool = new EventFactHandle(1, "drool", 1, 11, 5, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle mole = new EventFactHandle(1, "mole", 1, 7, 3, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
final Object[][] data = { { foo, "overlappedby", bar, Boolean.TRUE }, { foo, "overlappedby", drool, Boolean.FALSE }, { foo, "overlappedby", mole, Boolean.FALSE }, { foo, "not overlappedby", bar, Boolean.FALSE }, { foo, "not overlappedby", drool, Boolean.TRUE }, { foo, "not overlappedby", mole, Boolean.TRUE }, { foo, "overlappedby[3]", bar, Boolean.TRUE }, { foo, "overlappedby[3]", drool, Boolean.FALSE }, { foo, "overlappedby[3]", mole, Boolean.FALSE }, { foo, "overlappedby[2]", bar, Boolean.FALSE }, { foo, "overlappedby[6]", mole, Boolean.FALSE }, { foo, "not overlappedby[3]", bar, Boolean.FALSE }, { foo, "not overlappedby[3]", drool, Boolean.TRUE }, { foo, "not overlappedby[3]", mole, Boolean.TRUE }, { foo, "not overlappedby[2]", bar, Boolean.TRUE }, { foo, "not overlappedby[6]", mole, Boolean.TRUE }, { foo, "overlappedby[1,3]", bar, Boolean.TRUE }, { foo, "overlappedby[1,3]", drool, Boolean.FALSE }, { foo, "overlappedby[1,3]", mole, Boolean.FALSE }, { foo, "overlappedby[4,6]", bar, Boolean.FALSE }, { foo, "overlappedby[1,8]", mole, Boolean.FALSE }, { foo, "not overlappedby[1,3]", bar, Boolean.FALSE }, { foo, "not overlappedby[1,3]", drool, Boolean.TRUE }, { foo, "not overlappedby[1,3]", mole, Boolean.TRUE }, { foo, "not overlappedby[4,6]", bar, Boolean.TRUE }, { foo, "not overlappedby[1,8]", mole, Boolean.TRUE } };
runEvaluatorTest(data, ValueType.OBJECT_TYPE);
}
use of org.drools.core.common.EventFactHandle in project drools by kiegroup.
the class TemporalEvaluatorFactoryTest method testMetBy.
@Test
public void testMetBy() {
registry.addEvaluatorDefinition(DuringEvaluatorDefinition.class.getName());
EventFactHandle foo = new EventFactHandle(1, "foo", 1, 10, 8, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle bar = new EventFactHandle(2, "bar", 1, 2, 8, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle drool = new EventFactHandle(1, "drool", 1, 5, 3, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle mole = new EventFactHandle(1, "mole", 1, 4, 7, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
final Object[][] data = { { foo, "metby", bar, Boolean.TRUE }, { foo, "metby", drool, Boolean.FALSE }, { foo, "metby", mole, Boolean.FALSE }, { foo, "not metby", bar, Boolean.FALSE }, { foo, "not metby", drool, Boolean.TRUE }, { foo, "not metby", mole, Boolean.TRUE }, { foo, "metby[1]", bar, Boolean.TRUE }, { foo, "metby[1]", drool, Boolean.FALSE }, { foo, "metby[1]", mole, Boolean.TRUE }, { foo, "metby[2]", drool, Boolean.TRUE }, { foo, "not metby[1]", bar, Boolean.FALSE }, { foo, "not metby[1]", drool, Boolean.TRUE }, { foo, "not metby[1]", mole, Boolean.FALSE }, { foo, "not metby[2]", drool, Boolean.FALSE } };
runEvaluatorTest(data, ValueType.OBJECT_TYPE);
}
use of org.drools.core.common.EventFactHandle in project drools by kiegroup.
the class TemporalEvaluatorFactoryTest method testFinishes.
@Test
public void testFinishes() {
registry.addEvaluatorDefinition(DuringEvaluatorDefinition.class.getName());
EventFactHandle foo = new EventFactHandle(1, "foo", 1, 2, 10, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle bar = new EventFactHandle(2, "bar", 1, 5, 7, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle drool = new EventFactHandle(1, "drool", 1, 2, 10, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle mole = new EventFactHandle(1, "mole", 1, 7, 6, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
final Object[][] data = { { bar, "finishes", foo, Boolean.TRUE }, { drool, "finishes", foo, Boolean.FALSE }, { mole, "finishes", foo, Boolean.FALSE }, { foo, "finishes", bar, Boolean.FALSE }, { bar, "not finishes", foo, Boolean.FALSE }, { drool, "not finishes", foo, Boolean.TRUE }, { mole, "not finishes", foo, Boolean.TRUE }, { foo, "not finishes", bar, Boolean.TRUE }, { bar, "finishes[1]", foo, Boolean.TRUE }, { drool, "finishes[1]", foo, Boolean.FALSE }, { mole, "finishes[1]", foo, Boolean.TRUE }, { foo, "finishes[1]", bar, Boolean.FALSE }, { bar, "not finishes[1]", foo, Boolean.FALSE }, { drool, "not finishes[1]", foo, Boolean.TRUE }, { mole, "not finishes[1]", foo, Boolean.FALSE }, { foo, "not finishes[1]", bar, Boolean.TRUE }, { mole, "finishes[3]", foo, Boolean.TRUE } };
runEvaluatorTest(data, ValueType.OBJECT_TYPE);
}
use of org.drools.core.common.EventFactHandle in project drools by kiegroup.
the class TemporalEvaluatorFactoryTest method testCoincides.
@Test
public void testCoincides() {
registry.addEvaluatorDefinition(CoincidesEvaluatorDefinition.class.getName());
EventFactHandle foo = new EventFactHandle(1, "foo", 1, 2, 3, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle bar = new EventFactHandle(2, "bar", 1, 2, 3, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle drool = new EventFactHandle(1, "drool", 1, 2, 2, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle mole = new EventFactHandle(1, "mole", 1, 1, 2, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
final Object[][] data = { { foo, "coincides", bar, Boolean.TRUE }, { foo, "coincides", drool, Boolean.FALSE }, { foo, "coincides", mole, Boolean.FALSE }, { drool, "coincides", mole, Boolean.FALSE }, { foo, "not coincides", bar, Boolean.FALSE }, { foo, "not coincides", drool, Boolean.TRUE }, { foo, "not coincides", mole, Boolean.TRUE }, { drool, "not coincides", mole, Boolean.TRUE }, { foo, "coincides[1]", bar, Boolean.TRUE }, { foo, "coincides[1]", drool, Boolean.TRUE }, { foo, "coincides[2]", mole, Boolean.TRUE }, { foo, "coincides[1]", mole, Boolean.FALSE }, { drool, "coincides[1]", mole, Boolean.TRUE }, { foo, "not coincides[1]", bar, Boolean.FALSE }, { foo, "not coincides[1]", drool, Boolean.FALSE }, { foo, "not coincides[2]", mole, Boolean.FALSE }, { foo, "not coincides[1]", mole, Boolean.TRUE }, { drool, "not coincides[1]", mole, Boolean.FALSE }, { foo, "coincides[1,2]", bar, Boolean.TRUE }, { foo, "coincides[0,1]", drool, Boolean.TRUE }, { foo, "coincides[1,0]", drool, Boolean.FALSE }, { foo, "coincides[1,2]", mole, Boolean.TRUE }, { foo, "coincides[1,1]", mole, Boolean.FALSE }, { drool, "coincides[1,1]", mole, Boolean.TRUE }, { drool, "coincides[0,1]", mole, Boolean.FALSE }, { foo, "not coincides[1,2]", bar, Boolean.FALSE }, { foo, "not coincides[0,1]", drool, Boolean.FALSE }, { foo, "not coincides[1,0]", drool, Boolean.TRUE }, { foo, "not coincides[1,2]", mole, Boolean.FALSE }, { foo, "not coincides[1,1]", mole, Boolean.TRUE }, { drool, "not coincides[1,1]", mole, Boolean.FALSE }, { drool, "not coincides[0,1]", mole, Boolean.TRUE } };
runEvaluatorTest(data, ValueType.OBJECT_TYPE);
}
use of org.drools.core.common.EventFactHandle in project drools by kiegroup.
the class TemporalEvaluatorFactoryTest method testDuring.
@Test
public void testDuring() {
registry.addEvaluatorDefinition(DuringEvaluatorDefinition.class.getName());
EventFactHandle foo = new EventFactHandle(1, "foo", 1, 2, 10, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle bar = new EventFactHandle(2, "bar", 1, 4, 7, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle drool = new EventFactHandle(1, "drool", 1, 1, 5, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
EventFactHandle mole = new EventFactHandle(1, "mole", 1, 7, 6, new DisconnectedWorkingMemoryEntryPoint("DEFAULT"));
final Object[][] data = { { foo, "during", bar, Boolean.FALSE }, { foo, "during", drool, Boolean.FALSE }, { foo, "during", mole, Boolean.FALSE }, { bar, "during", foo, Boolean.TRUE }, { bar, "during", drool, Boolean.FALSE }, { bar, "during", mole, Boolean.FALSE }, { foo, "not during", bar, Boolean.TRUE }, { foo, "not during", drool, Boolean.TRUE }, { foo, "not during", mole, Boolean.TRUE }, { bar, "not during", foo, Boolean.FALSE }, { bar, "not during", drool, Boolean.TRUE }, { bar, "not during", mole, Boolean.TRUE }, { bar, "during[2]", foo, Boolean.TRUE }, { bar, "during[3]", foo, Boolean.TRUE }, { bar, "during[1]", foo, Boolean.FALSE }, { bar, "not during[2]", foo, Boolean.FALSE }, { bar, "not during[3]", foo, Boolean.FALSE }, { bar, "not during[1]", foo, Boolean.TRUE }, { bar, "during[1, 2]", foo, Boolean.TRUE }, { bar, "during[2, 3]", foo, Boolean.FALSE }, { bar, "during[3, 3]", foo, Boolean.FALSE }, { bar, "not during[1, 2]", foo, Boolean.FALSE }, { bar, "not during[2, 3]", foo, Boolean.TRUE }, { bar, "not during[3, 3]", foo, Boolean.TRUE }, { bar, "during[2, 2, 1, 1]", foo, Boolean.TRUE }, { bar, "during[1, 5, 1, 3]", foo, Boolean.TRUE }, { bar, "during[0, 1, 0, 3]", foo, Boolean.FALSE }, { bar, "not during[2, 2, 1, 1]", foo, Boolean.FALSE }, { bar, "not during[1, 5, 1, 3]", foo, Boolean.FALSE }, { bar, "not during[0, 1, 0, 3]", foo, Boolean.TRUE } };
runEvaluatorTest(data, ValueType.OBJECT_TYPE);
}
Aggregations