Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 1 | [ |
| 2 | { |
| 3 | "id": 1, |
| 4 | "testCaseDescription": "test GetConfig String Not valid", |
| 5 | "testFor": "getConfig", |
| 6 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 7 | "ONAPName": "fail", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 8 | "ConfigName": null, |
| 9 | "configAttributes": null, |
| 10 | "expectedResult":[ |
| 11 | "Policy Name: null Policy version: null - not_found", |
| 12 | ] |
| 13 | }, |
| 14 | { |
| 15 | "id": 2, |
| 16 | "testCaseDescription": "test Get ConfigString Valid JSON", |
| 17 | "testFor": "getConfig", |
| 18 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 19 | "ONAPName": "JSON", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 20 | "ConfigName": null, |
| 21 | "configAttributes": null, |
| 22 | "expectedResult":[ |
| 23 | "Policy Name: null Policy version: null - not_found", |
| 24 | ] |
| 25 | }, |
| 26 | { |
| 27 | "id": 3, |
| 28 | "testCaseDescription": "test Get ConfigString Valid XML", |
| 29 | "testFor": "getConfig", |
| 30 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 31 | "ONAPName": "XML", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 32 | "ConfigName": null, |
| 33 | "configAttributes": null, |
| 34 | "expectedResult":[ |
| 35 | "Policy Name: null Policy version: null - not_found", |
| 36 | ] |
| 37 | }, |
| 38 | { |
| 39 | "id": 4, |
| 40 | "testCaseDescription": "test Get ConfigString Valid properties", |
| 41 | "testFor": "getConfig", |
| 42 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 43 | "ONAPName": "Properties", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 44 | "ConfigName": null, |
| 45 | "configAttributes": null, |
| 46 | "expectedResult":[ |
| 47 | "Policy Name: null Policy version: null - not_found", |
| 48 | ] |
| 49 | }, |
| 50 | { |
| 51 | "id": 5, |
| 52 | "testCaseDescription": "test Get ConfigString Valid other", |
| 53 | "testFor": "getConfig", |
| 54 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 55 | "ONAPName": "Other", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 56 | "ConfigName": null, |
| 57 | "configAttributes": null, |
| 58 | "expectedResult":[ |
| 59 | "Policy Name: null Policy version: null - not_found", |
| 60 | ] |
| 61 | }, |
| 62 | { |
| 63 | "id": 6, |
| 64 | "testCaseDescription": "test GetConfig String String Fail", |
| 65 | "testFor": "getConfig", |
| 66 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 67 | "ONAPName": null, |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 68 | "ConfigName": null, |
| 69 | "configAttributes": null, |
| 70 | "expectedResult":[ |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 71 | "org.onap.policy.api.PolicyConfigException: No onapComponentName given.", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 72 | ] |
| 73 | }, |
| 74 | { |
| 75 | "id": 7, |
| 76 | "testCaseDescription": "test GetConfig String String Fail1", |
| 77 | "testFor": "getConfig", |
| 78 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 79 | "ONAPName": null, |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 80 | "ConfigName": null, |
| 81 | "configAttributes": null, |
| 82 | "expectedResult":[ |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 83 | "org.onap.policy.api.PolicyConfigException: No onapComponentName given." |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 84 | |
| 85 | ] |
| 86 | }, |
| 87 | { |
| 88 | "id": 8, |
| 89 | "testCaseDescription": "test GetConfig String String Valid ", |
| 90 | "testFor": "getConfig", |
| 91 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 92 | "ONAPName": "fail", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 93 | "ConfigName": "fail", |
| 94 | "configAttributes": null, |
| 95 | "expectedResult":[ |
| 96 | "Policy Name: null Policy version: null - not_found", |
| 97 | ] |
| 98 | }, |
| 99 | { |
| 100 | "id": 9, |
| 101 | "testCaseDescription": "test GetConfig String String Valid JSON", |
| 102 | "testFor": "getConfig", |
| 103 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 104 | "ONAPName": "JSON", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 105 | "ConfigName": "JSONconfig", |
| 106 | "configAttributes": null, |
| 107 | "expectedResult":[ |
| 108 | "Policy Name: null Policy version: null - not_found", |
| 109 | ] |
| 110 | }, |
| 111 | { |
| 112 | "id": 10, |
| 113 | "testCaseDescription": "test GetConfig String String Valid XML", |
| 114 | "testFor": "getConfig", |
| 115 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 116 | "ONAPName": "XML", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 117 | "ConfigName": "XMLconfig", |
| 118 | "configAttributes": null, |
| 119 | "expectedResult":[ |
| 120 | "Policy Name: null Policy version: null - not_found", |
| 121 | ] |
| 122 | }, |
| 123 | { |
| 124 | "id": 11, |
| 125 | "testCaseDescription": "test GetConfig String String Valid properties", |
| 126 | "testFor": "getConfig", |
| 127 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 128 | "ONAPName": "Properties", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 129 | "ConfigName": "PropConfig", |
| 130 | "configAttributes": null, |
| 131 | "expectedResult":[ |
| 132 | "Policy Name: null Policy version: null - not_found", |
| 133 | ] |
| 134 | }, |
| 135 | { |
| 136 | "id": 12, |
| 137 | "testCaseDescription": "test GetConfig String String Valid other", |
| 138 | "testFor": "getConfig", |
| 139 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 140 | "ONAPName": "Other", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 141 | "ConfigName": "OtherConfig", |
| 142 | "configAttributes": null, |
| 143 | "expectedResult":[ |
| 144 | "Policy Name: null Policy version: null - not_found", |
| 145 | ] |
| 146 | }, |
| 147 | { |
| 148 | "id": 13, |
| 149 | "testCaseDescription": "test GetConfig String String String fail", |
| 150 | "testFor": "getConfig", |
| 151 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 152 | "ONAPName": null, |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 153 | "ConfigName": null, |
| 154 | "configAttributes": null, |
| 155 | "expectedResult":[ |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 156 | "org.onap.policy.api.PolicyConfigException: No onapComponentName given." |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 157 | ] |
| 158 | }, |
| 159 | { |
| 160 | "id": 14, |
| 161 | "testCaseDescription": "test GetConfig String String String fail1", |
| 162 | "testFor": "getConfig", |
| 163 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 164 | "ONAPName": null, |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 165 | "ConfigName": "testFail", |
| 166 | "configAttributes": [ |
| 167 | { |
| 168 | "key": "TestValue", |
| 169 | "value": "Fail", |
| 170 | }, |
| 171 | ], |
| 172 | "expectedResult":[ |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 173 | "org.onap.policy.api.PolicyConfigException: No onapComponentName given.", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 174 | ] |
| 175 | }, |
| 176 | { |
| 177 | "id": 15, |
| 178 | "testCaseDescription": "test GetConfig String String String fail2", |
| 179 | "testFor": "getConfig", |
| 180 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 181 | "ONAPName": "TestFail", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 182 | "ConfigName": null, |
| 183 | "configAttributes": [ |
| 184 | { |
| 185 | "key": "TestValue", |
| 186 | "value": "Fail", |
| 187 | }, |
| 188 | ], |
| 189 | "expectedResult":[ |
| 190 | "Policy Name: null Policy version: null - not_found", |
| 191 | ] |
| 192 | }, |
| 193 | { |
| 194 | "id": 16, |
| 195 | "testCaseDescription": "test GetConfig String String String fail3", |
| 196 | "testFor": "getConfig", |
| 197 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 198 | "ONAPName": "TestFail", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 199 | "ConfigName": "configFail", |
| 200 | "configAttributes": null, |
| 201 | "expectedResult":[ |
| 202 | "Policy Name: null Policy version: null - not_found", |
| 203 | ] |
| 204 | }, |
| 205 | { |
| 206 | "id": 17, |
| 207 | "testCaseDescription": "test GetConfig String String String fail4", |
| 208 | "testFor": "getConfig", |
| 209 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 210 | "ONAPName": "TestFail", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 211 | "ConfigName": "configFail", |
| 212 | "configAttributes": [ |
| 213 | { |
| 214 | "key": "", |
| 215 | "value": "", |
| 216 | }, |
| 217 | ], |
| 218 | "expectedResult":[ |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 219 | "org.onap.policy.api.PolicyConfigException: Cannot have an empty Key", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 220 | |
| 221 | ] |
| 222 | }, |
| 223 | { |
| 224 | "id": 18, |
| 225 | "testCaseDescription": "test GetConfig String String String Valid", |
| 226 | "testFor": "getConfig", |
| 227 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 228 | "ONAPName": "TestFail", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 229 | "ConfigName": "configFail", |
| 230 | "configAttributes": [ |
| 231 | { |
| 232 | "key": "Action:com.test.fail", |
| 233 | "value": "Value", |
| 234 | }, |
| 235 | ], |
| 236 | "expectedResult":[ |
| 237 | "Policy Name: null Policy version: null - not_found", |
| 238 | ] |
| 239 | }, |
| 240 | { |
| 241 | "id": 19, |
| 242 | "testCaseDescription": "test GetConfig String String String Valid JSON", |
| 243 | "testFor": "getConfig", |
| 244 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 245 | "ONAPName": "JSON", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 246 | "ConfigName": "JSONconfig", |
| 247 | "configAttributes": [ |
| 248 | { |
| 249 | "key": "Resource.com:test:resource:json", |
| 250 | "value":"Test", |
| 251 | }, |
| 252 | { |
| 253 | "key": "Action.com:test:action:json", |
| 254 | "value":"TestJSON", |
| 255 | }, |
| 256 | { |
| 257 | "key": "Subject.com:test:subject:json", |
| 258 | "value":"TestSubject", |
| 259 | } |
| 260 | ], |
| 261 | "expectedResult":[ |
| 262 | "Policy Name: null Policy version: null - not_found", |
| 263 | ] |
| 264 | }, |
| 265 | { |
| 266 | "id": 20, |
| 267 | "testCaseDescription": "test GetConfig String String String Valid XML", |
| 268 | "testFor": "getConfig", |
| 269 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 270 | "ONAPName": "XML", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 271 | "ConfigName": "XMLconfig", |
| 272 | "configAttributes": [ |
| 273 | { |
| 274 | "key": "Resource.com:test:resource:json", |
| 275 | "value":"Test", |
| 276 | }, |
| 277 | { |
| 278 | "key": "Action.com:test:action:json", |
| 279 | "value":"TestJSON", |
| 280 | }, |
| 281 | { |
| 282 | "key": "Subject.com:test:subject:json", |
| 283 | "value":"TestSubject", |
| 284 | } |
| 285 | ], |
| 286 | "expectedResult":[ |
| 287 | "Policy Name: null Policy version: null - not_found", |
| 288 | ] |
| 289 | }, |
| 290 | { |
| 291 | "id": 21, |
| 292 | "testCaseDescription": "test GetConfig String String String Valid properties", |
| 293 | "testFor": "getConfig", |
| 294 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 295 | "ONAPName": "Properties", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 296 | "ConfigName": "PropConfig", |
| 297 | "configAttributes": [ |
| 298 | { |
| 299 | "key": "Resource.com:test:resource:json", |
| 300 | "value":"Test", |
| 301 | }, |
| 302 | { |
| 303 | "key": "Action.com:test:action:json", |
| 304 | "value":"TestJSON", |
| 305 | }, |
| 306 | { |
| 307 | "key": "Subject.com:test:subject:json", |
| 308 | "value":"TestSubject", |
| 309 | } |
| 310 | ], |
| 311 | "expectedResult":[ |
| 312 | "Policy Name: null Policy version: null - not_found", |
| 313 | ] |
| 314 | }, |
| 315 | { |
| 316 | "id": 22, |
| 317 | "testCaseDescription": "test GetConfig String String String Valid other", |
| 318 | "testFor": "getConfig", |
| 319 | "PDP_URLConfigFile": "config.properties" |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 320 | "ONAPName": "Other", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 321 | "ConfigName": "OtherConfig", |
| 322 | "configAttributes": [ |
| 323 | { |
| 324 | "key": "Resource.com:test:resource:json", |
| 325 | "value":"Test", |
| 326 | }, |
| 327 | { |
| 328 | "key": "Action.com:test:action:json", |
| 329 | "value":"TestJSON", |
| 330 | }, |
| 331 | { |
| 332 | "key": "Subject.com:test:subject:json", |
| 333 | "value":"TestSubject", |
| 334 | } |
| 335 | ], |
| 336 | "expectedResult":[ |
| 337 | "Policy Name: null Policy version: null - not_found", |
| 338 | ] |
| 339 | }, |
| 340 | { |
| 341 | "id": 23, |
| 342 | "testCaseDescription": "test SendEvent Fail", |
| 343 | "testFor": "getAction", |
| 344 | "PDP_URLConfigFile": "config.properties", |
| 345 | "eventAttributes": null, |
| 346 | "expectedResult":[ |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 347 | "org.onap.policy.api.PolicyEventException: No EventAttributes Given.", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 348 | ] |
| 349 | }, |
| 350 | { |
| 351 | "id": 24, |
| 352 | "testCaseDescription": "test SendEvent Fail null", |
| 353 | "testFor": "getAction", |
| 354 | "PDP_URLConfigFile": "config.properties", |
| 355 | "eventAttributes": [ |
| 356 | { |
| 357 | "key": "", |
| 358 | "value": "" |
| 359 | }, |
| 360 | ], |
| 361 | "expectedResult":[ |
Guo Ruijing | 073cc18 | 2017-07-31 08:47:35 +0000 | [diff] [blame] | 362 | "org.onap.policy.api.PolicyEventException: Cannot have an empty Key", |
Pamela Dragosh | 91d04c6 | 2017-02-14 19:41:00 -0500 | [diff] [blame] | 363 | |
| 364 | ] |
| 365 | }, |
| 366 | { |
| 367 | "id": 25, |
| 368 | "testCaseDescription": "test SendEvent Not Valid", |
| 369 | "testFor": "getAction", |
| 370 | "PDP_URLConfigFile": "config.properties", |
| 371 | "eventAttributes": [ |
| 372 | { |
| 373 | "key": "Action.fail", |
| 374 | "value": "Value" |
| 375 | }, |
| 376 | ], |
| 377 | "expectedResult":[ |
| 378 | "Decision not a Permit. : no_action", |
| 379 | ] |
| 380 | }, |
| 381 | { |
| 382 | "id": 26, |
| 383 | "testCaseDescription": "test SendEvent Action Advised", |
| 384 | "testFor": "getAction", |
| 385 | "PDP_URLConfigFile": "config.properties", |
| 386 | "eventAttributes": [ |
| 387 | { |
| 388 | "key": "Key", |
| 389 | "value": "Value" |
| 390 | }, |
| 391 | { |
| 392 | "key": "cpu", |
| 393 | "value": "80" |
| 394 | }, |
| 395 | ], |
| 396 | "expectedResult":[ |
| 397 | "Decision not a Permit. : no_action", |
| 398 | ] |
| 399 | }, |
| 400 | { |
| 401 | "id": 27, |
| 402 | "testCaseDescription": "test SendEvent Action Taken", |
| 403 | "testFor": "getAction", |
| 404 | "PDP_URLConfigFile": "config.properties", |
| 405 | "eventAttributes": [ |
| 406 | { |
| 407 | "key": "Key", |
| 408 | "value": "Value" |
| 409 | }, |
| 410 | { |
| 411 | "key": "cpu", |
| 412 | "value": "91" |
| 413 | }, |
| 414 | ], |
| 415 | "expectedResult":[ |
| 416 | "Decision not a Permit. : no_action", |
| 417 | ] |
| 418 | }, |
| 419 | ] |