aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/test/java/org/onap/policy/common/utils/resources
AgeCommit message (Collapse)AuthorFilesLines
2020-01-13Add method to return resource directory contentsliamfallon1-7/+42
In order to avoid hard coding the policy types and policies that are in the example directories into unit test cases, and in order to automatically pick up added and removed policy types and policies, it would be good to read the contents of resource directories at run time in unit tests. This change brings in that functionality into ResourceUtils. Issue-ID: POLICY-2315 Change-Id: I601718828aad0f065dbbaa1f5af8d0a0f133f44d Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-06-12Apply simple sonar fixesJim Hahn1-40/+42
Note: A number of these were identified, by SonarLint, in the Test classes, which are not typically scanned by Sonar. Removed unnecessary imports. Removed unneeded "throws Xxx". Replaced lambda with method references. Replaced duplicate strings with constants. Replaced try-fail-catch with assert-j methods to eliminate sonar complaints about duplicate failure messages. Added missing @Override annotations. Use map.computeIfAbsent() where appropriate. Also fixed some minor checkstyle issues. Removed unneeded "volatile" declarations. Replaced some if-else constructs with "?:" construct, per sonar. Replaced Object.wait() with CountDownLatch.await(); according to sonar (and javadocs), Object.wait() can return due to "spurious wakeups". Fixed issue whereby CryptoUtilsTest wouldn't run in my Eclipse. Change-Id: Ib6b71ed65662cfd6209400dac57ed69279bf29ec Issue-ID: POLICY-1791 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-03-18Merge "Add Network Logging Feature"Liam Fallon1-1/+3
2019-03-14Add support for TOSCA JSON Parsingliamfallon1-0/+53
Added a getter to allow the Gson object to be retrieved from a GSON message body handler, useful for testing. Moved the TextFileUtils utility class from APEX utilites to policy common utils Issue-ID: POLICY-1195 Change-Id: I7c8074e8177a90b292c6dfd6e7f0d352063818e7 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-03-13Add Network Logging FeatureDaniel Cruz1-1/+3
This is part 1 of introducing the mdc filter feature. Network logging has to have interception points in order to pre/post process messages coming in from a network endpoint. The OrderedService interface and OrderedServiceImpl of the drools-pdp project have now been migrated to common but is also left in drools-pdp to mitigate disruption to existing features. However for features that need to use common's OrderedServiceImpl and drools-pdp version of OrderedServiceImpl there will be a conflict with getSequenceNumber(). So a migration of the other features is suggested. Network logging is moved to its own util class so that feature hooks can be invoked any time an event is being logged by a network logger. This util class will also be accessible to drools-applications in the case where drools-applications would like to invoke network logging features for REST events. Change-Id: I83d7c46e5abb351486f841c3be4d9009f7992476 Issue-ID: POLICY-1499 Signed-off-by: Daniel Cruz <dc443y@att.com>
2019-03-11Add ServiceManager classJim Hahn1-8/+8
Added ServiceManager class to start a list of services, in order, and stop them in reverse order. Also addressed minor checkstyle issue in TopicSinkClient. Enabled logging from tests. Updated some comments. Updated license date. Added state checks and support for multi-threading. Change-Id: Ie7f053d9884766fe199895691a57eb5a51b1d155 Issue-ID: POLICY-1542 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-07-31Add resource handling utility classliamfallon1-0/+307
Add ResourceUtils, a class that provides utility methods for dealing with Java resources on the classpath. Change-Id: Ie4df249315ad145aabdfb35bb827ffbf6d79e095 Issue-ID: POLICY-922 Signed-off-by: liamfallon <liam.fallon@ericsson.com>