Close timing loop-hole when YAML updated 47/72347/1
authorJim Hahn <jrh3@att.com>
Wed, 7 Nov 2018 18:44:21 +0000 (13:44 -0500)
committerJim Hahn <jrh3@att.com>
Fri, 9 Nov 2018 21:47:15 +0000 (16:47 -0500)
commit6c72ec89f54bce0741350d3f299c5b441b4f60cc
treedff7c94dd2665f8dd5b17d7ab7b76a054e54ebef
parent830ede893c2a05ac1e7d69068c25d25fd7cc0049
Close timing loop-hole when YAML updated

Noticed when YAML updates are pushed close together that some
Params objects are deleted that should not be.  Fixed that by
eliminating the "active" list concept and only deleting a Params
object that has an associated cleaner.  If it has no cleaner,
then it can't be deleted, regardless of timing with rule updates.

Added more tests for rule updates, including cases to check
for event objects being retracted, as well as Params objects
being retracted when rules are deleted.

Change-Id: I6b744b29fca228022f43e9322ea149b16d097675
Issue-ID: POLICY-1248
Signed-off-by: Jim Hahn <jrh3@att.com>
controlloop/templates/archetype-cl-amsterdam/src/main/resources/archetype-resources/src/main/resources/__closedLoopControlName__.drl
controlloop/templates/template.demo.clc/src/main/resources/__closedLoopControlName__.drl
controlloop/templates/template.demo.clc/src/test/java/org/onap/policy/template/demo/clc/ControlLoopEventCleanupTest.java [new file with mode: 0644]
controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test-B.yaml [new file with mode: 0644]
controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test.yaml [new file with mode: 0644]
controlloop/templates/template.demo.clc/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test2.yaml [new file with mode: 0644]
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopEventCleanupTest.java [new file with mode: 0644]
controlloop/templates/template.demo/src/test/java/org/onap/policy/template/demo/ControlLoopParamsCleanupTest.java
controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test-B.yaml [new file with mode: 0644]
controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test.yaml [new file with mode: 0644]
controlloop/templates/template.demo/src/test/resources/yaml/policy_ControlLoop_EventCleanup-test2.yaml [new file with mode: 0644]