session.setAgendaFilter(new RuleNameMatchesAgendaFilter(
"Remove useless date gaps greater or greater and equal"));
Collection<Object> testData = new ArrayList<Object>();
Field f = new Field();
testData.add(f);
// > "01-Oct-2007" covered
LiteralRestriction lower = new LiteralRestriction();
lower.setRuleName("> 01-Oct-2007 covered");
lower.setFieldId(f.getId());
lower.setEvaluator(">");
lower.setValue("01-Oct-2007");
testData.add(lower);
// == "10-Oct-2007" covered
LiteralRestriction r1 = new LiteralRestriction();
r1.setRuleName("== 10-Oct-2007 covered");
r1.setFieldId(f.getId());
r1.setEvaluator("==");
r1.setValue("10-Oct-2007");
testData.add(r1);
// > "10-Oct-2007" gap
Gap g1 = new Gap(f, ">", r1);
g1.setFiredRuleName("above");
testData.add(g1);
// < "10-Oct-2007" gap
Gap g2 = new Gap(f, "<", r1);
g2.setFiredRuleName("below");
testData.add(g2);
// < "15-Oct-2007" covered
LiteralRestriction r2 = new LiteralRestriction();
r2.setRuleName("< 15-Oct-2007 covered");
r2.setFieldId(f.getId());
r2.setEvaluator("<");
r2.setValue("15-Oct-2007");
testData.add(r2);
// >= "15-Oct-2007" gap
Gap g3 = new Gap(f, ">=", r2);
g3.setFiredRuleName("15-Oct-2007gap");
testData.add(g3);
// < "20-Oct-2007" covered
LiteralRestriction higher = new LiteralRestriction();
higher.setRuleName("< 20-Oct-2007 covered");
higher.setFieldId(f.getId());
higher.setEvaluator("<");
higher.setValue("20-Oct-2007");
testData.add(higher);
AnalyticsData data = AnalyticsDataFactory.getAnalyticsData();