use of org.drools.core.spi.BetaNodeFieldConstraint in project drools by kiegroup.
the class BaseBetaConstraintsTest method convertToConstraints.
protected BetaNodeFieldConstraint[] convertToConstraints(LinkedList list) {
final BetaNodeFieldConstraint[] array = new BetaNodeFieldConstraint[list.size()];
int i = 0;
for (LinkedListEntry entry = (LinkedListEntry) list.getFirst(); entry != null; entry = (LinkedListEntry) entry.getNext()) {
array[i++] = (BetaNodeFieldConstraint) entry.getObject();
}
return array;
}
use of org.drools.core.spi.BetaNodeFieldConstraint in project drools by kiegroup.
the class DefaultBetaConstraintsTest method testDoubleIndexNotFirst.
@Test
public void testDoubleIndexNotFirst() {
BetaNodeFieldConstraint constraint0 = getConstraint("cheeseType1", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint1 = getConstraint("cheeseType2", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint2 = getConstraint("cheeseType3", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint3 = getConstraint("cheeseType4", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint4 = getConstraint("cheeseType5", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint[] constraints = new BetaNodeFieldConstraint[] { constraint0, constraint1, constraint2, constraint3, constraint4 };
checkBetaConstraints(constraints, DefaultBetaConstraints.class);
}
use of org.drools.core.spi.BetaNodeFieldConstraint in project drools by kiegroup.
the class DefaultBetaConstraintsTest method testTripleIndex.
@Test
public void testTripleIndex() {
BetaNodeFieldConstraint constraint0 = getConstraint("cheeseType1", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint1 = getConstraint("cheeseType2", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint2 = getConstraint("cheeseType3", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint3 = getConstraint("cheeseType4", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint4 = getConstraint("cheeseType5", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint[] constraints = new BetaNodeFieldConstraint[] { constraint0, constraint1, constraint2, constraint3, constraint4 };
checkBetaConstraints(constraints, DefaultBetaConstraints.class);
}
use of org.drools.core.spi.BetaNodeFieldConstraint in project drools by kiegroup.
the class DefaultBetaConstraintsTest method testSingleIndexNotFirst.
@Test
public void testSingleIndexNotFirst() {
BetaNodeFieldConstraint constraint0 = getConstraint("cheeseType1", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint1 = getConstraint("cheeseType2", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint2 = getConstraint("cheeseType3", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint3 = getConstraint("cheeseType4", Operator.NOT_EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint4 = getConstraint("cheeseType5", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint[] constraints = new BetaNodeFieldConstraint[] { constraint0, constraint1, constraint2, constraint3, constraint4 };
checkBetaConstraints(constraints, DefaultBetaConstraints.class);
}
use of org.drools.core.spi.BetaNodeFieldConstraint in project drools by kiegroup.
the class QuadroupleBetaConstraintsTest method testFourIndxed.
@Test
public void testFourIndxed() {
BetaNodeFieldConstraint constraint0 = getConstraint("cheeseType0", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint1 = getConstraint("cheeseType1", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint3 = getConstraint("cheeseType2", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint constraint4 = getConstraint("cheeseType3", Operator.EQUAL, "type", Cheese.class);
BetaNodeFieldConstraint[] constraints = new BetaNodeFieldConstraint[] { constraint0, constraint1, constraint3, constraint4 };
checkBetaConstraints(constraints, QuadroupleBetaConstraints.class);
}
Aggregations