summaryrefslogtreecommitdiffstats
path: root/feature-state-management/src/test
AgeCommit message (Collapse)AuthorFilesLines
2018-09-13Fix checkstyle for features submodules.Pamela Dragosh4-254/+268
These are the remaining submodules that have checkstyle. Pretty clean compile after this. There were a couple of sonar fixes in there also. Issue-ID: POLICY-882 Change-Id: I8191ea1aa261f4a7b9d3d21c108572fd31db1b8c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-01-31Fix sonar issues in feature-state-managementJim Hahn1-0/+1
DroolsPDPIntegrityMonitor.java: Modified init() to throw just IntegrityMonitorException. Modified DroolsPDPIntegrityMonitor init() method to throw specific types of exceptions. StateManagementFeature.java: Sonar complained about needing to merge "if" statements, but chose to eliminate the "if(logger.isDebugEnabled())" instead - did this through-out the source file. Removed extra runtime exception from "throws" declaration. DbAudit.java: Fixed sonar issue regarding setting a static variable from within a non-static method. Removed logger.isDebugEnabled() tests where method calls are not involed. Simplified invoke() method complexity as reported by sonar. DroolsPDPIntegrityMonitor.java: Reduced init() complexity reported by sonar. Change-Id: Ib2722b21bbf3aad130af46c8790f40d8777e36be Issue-ID: POLICY-469 Signed-off-by: Jim Hahn <jrh3@att.com>
2017-12-01Modified state mgmt to fix some sonar issuesJim Hahn1-13/+1
Reordered modifiers. Reordered variables, methods, and constructors. Removed useless parentheses. Removed unneeded "catch" clauses. Extracted nested try blocks into their own method. Replaced a string with a constant. Removed extra thrown exceptions when they are unnecessary (i.e., they're subclasses of RuntimeException, or the method is already declared to throw an Exception). Replaced a large anonymous class with a named, nested class. Separated variable declarations onto individual lines. Changed "String args[]" to "String[] args". Replaced if-then-else by single return statement. Invoked super() inside empty, default constructor. Removed Thread.sleep() calls from junit test per comments on 11/29. Commented out Thread.sleep() in junit tests, as they don't appear to be necessary. If that turns out to be untrue, then CountdownLatch.await() can be used instead. Sonar complained about useless assignments to "phase", but those did not appear to be useless. Did not remove commented-out lines, as they may be needed when debugging. Change-Id: I90ba6f7317a18a10ce1b881cfc6d21a602171ff5 Issue-ID: POLICY-469 Signed-off-by: Jim Hahn <jrh3@att.com>
2017-11-02Modify state-management propertiesv1.1.0Kevin McKiou1-1/+7
Patch 1: Removed hostPort and added server.TEST properties from feature-state-management.properties and modified associated code in IntegrityMonitor and properties in associated JUnit tests. Patch 2: Modified in response to comments from Jorge Hernandez. Including adding contant usage instead of strings and replacing generic exceptions with specific exceptions. Patch 3: Tied property constants to PolicyProperties. Added default property contants. Added error/warning log statemeents when something other than expected value is used. Add logging of all constant values for inspection in debugging. Issue-ID: POLICY-369 Change-Id: Ie2218b68761e0338642a2ed28ef840b1b6ece1a4 Signed-off-by: Kevin McKiou <km097d@att.com>
2017-09-27SonarCube Critical IssueKevin McKiou1-1/+1
Patch 1: Modifying DbAudit to access isJunit variable to, hopefully, satisfy SonarCube on a critical issue. Issue-ID: POLICY-261 Change-Id: Ibc1a2876bdf08377798c503110b05e79a0986c38 Signed-off-by: Kevin McKiou <km097d@att.com>
2017-09-25Merge "Incr State Mgmt Code Coverage"Jorge Hernandez4-24/+104
2017-09-25Incr State Mgmt Code CoverageKevin McKiou4-25/+104
Patch 1: Added JUnit tests to feature-state-management to increase coverage. Estimated coverage is now 48%. Patch 2: Trivial change to force a rebuild. Patch 3: Tweaking the JUnit to try and account for the difference between the LF environment and my local environment. Patch 4: Something caused the policy endpoints JUnits to fail - unrelated to these changes. Made a trival change to force a rebuild. Patch 5: Trivial change to force rebuild. Patch 6: Minor changes in response to Jorge Hernandez comments. Issue-ID; POLICY-266 Change-Id: I7979c200ab18d5861ba20e0d5f23bd0083193daa Signed-off-by: Kevin McKiou <km097d@att.com>
2017-09-18Fix sonar blocker/criticalPamela Dragosh1-3/+2
Also add back .gitignore Sonar blocker for change condition always true. Easier to re-write this using try-with-resources. Use synchronized static method to set a static variable. Don't use e.printStackTrace it causes sonar critical to log exception Log the bytes read. Ideally I would re-write this using Java 8 NIO Issue-ID: POLICY-195 Change-Id: I080d1ad4c8bea91f87c3eca109325700e1589558 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-09-14Addition of State Management FeatureMagnusen, Drew (dm741q)4-0/+405
Patch 1:This commit adds the feature to provide node state management. There are also a couple of very minor cleanup items in feature-session-persistence which came up during review and testing. Patch 2: Cleaned up some logging statements and exceptions per comments by Pam Dragosh. Patch 3: Clean up per comments from Jorge Hernandez. Patch4: Added a default to ignoreErrors in RepositoryAudit. Patch 5: Rebase. Patch 6: Removed api-state-management/.gitignore Issue-ID: POLICY-155 Change-Id: I4fbfa33314d488ff46764931ca965f802b6a26d5 Signed-off-by: Kevin McKiou <km097d@att.com>