summaryrefslogtreecommitdiffstats
path: root/controlloop/common/eventmanager/src/test
AgeCommit message (Collapse)AuthorFilesLines
2018-08-21move AAI named queryJim Hahn1-52/+88
The AAI vserver named-query was being done as a preliminary step for the SO request. However, it will now be needed during the guard query, which happens much earlier. Thus it has been moved from the SO classes into the event manager class, where it is retrieved in a lazy fashion and cached. Also removed some trailing white space. Update licenses. Make test method private. Change-Id: Id7353a2e0f2d42601d5142cb92961528fa21aa94 Issue-ID: POLICY-1011 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-15add prov-status check to AAI queriesJim Hahn1-149/+347
Also had to add prov-status field to AaiGetVnfResponse class. Removed bogus comment from test. Verify response is not null in test. Verify no requery by vnf name in test. Add prov-status to template.demo tests. Add prov-status to sample json for archetype-cl's. Change-Id: I3f36a2bb6de8265ce5b10103690d6d8813c15b1a Issue-ID: POLICY-964 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-14update AAI response classes per APIJim Hahn1-49/+38
Several of the AAI response classes did not match the new AAI interface. Updated AaiGetVnfResponse and AaiGetVserverResponse and the classes they use to reflect the new API; other top-level classes were left untouched. Fix checkstyle errors. Change-Id: Ife5830c45ba8aece8d676a10f0fd8a9c9fe6cb66 Issue-ID: POLICY-964 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-07-30Copy policy-endpoints from drools-pdp to commonmmis2-5/+5
Replaced references to classes deleted from drools-pdp with references to the corresponding in policy-common Issue-ID: POLICY-967 Change-Id: Ia9d2ac704e6b7c434e5a9e7aee6d7dcf9198e4f2 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-07-05Clean up objects for deleted rulesJim Hahn1-1/+5
When rules for a closed loop are deleted, associated working memory elements may be left around. Modified the code to retract the various elements. Re-added code to unlock when retracting TargetLock. Add junit tests for new methods. Forgot the junit test for request id. Change-Id: Iec2805adbdb147a643f6163badee05ea353ada88 Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-07-05unlock should always return TargetLockJim Hahn1-1/+1
ControlLoopEventManager.unlock only returns the TargetLock if the PolicyGuard.unlock operation is successful. However, if the lock has already expired, then PolicyGuard.unlock will return false, and ControlLoopEventManager.unlock will then return null. As a result, the rules do not retract the TargetLock. (The rules do, however, retract any left-over TargetLock objects during the clean-up phase. Nevertheless, the earlier rules should not have to depend on the clean-up rules to do that.) Modified the code to address this issue. Change-Id: I2e6099a4e3511053d2e6e1373cae4b480798d1b6 Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-29Add time limit to local guard locking facilityJim Hahn1-0/+2
Modified the local policy guard locking facility to add a time parameter. Modified the control loop event manager to extend the lock when lockCurrentOperation() is re-invoked. Modified the rules to retract the lock if the lock request was denied. Reorder assertions in junit test. Change-Id: Ic9b77acbb4881a5a516f30eb56664bad1a5c4d7e Issue-ID: POLICY-872 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-27Modify PolicyGuard to use new locking APIJim Hahn1-1/+1
Modified PolicyGuard to use the locking API from policy-core instead of its own internal map. Initialized PolicyGuard.factory. Fixed bug in eventmanager junit test uncovered due to changes to PolicyGuard. Change-Id: I853ee5f146f3bde16b3f6e65bc188ca7c0cc4f73 Issue-ID: POLICY-577 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-25Prevent AAI re-queryJim Hahn1-37/+39
Modified event manager code to not query AAI if there's already a response from a previous query. Modified code to store AAI properties in local variables instead of static to prevent any chance of a race condition in a multi-threaded situation. Updated junit tests to use a new manager for each subsequent query. Update license. Change variable name, in junit test, from onsetEvent to event, because it can be any type of event. Included fix to prevent initial AAI query if AAI data was already available in the initial onset event. Change-Id: Idf3e15ea8c5e297f22f23570c22fd837b72ba200 Issue-ID: POLICY-754 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-04-16Add missing license headersPamela Dragosh7-0/+85
I removed a couple of empty README and added licenses. Issue-ID: POLICY-741 Change-Id: I10aad3536d02b738a1dc606f7311de6b3a2777cd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-03-27Removed checkstyle warningsmmis3-149/+149
Removed checkstyle warnings from: policy/drools-applications/controlloop/common/model-impl/appc policy/drools-applications/controlloop/common/model-impl/appclcm policy/drools-applications/controlloop/common/model-impl/events including changes to template files due to renamed methods Issue-ID: POLICY-705 Change-Id: Ieb93baf43268aa608f204eef1a610354f2adec32 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-03-26Removed checkstyle warningsmmis2-39/+39
Removed checkstyle warnings from policy/drools-applications/controlloop/common/model-impl/aai including renaming classes: AAI* -> Aai* PNF* -> Pnf* and renaming some methods in those classes Issue-ID: POLICY-705 Change-Id: I2d59a668728aa58a2c9fbe78c44e924e6cfb4531 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-03-22Removed checkstyle warningsmmis9-1882/+1957
Removed checkstyle warnings in: policy/drools-applications/controlloop/common/actors policy/drools-applications/controlloop/common/eventmanager policy/drools-applications/controlloop/common/feature-controlloop-utils Issue-ID: POLICY-705 Change-Id: Iccf99b291bc62bc3ba2082ccdb4c1f9e12107896 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-02-08JUint/Technical Debt for eventmanagerliamfallon14-232/+1776
Unit test expanded for SO POJOs, technical debt removed in eventmanager. Change-Id: I7045f5af88fd2c15019befe29a0b4fcd69801c49 Signed-off-by: liamfallon <liam.fallon@ericsson.com> Issue-ID: POLICY-455 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-01-18Fix Tech Debt/JUnit on control loop event POJOsLiam Fallon2-50/+50
Mainly making fields private, fixing field and methods to follow Java guidelines, and adding getter and setter methods. Unit test added for all classes in org.onap.policy.controlloop Issue-ID: POLICY-455 Change-Id: I445b7cfaf9eb921a230bbb72b06ff4455fe003ce Signed-off-by: Liam Fallon <liam.fallon@ericsson.com>
2017-12-14Cleanup of A&AI message model module.Liam Fallon1-64/+64
Fields have been made fields private in POJOs, and wrote JUnit unit tests to bring up code coverage. AAIManager also changed to use non-static methods so that it can be stubbed with Mockito. Change-Id: I871427ced5db8a1dfd6495fef4e6d84adf264e65 Signed-off-by: Liam Fallon <liam.fallon@ericsson.com> Issue-ID: POLICY-455 Signed-off-by: Liam Fallon <liam.fallon@ericsson.com>
2017-12-06Technical Debt in AAI.Liam Fallon1-15/+15
Eliminate the technical debt identified in the drools-applications/controlloop/common/model-impl/aai module by Sonar Change-Id: I72125baacc217386a4984be04bfc023439eddd13 Signed-off-by: Liam Fallon <liam.fallon@ericsson.com> Issue-ID: POLICY-455 Signed-off-by: Liam Fallon <liam.fallon@ericsson.com>
2017-10-30Fix Final Failure on AAI Queriesdaniel2-1/+39
The drools engine will now send final failure notifications if there is an error returned from A&AI queries instead of rejected notifications. Issue-Id: POLICY-364 Change-Id: Ie9c22686d859c633bad47d223726957cc9599f7c Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-25Ensure no AAI lookup on subsequent onsetCharles Cole2-14/+53
Decoupled checking AAI data from checking an event's syntax so that new onsets can check both while all other events can just check the syntax. Issue-Id: POLICY-371 Change-Id: Ic76b1335b389bbec47ff0d29485ccbb249d5f18c Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-25Fix Source/Target Lockdaniel2-1/+4
The locking of the target is now taken care of when the operation manager is initialized. This allows us to keep the template flow the same and to ensure that for vFW we will not lock the source if it is not intended to be the target. NOTE: This will have to be revised in the future if policy chaining will support having different targets specified for each policy in the chain. Additional work was done for hardening the APPC model code to make sure exceptions are caught and we gracefully end processing the event with memory clean up and a final failure notification sent. Issue-Id: POLICY-367 Change-Id: Ic796d95eb5400067744492f810dd8069ba6241b3 Signed-off-by: Daniel Cruz <dc443y@att.com> Signed-off-by: daniel <dc443y@att.com>
2017-10-24Change vnf-id to vnf-namedaniel1-5/+39
These changes now allow a lookup of the source vnf-id based on the onset's vnf-name. Issue-Id: POLICY-366 Change-Id: I6f6bd500b892dddbbb9e12156b4486208309e21d Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-10-24Ensure no AAI lookup on abatementsCharles Cole1-16/+46
Changed check event syntax in the event manager so that it only looks for AAI info if the event is an onset. Issue-Id: POLICY-368 Change-Id: I241e9a110cc5fc4553a5e9cd842d51f76a800368 Signed-off-by: Charles Cole <cc847m@att.com>
2017-10-18Add support for AAI Named Query error handlingCharles Cole1-3/+3
Errors from AAI after a Named query now throw an AAIEXception. This is caught in the template to allow the resources to be removed from memory and a final failure to be thrown. Issue-ID: POLICY-314 Change-Id: I319d29ef537b2d01ca288622aac1d9dbbe05f5eb Signed-off-by: Charles Cole <cc847m@att.com>
2017-09-21ONAP AAI GET QUERY code to support ONAP projectJoseph Chou1-29/+84
check in code to use simulator url Issue-ID: POLICY-103 Change-Id: I352140dd3cb3159fc2c5738bf02dbb6272de48bc Signed-off-by: Joseph Chou <jc2555@att.com>
2017-09-14Clear eclipse warnings and sonarPamela Dragosh1-22/+8
Removing warnings introduced with A&AI code. This should also address sonar criticals and majors. Issue-ID: POLICY-140 Change-Id: I3f8186dd9c5aa52bfbb061bf95d67b5614b3fb2e Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-09-12ONAP code for AAI, consolidate name and get queryJoseph Chou1-3/+248
Adding AAI GET query feature to support ONAP project (1 commit) Issue-ID: POLICY-103 Change-Id: I0a55f41c3edd7a0bc0562ae4e12a19f262a50d74 Signed-off-by: Joseph Chou <jc2555@att.com>
2017-09-06Add APPC LCM Interfacedaniel1-38/+49
The LCM model code and service provider code is implemented. This model code is now used for the vCPE use case scenario. The vFW use case is still using the legacy APPC API as request by APPC for Policy to use in R1. The APPC service provider now generates a demo legacy APPC request with pg-streams. An A&AI named query is implemented for the vFW use case. The code for obtaining the generic-vnf.vnf-id is not in use until we set up the A&AI simulator to work without having cyclical depenncies inside the POMs. JUnits for the vFW and vCPE use cases are now supported. These JUnits test the complete flow of each scenario. A&AI testing is not supported in the JUnit test yet. These JUnits use a target type of VM as VNF is not supported yet. This will be changed when the Target Lock supports VNF. Amended to fix Sonar blockers. Issue-ID: POLICY-104 Change-Id: I46869c5fd5094919da55ad563d608fe6d4b6fea7 Signed-off-by: Daniel Cruz <dc443y@att.com>
2017-08-28Removal of sys.out/err with logger messagesMagnusen, Drew (dm741q)2-21/+26
Removed any use of System.out.println or System.err.println and replaced with relevant logger statements. Issue-ID: POLICY-176 Change-Id: I91513267635bfb2a34f2a9650c48f367d53fc842 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-08-15Policy-yaml changesTarun Tej Velaga2-4/+4
Changes to Policy-yaml and sdc projects based on changes from policy/engine. Issue-Id: POLICY-88 Change-Id: Ic1a58f00029b9a66db6980fc7732a2ac57390229 Signed-off-by: Tarun Tej Velaga <tt3868@att.com>
2017-07-20[POLICY-76] Remove/rename ATT internal stuffsGao, Chenfei (cg287m)1-7/+7
Change-Id: I3ec4fa22e22e9fccf4b6783b3bc8c92da25e181f Signed-off-by: Gao, Chenfei (cg287m) <cgao@research.att.com>
2017-06-29[POLICY-22] Reorganizing drools-appsGao, Chenfei (cg287m)5-0/+501
Change-Id: I5f9bb3908f8d55c466dd847ae5e01a424e9ba364 Signed-off-by: Gao, Chenfei (cg287m) <chenfei.gao11@gmail.com> Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>