aboutsummaryrefslogtreecommitdiffstats
path: root/integrity-monitor/src/test/java/org/onap/policy/common/im/StateTransitionTest.java
AgeCommit message (Collapse)AuthorFilesLines
2020-09-28New sonars in policy-commonJim Hahn1-1602/+3008
Addressed the following sonars: - too many assertions in a test case - use parameterized test method Disabled production sonars for util-test, as the entire module is only used for testing other modules. Issue-ID: POLICY-2650-sonar Change-Id: If49775a6c95855dcd9601ee0d833bb00741b1550 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-07-15Combine lines in IM state transition tableJim Hahn1-2/+2
Rewrote the code to generate the Integrity Monitor state transition table, eliminating duplicate lines. Output the table, before and after the change, and verified that they were identical, with one exception: there were two places where the original code had "StandbyStateException", while all of the others had "StandbyStatusException". Guessing that the original code was incorrect in these two cases, I changed the new code to always use "StandbyStatusException" instead. Change-Id: Ibe3044eb1ac398a0bc8f328f4e14305d4bdeb380 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-21Fix sonar issues in integrity monitorJim Hahn1-1645/+1633
Used Eclipse Refactor->Extract Method to reduce cyclomatic complexity. Flattened nested FpManager class into IntegrityMonitor class. Changed some strings to StringBuilder, where lots of concatenation was being done. Simplified some things by eliminating some try/catch blocks where an exception can't actually (except may an out-of-memory exception). Also addressed some sonar issues in the tests (e.g., use "<>" where appropriate). Eliminated some assertException methods, replacing them with assertj methods. Did not attempt to increase junit coverage. Change-Id: I311acaffcd87f0cbbf382c06c7fa26177007abd5 Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-03-20Removed checkstyle warningsmmis1-1665/+1676
Removed checkstyle warnings in policy/common/im Issue-ID: POLICY-695 Change-Id: I32b4797249386c0d1bd0f50792880a1759503a67 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-02-13Add test coverage to integrity-monitorJim Hahn1-0/+2160
Removed "test" from package name. Refactored tests, creating common IntegrityMonitorTestBase. Turned log/print statements into assertEquals in StateTransitionTest. Turned log/print statements into assertEquals in StateManagementTest. Modified AllSeemsWellTest to use IntegrityMonitorTestBase. Modified IntegrityMonitorTest to use IntegrityMonitorTestBase. Added several hooks to IntegrityMonitor to control timers at a finer granularity. Added hooks to IntegrityMonitor to control the FPManager thread. Remove hooks for refresh timer, as property suffices. Added assertException() and assertNoException() methods to IntegrityMonitorTestBase, and then replaced most "try/catch" blocks with calls to those methods. Updated StateManagement to close EntityManagers. Modify pom to remove scope from utils dependency. Fix some comments and remove an unneeded EntityTransaction variable. Change-Id: Ic0789d26f985a40a35f618343fa4e88aa473b2b3 Issue-ID: POLICY-582 Signed-off-by: Jim Hahn <jrh3@att.com>