aboutsummaryrefslogtreecommitdiffstats
path: root/utils/src/test/java/org/onap/policy/common/utils/resources/ResourceUtilsTest.java
AgeCommit message (Collapse)AuthorFilesLines
2024-04-10Dependency management updateadheli.tavares1-4/+5
- including dependencies to pom.xml files only where they are used, avoiding extra dependencies being added in all packages. - removal of unused UEB topic. Issue-ID: POLICY-4945 Change-Id: Ifc0212af2bc938e357e1addebcec591f9d6cfc14 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2023-09-21Java 17 Upgradeadheli.tavares1-7/+7
Issue-ID: POLICY-4668 Change-Id: If4e79224de61d66d7514f3abbd7b8bee1c3d5681 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2022-04-22Fix unit test failing due to GSON upgradeliamfallon1-2/+3
The result returned by the new GSON version has a forward slash at the end. Issue-ID: POLICY-4070 Change-Id: I218be9a3d21a78071323ae2127efa74353022800 Signed-off-by: liamfallon <liam.fallon@est.tech>
2022-01-17Fix test case broken by new GSON versionliamfallon1-1/+1
The "com/google" resource bundle now contains more than 189 files, so this test is changed to insetead check for the existence of "com/google/gson", otherwise this test could break every time we update gson. Issue-ID: POLICY-3849 Change-Id: Id979bb7a3d2453956701f64057accb08228a774d Signed-off-by: liamfallon <liam.fallon@est.tech>
2021-09-02Create methods for creating temp filesJim Hahn1-40/+20
Created utility methods to create temp files and set default permissions. These can be used in other repos to satisfy sonar. Also added code to close streams and clean up temp files created by some junit tests. Modified to use IOUtils to read a stream. Issue-ID: POLICY-3289 Change-Id: Ic83e4f4d7745be7b37ebb42bf1d81e303d8dadc9 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-04-13Add command line handleradheli.tavares1-2/+2
Added a Handler for command line classes to share common strucutures. Issue-ID: POLICY-3128 Change-Id: I662911c467faf5c39b8db018bb1a564fba7587a6 Signed-off-by: adheli.tavares <adheli.tavares@est.tech>
2020-06-17Cleanup various sonar issues in policy-commonJim Hahn1-3/+2
Addressed the following issues: - unused imports - unused method parameters - use assertEquals, assertSame instead of assertTrue - provide the parametrized type for this generic Also fixed some checkstyle issues: - removed blank lines between "import" groups Issue-ID: POLICY-2650 Change-Id: I004bb650ac10c49ccd0fc405f6959896fec39f9b Signed-off-by: Jim Hahn <jrh3@att.com>
2020-02-24Fixes to support dependency upgradePamela Dragosh1-3/+3
Uped the time for Thread.sleep due to new http core dependency. It seems to randomly timeout inconsistently due to that upgrade. Google gson seems to have changed its layout. Did not see any problems with the other repos. Issue-ID: POLICY-2381 Change-Id: Id2a9bfffd42a2c713af042bd2a8cc4abafba2d9f Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-01-31Fix ResourceUtilsTest junitJim Hahn1-6/+16
The junit for ResourceUtilsTest fails when run on a non-linux box due to the different path separator. Modified the test to normalize path names before making comparisons. Issue-ID: POLICY-1625 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I58db71155d30b379e20e7c46bedfc6d79e26b6cb
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-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>