diff --git a/pyproject.toml b/pyproject.toml index 0c0039a..a78f1e3 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -4,7 +4,7 @@ build-backend = "setuptools.build_meta" [project] name = "drools_jpy" -version = "0.3.7" +version = "0.3.8" authors = [ { name="Madhu Kanoor", email="author@example.com" }, ] diff --git a/src/drools/jars/drools-ansible-rulebook-integration-runtime-1.0.4-SNAPSHOT.jar b/src/drools/jars/drools-ansible-rulebook-integration-runtime-1.0.5-SNAPSHOT.jar similarity index 83% rename from src/drools/jars/drools-ansible-rulebook-integration-runtime-1.0.4-SNAPSHOT.jar rename to src/drools/jars/drools-ansible-rulebook-integration-runtime-1.0.5-SNAPSHOT.jar index cea01d5..125c563 100644 Binary files a/src/drools/jars/drools-ansible-rulebook-integration-runtime-1.0.4-SNAPSHOT.jar and b/src/drools/jars/drools-ansible-rulebook-integration-runtime-1.0.5-SNAPSHOT.jar differ diff --git a/tests/asts/test_compare_with_saved_event_ast.yml b/tests/asts/test_compare_with_saved_event_ast.yml new file mode 100644 index 0000000..86ec735 --- /dev/null +++ b/tests/asts/test_compare_with_saved_event_ast.yml @@ -0,0 +1,134 @@ +- RuleSet: + hosts: + - all + name: compare with saved events + rules: + - Rule: + actions: + - Action: + action: print_event + action_args: + pretty: true + condition: + AllCondition: + - AssignmentExpression: + lhs: + Events: match + rhs: + EqualsExpression: + lhs: + Event: plu + rhs: + Integer: 4132 + - ItemInListExpression: + lhs: + Event: fruit + rhs: + Events: match.apples + enabled: true + name: Gala rules + - Rule: + actions: + - Action: + action: print_event + action_args: + pretty: true + condition: + AllCondition: + - AssignmentExpression: + lhs: + Events: match + rhs: + EqualsExpression: + lhs: + Event: plu + rhs: + Integer: 4284 + - ListContainsItemExpression: + lhs: + Events: match.grapefruits + rhs: + Event: fruit + enabled: true + name: Ruby Red rules + - Rule: + actions: + - Action: + action: print_event + action_args: + pretty: true + condition: + AllCondition: + - AssignmentExpression: + lhs: + Events: apple + rhs: + EqualsExpression: + lhs: + Event: fruit.name + rhs: + String: Braeburn + - ItemInListExpression: + lhs: + Events: apple.fruit.plu + rhs: + Event: favorite_apple_plus + enabled: true + name: Braeburn rules + - Rule: + actions: + - Action: + action: print_event + action_args: + pretty: true + condition: + AllCondition: + - AssignmentExpression: + lhs: + Events: mango + rhs: + EqualsExpression: + lhs: + Event: fruit.name + rhs: + String: Kent + - ListContainsItemExpression: + lhs: + Event: favorite_mango_plus + rhs: + Events: mango.fruit.plu + enabled: true + name: Kent mango rules + sources: + - EventSource: + name: my source + source_args: + payload: + - apples: + - gala large apple + - gala small apple + plu: 4132 + - fruit: gala large apple + - grapefruits: + - Ray Ruby + - Ruby Red + plu: 4284 + - fruit: Ruby Red + - fruit: + name: Braeburn + plu: 4101 + - favorite_apple_plus: + - 4101 + - 4103 + - 4132 + - 4133 + - fruit: + name: Kent + plu: 3488 + - favorite_mango_plus: + - 3488 + - 4959 + - 4051 + - 4312 + source_filters: [] + source_name: ansible.eda.generic diff --git a/tests/asts/test_match_multiple_rules_with_all_ast.yml b/tests/asts/test_match_multiple_rules_with_all_ast.yml new file mode 100644 index 0000000..59c9999 --- /dev/null +++ b/tests/asts/test_match_multiple_rules_with_all_ast.yml @@ -0,0 +1,49 @@ +- RuleSet: + hosts: + - all + match_multiple_rules: true + name: 83 match multiple rules + rules: + - Rule: + actions: + - Action: + action: debug + action_args: {} + condition: + AllCondition: + - EqualsExpression: + lhs: + Event: i + rhs: + Integer: 1 + enabled: true + name: r1 + - Rule: + actions: + - Action: + action: print_event + action_args: {} + condition: + AllCondition: + - EqualsExpression: + lhs: + Event: i + rhs: + Integer: 1 + - EqualsExpression: + lhs: + Event: i + rhs: + Integer: 3 + enabled: true + name: r11 + sources: + - EventSource: + name: ansible.eda.generic + source_args: + payload: + - i: 1 + - i: 9 + - i: 3 + source_filters: [] + source_name: ansible.eda.generic diff --git a/tests/test_ruleset.py b/tests/test_ruleset.py index c497406..a2fcdaf 100644 --- a/tests/test_ruleset.py +++ b/tests/test_ruleset.py @@ -985,6 +985,8 @@ def test_assert_event_string_search(): "asts/test_squaredaccessor_cases_ast.yml", "asts/test_squaredaccessor_selectattr_cases_ast.yml", "asts/test_non_alpha_key_ast.yml", + "asts/test_match_multiple_rules_with_all_ast.yml", + "asts/test_compare_with_saved_event_ast.yml", ], ) def test_integrated(rulebook):