01: package org.drools.common;
02:
03: import org.drools.Cheese;
04: import org.drools.base.evaluators.Operator;
05: import org.drools.rule.VariableConstraint;
06:
07: public class DoubleBetaConstraintsTest extends BaseBetaConstraintsTest {
08:
09: public void testAllNoneIndxed() {
10: VariableConstraint constraint0 = (VariableConstraint) getConstraint(
11: "cheeseType0", Operator.NOT_EQUAL, "type", Cheese.class);
12: VariableConstraint constraint1 = (VariableConstraint) getConstraint(
13: "cheeseType1", Operator.NOT_EQUAL, "type", Cheese.class);
14: VariableConstraint[] constraints = new VariableConstraint[] {
15: constraint0, constraint1 };
16: checkBetaConstraints(constraints, DoubleBetaConstraints.class);
17: }
18:
19: public void testOneIndxed() {
20: VariableConstraint constraint0 = (VariableConstraint) getConstraint(
21: "cheeseType0", Operator.EQUAL, "type", Cheese.class);
22: VariableConstraint constraint1 = (VariableConstraint) getConstraint(
23: "cheeseType1", Operator.NOT_EQUAL, "type", Cheese.class);
24: VariableConstraint[] constraints = new VariableConstraint[] {
25: constraint0, constraint1 };
26: checkBetaConstraints(constraints, DoubleBetaConstraints.class);
27:
28: constraint0 = (VariableConstraint) getConstraint("cheeseType0",
29: Operator.NOT_EQUAL, "type", Cheese.class);
30: constraint1 = (VariableConstraint) getConstraint("cheeseType1",
31: Operator.EQUAL, "type", Cheese.class);
32: constraints = new VariableConstraint[] { constraint0,
33: constraint1 };
34: checkBetaConstraints(constraints, DoubleBetaConstraints.class);
35: }
36:
37: public void testTwoIndxed() {
38: VariableConstraint constraint0 = (VariableConstraint) getConstraint(
39: "cheeseType0", Operator.EQUAL, "type", Cheese.class);
40: VariableConstraint constraint1 = (VariableConstraint) getConstraint(
41: "cheeseType1", Operator.EQUAL, "type", Cheese.class);
42: VariableConstraint[] constraints = new VariableConstraint[] {
43: constraint0, constraint1 };
44: checkBetaConstraints(constraints, DoubleBetaConstraints.class);
45: }
46:
47: }
|