@Test public void testCleanAllRules() { JSONObject body = new JSONObject(); String ruleName = "timer_test_rule1@ttestservice1/test/timerRule1"; String ruleText = "context ctxt$ttestservice1$test$timerRule1 select \"timer_test_rule1\" as ruleName, *, current_timestamp() as currentTS from pattern [every timer:interval(30 sec)]"; body.put("name", ruleName); body.put("text", ruleText); instance.saveTimeRules(body.toString()); JSONObject body2 = new JSONObject(); String ruleName2 = "timer_test_rule2@ttestservice2/test/timerRule2"; String ruleText2 = "context ctxt$ttestservice2$test$timerRule2 select \"timer_test_rule2\" as ruleName, *, current_timestamp() as currentTS from pattern [every timer:interval(90 sec)]"; body2.put("name", ruleName2); body2.put("text", ruleText2); instance.saveTimeRules(body2.toString()); instance.cleanAllRules(); HashMap<String, JSONObject> result = instance.getAllRulesInfo(); assertEquals(0, result.size()); }
public void cleanAllRules() { rulesInfo = new HashMap<String, JSONObject>(); }
TimeRulesStore { public void cleanAllRules() { rulesInfo = new HashMap<String, JSONObject>(); } }
TimeRulesStore { public void cleanAllRules() { rulesInfo = new HashMap<String, JSONObject>(); } private  TimeRulesStore(); }
TimeRulesStore { public void cleanAllRules() { rulesInfo = new HashMap<String, JSONObject>(); } private  TimeRulesStore(); static TimeRulesStore getInstance(); void saveTimeRules(String body); HashMap<String, JSONObject> getAllRulesInfo(); JSONObject getRuleInfo(String ruleName); void removeTimeRule(String ruleName); void cleanAllRules(); }
TimeRulesStore { public void cleanAllRules() { rulesInfo = new HashMap<String, JSONObject>(); } private  TimeRulesStore(); static TimeRulesStore getInstance(); void saveTimeRules(String body); HashMap<String, JSONObject> getAllRulesInfo(); JSONObject getRuleInfo(String ruleName); void removeTimeRule(String ruleName); void cleanAllRules();  }