next = plan.getSuccessors(next).get(0);
Assert.assertEquals(next.getClass(), LOFilter.class);
next = plan.getSuccessors(next).get(0);
Assert.assertEquals(LOStore.class, next.getClass());
OperatorPlan transformed = listener.getTransformed();
Assert.assertEquals(transformed.size(), 3);
// run push up filter rule
r = new PushUpFilter("PushUpFilter");
s = new HashSet<Rule>();
s.add(r);
ls = new ArrayList<Set<Rule>>();
ls.add(s);
optimizer = new MyPlanOptimizer(plan, ls, 3);
listener = new MyPlanTransformListener();
optimizer.addPlanTransformListener(listener);
optimizer.optimize();
// 2 filters should be moved up to be after each load, and one filter should remain
next = plan.getSuccessors(load1).get(0);
Assert.assertEquals(next.getClass(), LOFilter.class);
Assert.assertEquals(plan.getSuccessors(next).get(0), join);
next = plan.getSuccessors(load2).get(0);
Assert.assertEquals(next.getClass(), LOFilter.class);
Assert.assertEquals(plan.getSuccessors(next).get(0), join);
next = plan.getSuccessors(join).get(0);
Assert.assertEquals(next.getClass(), LOFilter.class);
next = plan.getSuccessors(next).get(0);
Assert.assertEquals(next.getClass(), LOStore.class);
transformed = listener.getTransformed();
Assert.assertEquals(transformed.size(), 7);
// run merge filter rule
r = new MergeFilter("MergeFilter");
s = new HashSet<Rule>();
s.add(r);