aboutsummaryrefslogtreecommitdiffstats
path: root/main/src/test/java/org/onap
AgeCommit message (Collapse)AuthorFilesLines
2019-06-19Update totalPoliciesCount statisticJim Hahn2-2/+12
Modified the code to set the policy count statistic at start-up and whenever the policy list is changed. Also fixed a couple of checkstyle issues in guard. Change-Id: I92017fe64cd5d19c36908347193cc21d183f051e Issue-ID: POLICY-1844 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-26Refactor xacml-pdp to remove various statics3.0.2-ONAPjh73586-364/+355
Refactored xacml-pdp to eliminate a number of static fields. Modified junit tests to allocate new ports for each test. Also modified XacmlPolicyUtilsTest to convert path names to match the file system so that the junit will work in OSs other than linux. Replaced logback.xml with a copy of the one from PAP to resolve some issues. Don't print entire message when discarding, as each PDP receives messages for ALL PDPs. Remove shutdown class from Main - just invoke this.shutdown() directly. Added additional comments to CommonRest. Also modified port test parameters. Change-Id: Id8bf7216cdcb59a1a2cb4cb957fa44f640315cfe Issue-ID: POLICY-1645 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-04-12Add statistics and sonar cleanup and blacklistPamela Dragosh5-37/+132
* Adding in the statistics for decisions and errors. * Cleaned up sonar issues and added code coverage. * Sped up JUnit tests * Fix JUnit issues with not finding application path * Fix TestDecision not finding persistence.xml * Fix for lingering statistics from previous runs. That needs to be addressed at a later time. * Changed persistence to use properties for configuration of database rather than hard coding the persistence.xml * Fix for Josh's comment to use else-if * Changed to use apache Pair * Added blacklist guard policy Issue-ID: POLICY-1440 Change-Id: I56af8c3dcc82463f7381f1eaea7f1440b76200bd Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-10Test decision from main entryPamela Dragosh2-7/+55
Tests a decision upon startup. This also updates the use of ToscaPolicyTypeIdentifier for all the applications. Very basic packaging for applications and their properties. Added cleaning of unused imports to remove sonar issues. Added production persistence.xml file to guard application. Not sure if we need a copy in the application/common resource directory. Issue-ID: POLICY-1440 Change-Id: If96eef5a9e0a7c6cc5461c0bdb6f0cd708cc41bb Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-04-05Xacml PDP Register/Unregister ChangesMichael Mokry5-24/+64
1) Modified activator - Extend and use ServiceManagerContainer - add topicSink and topicSource properties to TopicEndpoint manager 2) Added PAP registration class 3) Added PDP message formatting class 4) Added PDP State Change listener to listen for state change and send back PDP Status.. then start heartbeat if not started already 5) Added Heartbeat publisher code to send heartbeat status on periodic interval 6) UPDATE: Made changes to satisfy Jim's review comments 7) Added code to XacmlPdpApplicationManager to get supportedPolicyTypes 8) UPDATE: more changes to satisfy Jim's latest review comments 9) Fixed the failed Junits causing build failure 10) Made change to use NetworkUtil for getting PdpStatus name value per Jorge's comment Still need to in separate review: 1) Write Junits for new code Registration and heartbeat flow as I understand it: 1) PDP starts and sends initial status to PAP with PASSIVE state 2) PDP listens for State Change from the PAP 3) PDP sends updated Active state to the AP 4) PDP begins sending periodic heartbeat status to the PAP Change-Id: Iafa06ae3f1ee195c7da3710a12d9c095c5413ec2 Issue-ID: POLICY-1449 Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-04-04Tie XACML REST DecisionPamela Dragosh5-16/+235
Ties the decision API to the applications. Adds a static application manager class to manager the applications. Added applicationPath as a parameter to be supported in the Json parameter group. Issue-ID: POLICY-1440 Change-Id: I43cb44b3e308aadcf258fd987f3b53944c2edb72 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-03-18Started with test decision JSON objects.Pamela Dragosh1-1/+1
Added new Policy Finder Factory that ONAP will use and got the code working with new policy/models (see other review which will have to be merged first). Added some new conversion methods to convert from a Xacml request to an Onap request. Added some property methods for XACML Properties objects and JUnit tests. Started filling in some Guard application details and combining code. Issue-ID: POLICY-1602 Change-Id: I5235b74f3b036dcf05779b655a03ac290d594354 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-03-15Monitoring policy creation foundationPamela Dragosh4-1/+32
Upgrde to xacml v2.0.0 release artifact. Some re-arrangement of classes. New class to support a common dictionary among the monitoring applications. I may move it to a common under the main since some of the values are shareable. Created application service provider, so the XACML main knows what policy types are pre-loaded and can report them back to the PAP. struggled with cucumber, which does not create TemporaryFolder although the documentation says its supported. Added a new Policy Finder specific to ONAP which does quicker job to load policies. Issue-ID: POLICY-1273 Change-Id: I4af15a64da3b42d48f29809710421b1649625adc Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-03-11Added HTTPS and CADI/AAF Support for PDP-XMichael Mokry3-40/+182
- Yay I found the mysterious https issue that caused the junit to fail. Please don't laugh, it was a typo :) - Made changes per review comments 1) Added builder class for RestServer constructor 2) removed some try/catch blocks in junit 3) Other minor changes - More changes per review comments - Added changes per Ram's review comments (not lombrok yet) - Made changes for ONAP API CVS guidelines Change-Id: Ie1a6225459b3ce235cd73828ccddec04c690f5fd Issue-ID: POLICY-1436 Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-02-26Stubbed endpoints for Decision API and swaggerMichael Mokry3-3/+6
Includes: 1) Decision API endpoint with Swagger annotations 2) Provider class for Decision added to new provider package 3) Moved other provider classes to provider package 4) Decision model class added to new model package Note: This is just a draft and still needs a lot of work, please do not merge. Thanks in advance for the review comments. Issue-ID: POLICY-1516 Change-Id: Id7414b6cb3eee1b877a0c11521babbef4938a68f Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-02-13Package and Create Docker Image for Xacml PDPMichael Mokry3-52/+72
- Creates docker image of policy xacml-pdp - Creates zip package of policy xacml-pdp - Also committed changes from Healthcheck/Statitics review that were allowed to be deferred Change-Id: Ia5fb72be05a30a341692453fe4ff32c7b112e861 Issue-ID: POLICY-1436 Signed-off-by: Michael Mokry <michael.mokry@att.com>
2019-02-11PDPX Healthcheck/Statistic RESTful API entry pointMichael Mokry8-0/+755
Includes: - Basic code structure modeled after policy distribution - Code implementation to support Healthcheck/Statistics RESTful API entry point - JUnits - Fixed Checkstyles issues and added some missing statistics classes and Junits - Made changes per Jim's comments - Made more changes per Jim's comments > made gson field static > using AssertThatThrownBy() mechanic from AssertJ > added setup and teardown to correctly terminate activator in Junit - Made corrections to the statitics endpoint and junits Change-Id: Iad40272beceff8a0f99966440e96a84fc2043b12 Issue-ID: POLICY-1436 Signed-off-by: Michael Mokry <michael.mokry@att.com>