ConcreteComparisonFilter lessOrEqualsFilter = new ConcreteComparisonFilter(
ComparisonFilter.Operator.LE);
ConcreteComparisonFilter greaterOrEqualsFilter =
new ConcreteComparisonFilter(ComparisonFilter.Operator.GE);
assertTrue(equalsFilter.isOperatorMatch(new NumberValue(123),
new NumberValue(123)));
assertTrue(equalsFilter.isOperatorMatch(new TextValue("abc"),
new TextValue("abc")));
assertTrue(equalsFilter.isOperatorMatch(BooleanValue.TRUE,
BooleanValue.TRUE));
assertFalse(equalsFilter.isOperatorMatch(new NumberValue(123),
new NumberValue(345)));
assertFalse(equalsFilter.isOperatorMatch(new TextValue("ab"),
new TextValue("abc")));
assertTrue(lessThanFilter.isOperatorMatch(new NumberValue(123.123),
new NumberValue(123.124)));
assertTrue(lessThanFilter.isOperatorMatch(new TextValue("abc"),
new TextValue("abd")));
assertTrue(lessThanFilter.isOperatorMatch(BooleanValue.FALSE,
BooleanValue.TRUE));
assertFalse(lessThanFilter.isOperatorMatch(new NumberValue(7),
new NumberValue(-14)));
assertFalse(lessThanFilter.isOperatorMatch(new TextValue("bbb"),
new TextValue("aaa")));
assertFalse(lessThanFilter.isOperatorMatch(BooleanValue.TRUE,
BooleanValue.FALSE));
assertTrue(lessOrEqualsFilter.isOperatorMatch(new NumberValue(123),
new NumberValue(123)));
assertTrue(lessOrEqualsFilter.isOperatorMatch(new TextValue("abc"),
new TextValue("abc")));
assertTrue(lessOrEqualsFilter.isOperatorMatch(BooleanValue.TRUE,
BooleanValue.TRUE));
assertTrue(lessOrEqualsFilter.isOperatorMatch(new NumberValue(123.123),
new NumberValue(123.124)));
assertTrue(lessOrEqualsFilter.isOperatorMatch(new TextValue("abc"),
new TextValue("abd")));
assertTrue(lessOrEqualsFilter.isOperatorMatch(BooleanValue.FALSE,
BooleanValue.TRUE));
assertFalse(lessOrEqualsFilter.isOperatorMatch(new NumberValue(123),
new NumberValue(122.2)));
assertFalse(lessOrEqualsFilter.isOperatorMatch(new TextValue("ab"),
new TextValue("aa")));
assertFalse(lessOrEqualsFilter.isOperatorMatch(new NumberValue(7),
new NumberValue(-14)));
assertFalse(lessOrEqualsFilter.isOperatorMatch(new TextValue("bbb"),
new TextValue("aaa")));
assertFalse(lessOrEqualsFilter.isOperatorMatch(BooleanValue.TRUE,
BooleanValue.FALSE));
assertFalse(notEqualsFilter.isOperatorMatch(new NumberValue(123),
new NumberValue(123)));
assertFalse(notEqualsFilter.isOperatorMatch(new TextValue("abc"),
new TextValue("abc")));
assertFalse(notEqualsFilter.isOperatorMatch(BooleanValue.TRUE,
BooleanValue.TRUE));
assertTrue(notEqualsFilter.isOperatorMatch(new NumberValue(123),
new NumberValue(345)));
assertTrue(notEqualsFilter.isOperatorMatch(new TextValue("ab"),
new TextValue("abc")));
assertFalse(greaterOrEqualsFilter.isOperatorMatch(new NumberValue(123.123),
new NumberValue(123.124)));
assertFalse(greaterOrEqualsFilter.isOperatorMatch(new TextValue("abc"),
new TextValue("abd")));
assertFalse(greaterOrEqualsFilter.isOperatorMatch(BooleanValue.FALSE,
BooleanValue.TRUE));
assertTrue(greaterOrEqualsFilter.isOperatorMatch(new NumberValue(7),
new NumberValue(-14)));
assertTrue(greaterOrEqualsFilter.isOperatorMatch(new TextValue("bbb"),
new TextValue("aaa")));
assertTrue(greaterOrEqualsFilter.isOperatorMatch(BooleanValue.TRUE,
BooleanValue.FALSE));
assertFalse(greaterThanFilter.isOperatorMatch(new NumberValue(123),
new NumberValue(123)));
assertFalse(greaterThanFilter.isOperatorMatch(new TextValue("abc"),
new TextValue("abc")));
assertFalse(greaterThanFilter.isOperatorMatch(BooleanValue.TRUE,
BooleanValue.TRUE));
assertFalse(greaterThanFilter.isOperatorMatch(new NumberValue(123.123),
new NumberValue(123.124)));
assertFalse(greaterThanFilter.isOperatorMatch(new TextValue("abc"),
new TextValue("abd")));
assertFalse(greaterThanFilter.isOperatorMatch(BooleanValue.FALSE,
BooleanValue.TRUE));
assertTrue(greaterThanFilter.isOperatorMatch(new NumberValue(123),
new NumberValue(122.2)));
assertTrue(greaterThanFilter.isOperatorMatch(new TextValue("ab"),
new TextValue("aa")));
assertTrue(greaterThanFilter.isOperatorMatch(new NumberValue(7),
new NumberValue(-14)));
assertTrue(greaterThanFilter.isOperatorMatch(new TextValue("bbb"),
new TextValue("aaa")));
assertTrue(greaterThanFilter.isOperatorMatch(BooleanValue.TRUE,
BooleanValue.FALSE));
// Test type mismatch:
assertFalse(greaterThanFilter.isOperatorMatch(new TextValue("blah"),
new NumberValue(123)));
assertFalse(equalsFilter.isOperatorMatch(new DateValue(2000, 3, 3),
BooleanValue.TRUE));
}