ScriptFilterUtil { public static void applyFilter(ScriptFilter filter, List<ScriptStep> steps) { boolean allConditionsMustPass = filter.getAllConditionsMustPass(); Set<ScriptStep> stepsToDelete = new HashSet<ScriptStep>(); SortedMap<Integer, ScriptStep> stepsToAdd = new TreeMap<Integer, ScriptStep>(); for (ScriptStep step : steps) { boolean conditionsMet = true; for (ScriptFilterCondition condition : filter.getConditions()) { conditionsMet = testConditions(condition.getScope(), condition, step, steps); if (!conditionsMet && allConditionsMustPass) { break; } else if (conditionsMet && !allConditionsMustPass) { break; } } if (conditionsMet) { doAction(steps, stepsToAdd, stepsToDelete, filter.getActions(), step); } } int reqCount = 0; for (Integer index : stepsToAdd.keySet()) { steps.add(index + reqCount, stepsToAdd.get(index)); reqCount++; } for (ScriptStep delete : stepsToDelete) { steps.remove(delete); } }  static List<ScriptStep> applyFilters(Collection<ScriptFilter> filters, List<ScriptStep> steps); static void applyFilters(List<Integer> filterIds, Script script); static void applyFiltersToScript(Collection<ScriptFilter> filters, Script script); static void applyFilter(ScriptFilter filter, List<ScriptStep> steps); static boolean filterOnField(String filterField, ScriptFilterCondition condition,
            ScriptStep currentStep); static boolean filterOnFieldSets(Set<RequestData> fields, ScriptFilterCondition condition,
            ScriptStep currentStep, List<ScriptStep> steps); static ScriptStep doAction(Set<ScriptFilterAction> actions, ScriptStep step);  }
@Test public void testApplyFilter_1() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_2() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setActions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_3() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_4() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setActions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_5() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setActions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_6() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setActions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_7() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setActions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_8() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setActions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_9() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_10() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_11() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_12() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_13() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_14() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_15() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }
@Test public void testApplyFilter_16() throws Exception { ScriptFilter filter = new ScriptFilter(); filter.setConditions(new HashSet()); filter.setAllConditionsMustPass(true); List<ScriptStep> steps = new LinkedList(); ScriptFilterUtil.applyFilter(filter, steps); }