summaryrefslogtreecommitdiffstats
path: root/controlloop/common/simulators/src/test
AgeCommit message (Collapse)AuthorFilesLines
2019-01-14Remove model-imp/rest checkstyle suppressionsJim Hahn4-19/+19
Renamed "RESTManager" class to "RestManager". This did not require any changes to rules. Updated license data in pom. Change-Id: Ide59b99b8c5d939804b7540c71a686404195173c Issue-ID: POLICY-1141 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-11Remove model-impl/so checkstyle suppressionsJim Hahn1-24/+24
Renamed classes from "SOxxx" to "SoXxx". Also renamed a few method names to make them camelcase, too. Updated drl files with above changes. Change-Id: I06aa303a20911733f870947c55e01f3a2dc66fa3 Issue-ID: POLICY-1143 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-10Remove model-impl/vfc checkstyle suppressionsJim Hahn1-4/+4
Entails renaming VFCxxx classes and updated drl files, as well. Change-Id: Ib31c61a35536df22772de6090761b22beb1b561b Issue-ID: POLICY-1145 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-10-31Add /serviceInstances/ to SO URL for scale-outJim Hahn1-1/+2
Also reformatted line that was subsequently too long. Change-Id: I5c634c5157f18de64d37a0f451cd65f3002f35d3 Issue-ID: POLICY-1238 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-31Added support for VF Module Delete recipePiyush Garg3-10/+10
Enhanced SOActorServiceProvider to support VF Module Delete Recipe. Added SOOperationType enum to map the policy recipe with the SO API that we want to call for a recipe. vf module id from non-base vf module is used to construct the delete request url and same will be deleted. Updated SOManager so that it sends request to SO based on the SOOperationType enum value. Enhanced RESTManager to add support for the http delete using new class HttpDeleteWithBody (to allow pass the payload to the SO delete VF module API). Change-Id: I15b678ed9ebc85dfa7cb62bbf23e41c0fe6e4c69 Issue-ID: POLICY-1079 Signed-off-by: Piyush Garg <piyush.garg1@amdocs.com>
2018-08-29Fix remaining checkstylePamela Dragosh1-0/+1
Lots of formatting, missing javadoc, distance from use, imports must be explicit, ordering of methods. Fixed some abbreviation problems in classes and renamed JUnit tests to fix this. Issue-ID: POLICY-883 Change-Id: I8494f63d88d63c0232aca97f7bcc848816228fb1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-08-28use new SO API for scale-outJim Hahn1-11/+9
Updated licenses and serialization IDs. Moved hashCode() and equals() methods to be in same location as in the original code so it can be more easily compared. Changed vDNS yaml timeout and retry to 1200 and 0, respectively, to match the original values. Removed extra newline from yaml, to match original yaml. Reformatted source to wrap lines at 120 characters and removing trailing white space. Change-Id: I3f5e59a1f44750347de49164f587d4ffefdee8b4 Issue-ID: POLICY-962 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-24use new vf-walk code in SO requestJim Hahn1-0/+23
Methods were added to AaiNqResponseWrapper to extract VF modules and generate the new VF module name. This step modifies the SO code to use those methods. It was also determined that the SO code needs the VF module container object, not just the VF module, itself. As a result, AaiNqResponseWrapper was modified to return a list of the containers instead of a list of the VF modules. Also modified the AAI simulator to return two VF modules in the response to the vserver named query. As part of that, a method was added to the simulator so that JSON responses can be read from files rather than having to convert them to Java Strings. Modified simulator to work even if vnf-id is null. Change-Id: I68fdf07ea80ee0daf9e16403e35b11710315a8a8 Issue-ID: POLICY-1037 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-07-30Copy policy-endpoints from drools-pdp to commonmmis4-4/+4
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-03-26Fix path to logging classliamfallon4-4/+4
The package path of LoggerUtil changed as below: From: import org.onap.policy.drools.utils.LoggerUtil; To: import org.onap.policy.drools.utils.logging.LoggerUtil; Change-Id: I8187d97de5eeab92268baab155fb4de37f4df3ad Issue-ID: POLICY-448 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-03-26Removed checkstyle warningsmmis1-17/+17
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 warningsmmis4-228/+236
Removed checkstyle warnings in: policy/controlloop/common/guard policy/controlloop/common/msb policy/controlloop/simulators including renaming of the following classes: MSBServiceFactory -> MsbServiceFactory MSBServiceManager -> MsbServiceManager MSBServiceException -> MsbServiceException Issue-ID: POLICY-705 Change-Id: I11d62a74fcb77e764121df119cb0bd9b844b485b Signed-off-by: mmis <michael.morris@ericsson.com>
2018-01-18Fix Technical Debt, add Unit tests for SOvdmeer1-43/+43
Converted to POJOs, fixed sona lint errors, added JUnit tests POJOs now have only private members and getters/setters This implicated actors, simulators, and existing tests Issue-ID: POLICY-455 Change-Id: I4b80f729565e8675822a890892b15676908f73b4 Signed-off-by: vdmeer.sven <sven.van.der.meer@ericsson.com>
2017-12-14Cleanup of A&AI message model module.Liam Fallon4-17/+18
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-11Merge "Technical Debt in AAI."Pamela Dragosh1-4/+4
2017-12-07Remove guard dependency from simulatorsCharles Cole1-17/+22
Removed the deendency on guard from the guard simulator tests so that the guard simulator can be used to test guard functionality. Issue-ID: POLICY-490 Change-Id: Ie67abb85e9844c412c483b1bbf3fb4aa21f3530a Signed-off-by: Charles Cole <cc847m@att.com>
2017-12-06Technical Debt in AAI.Liam Fallon1-4/+4
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-11-09Fix SO Request structureHockla, Ali (ah999m)1-0/+1
Issue-ID: POLICY-438 Change-Id: I05e634782004fff5540b3e6fabb9e22846438cb1 Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-11-08Fix SO Request bodyHockla, Ali (ah999m)1-3/+3
- Renamed modelNameVersionId to modelVersionId in SOModelInfo - Removed requestID from SO Request body - As a result of this, an SOResponseWrapper was needed in order to attach the control loop event requestId to use in the SOResponse rule in drl (the requestID that is returned in the SO response is a newly generated requestId with no relation to the Policy control loop event requestId as per Arthur) - Updated drl to reflect the above mentioned change - Updated simulator and junits to reflect changes - Added an additional null httpResponse check/logger statement in SOManager and RestManager Issue-ID: POLICY-438 Change-Id: I5f414ba69b60b5565cca9073b47f4c4835e5abbf Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-11-08Fix SO url to remove suffix HTTPS/1.1Hockla, Ali (ah999m)1-1/+1
Issue-ID: POLICY-437 Change-Id: I19679d9782f78ff73e3a90d0c8c95b2b6e9d319f Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-10-30Update SO url from v2 to v5Hockla, Ali (ah999m)1-1/+1
Issue-ID: POLICY-401 Change-Id: Id1be63d2f61bc0d9d8f15df7573af2c7307c1c31 Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-09-28Add missing auth headers to guard requestTemoc Rodriguez1-2/+14
Added guard authentication, client authentication, and environment http headers to the pdp-x guard restful request. Properties are set to PolicyEngine.manager. Property getter, setter, and properties in guard/.../Util.java. Test properties defined in junits themselves. Added code from GuardContext.java to grab the properties and make restful request. PolicyGuardXacmlHelper now closely resembles GuardContext in order to mimic functionality. Guard url no longer is passed into CallGuardTask, it is now a property. Issue-ID: POLICY-260 Change-Id: I5b144764828b6da0e7b738a578e4f6596a0f4f36 Signed-off-by: Temoc Rodriguez <cr056n@att.com>
2017-09-21Add guard simulator and multiple AAI responsesCharles Cole1-0/+58
Added a guard simulator that can permit or deny (it sends a deny if the clname is denyGuard). Added responses to the AAI simulator to set the is-closed-loop-disabled to true (use a get query with a key of disableClosedLoop). Changed the content-type of all responses to application/json. Issue-ID: POLICY-256 Change-Id: If84813968d3ea59d9ebe029caa69f444a1f413c8 Signed-off-by: Charles Cole <cc847m@att.com>
2017-09-21pdp-d feature to simulate aai/mso/vfc in labJorge Hernandez3-183/+213
implemented as an optional loadable feature, this capability enables to bring up simulators used by junits in a pdp-d lab configuration. After lab installation, perform: 1. features enable controlloop-util 2. policy start Now the simulators are opened at ports 6666, 6667, and 6668. netstat output: tcp6 0 0 127.0.0.1:6666 :::* LISTEN 21562/java tcp6 0 0 127.0.0.1:6667 :::* LISTEN 21562/java tcp6 0 0 127.0.0.1:6668 :::* LISTEN 21562/java 21562 is the pdp-d PID in the lab. curl http://localhost:6666/aai/v11/network/generic-vnfs/generic-vnf/vnfIdA { "vnf-id": "5e49ca06-2972-4532-9ed4-6d071588d792", ... } Change-Id: I3f05333ce5549b2274eb967b2b8866189b7f8843 Issue-ID: POLICY-259 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-09-18Fixing VFC simulator for junit testsRitu Sood1-1/+3
Added response type to post and removed response id as it is unused. Breaking up from the junit patch for ease of review. Issue-id: POLICY-212 Change-Id: I0c6b0c02b240cfe81246587184fe6a589dcc2367 Signed-off-by: Ritu Sood <ritu.sood@intel.com>
2017-09-15Fix sonar criticalPamela Dragosh1-2/+1
Last transient/serializable issues. Throw a dedicated exception for DateUtil class Unused imports Make the enclosing method "static" or remove this set. Issue-ID: POLICY-115 Change-Id: I366f85922c4d4d290b320e0b88678c805de59872 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-09-15Fix sonar criticalsPamela Dragosh1-4/+4
Either re-interrupt this method or rethrow Exception Transient/Serializable issues Unused imports logging exceptions Issue-ID: POLICY-115 Change-Id: I4c8a0c780e2f6c6e8218c1457f18470f7d95919c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-09-15Modify AAI simulator to support new requestsCharles Cole3-8/+49
Updated the AAI simulator to support new AAI queries. Also, modified the post response to allow multiple responses. Added code to ensure the simulators were able to sucessfully start up. Change-Id: I3e855b5e54c073f55fbaadc0064c140695fc1a58 Issue-ID: POLICY-200 Signed-off-by: Charles Cole <cc847m@att.com>
2017-09-14Added changes for vDNS Use CaseHockla, Ali (ah999m)2-59/+133
-Renamed remaining MSO classes and packages to SO and modified drl accordingly -Connected SO Interface to SO Simulator -Added vDNS Control Loop junit -Modified SOActorServiceProvider to reflect AAI class changes (POLICY-103) Issue-ID: POLICY-102 Change-Id: Iea5d3f096c4ccfedde68e79d7593d66331127aaf Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-09-12Fixing VFC Model response classRitu Sood1-2/+0
Fixed the response class for VFC response and also removed the Ignore test case. Change-Id: I4373e86399089b7a3d743be4d19f76cc37d1ceea Issue-id: POLICY-57 Signed-off-by: Ritu Sood <ritu.sood@intel.com>
2017-09-11Move the simulators to a new packageCharles Cole3-0/+195
Moved the simulators to the simulators project in controlloop/common. They can now be accessed with the Util class in the simulators project or the Util class in template.demo, for backwards compatability. Also renamed AaiSimulator to AaiSimulatorJaxRs Issue-IS: POLICY-200 Change-Id: Id131af0243777db31a8f22e110d8a708dc033dcf Signed-off-by: Charles Cole <cc847m@att.com>