jeffjiang: add test for QueryRuleInfo, fix existing QueryRule test and add sanity check for QueryRuleInfo.GetRules