blob: 5a8e81146c320ff8ad7fb0960d581432ef47a3e0 [file] [log] [blame]
Guangrong Fu603b27e2017-09-04 18:26:10 +08001*** Settings ***
2Suite Setup
3Suite Teardown Delete All Sessions
4Test Teardown
5Test Timeout
6Library demjson
7Resource Engine-Keywords.robot
8Resource ../RuleMgt/Rule-Keywords.robot
9
10*** Test Cases ***
11verify_invalid_rule
12 [Documentation] Verify a rule with invalid contents.
13 ${dic1} create dictionary content=123123123
14 ${Jsonparam} encode ${dic1}
15 verifyEngineRule ${Jsonparam} -1
16
17verify_valid_rule
18 [Documentation] Verify a rule with valid contents.
19 ${dic2} create dictionary content=package rule03080001
20 ${Jsonparam} encode ${dic2}
21 verifyEngineRule ${Jsonparam}
22
23deploy_invalid_rule
24 [Documentation] Add a rule with invalid contents to the engine.
Shiwei Tiane6872862018-03-07 15:19:22 +080025 ${dic3} create dictionary content=789789789 engineId=""
Guangrong Fu603b27e2017-09-04 18:26:10 +080026 ${Jsonparam} encode ${dic3}
27 ${response} deployEngineRule ${Jsonparam} -1
28
29deploy_valid_rule
30 [Documentation] Add a rule with valid contents to the engine.
Shiwei Tiane6872862018-03-07 15:19:22 +080031 ${dic4} create dictionary content=package rule03080002;\n\nimport java.util.Locale; engineId="" loopControlName=test
Guangrong Fu603b27e2017-09-04 18:26:10 +080032 ${Jsonparam} encode ${dic4}
33 ${response} deployEngineRule ${Jsonparam}
34
35delete_existing_rule
36 [Documentation] Delete an existing rule using an existing package ID from the engine.
37 deleteEngineRule rule03080002
38
39delete_non_existing_rule
40 [Documentation] Delete an existing rule using a non-existing package ID from the engine.
41 deleteEngineRule rule03080002 -1