summaryrefslogtreecommitdiffstats
path: root/utils-test
AgeCommit message (Collapse)AuthorFilesLines
2020-04-06Address sonar issues in commonJim Hahn6-25/+13
Addressed the following sonar issues: - missing assertion in junit test case - disable sonars about setAccessible() as it's required for jackson emulation - sleep in junit - don't use wild-cards (e.g., "*") with java.util Pattern - use re2j instead of java.util Pattern - use String methods (e.g., startsWith()) - duplicate method bodies - duplicate code in Coder classes - string concatenation in logger calls - UTF-8 encoding - return primitive instead of boxed primitive - add assertion to tests - renamed support methods from doTestXxx to verifyXxx - cognitive complexity - use AtomicRef instead of volatile - use specific Functionals (e.g., IntConsumer) - function always returns the same value - serializable vs transient Issue-ID: POLICY-2305 Change-Id: I08eb7aa495a80bdc1d26827ba17a7946c83b9828 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-03-27More sonar issues cleanupPamela Dragosh3-8/+7
Either log or rethrow Use boolean expression Add at least one test Remove commented out code Issue-ID: POLICY-2204 Change-Id: I4fdf31aea75303e4f49d25198eb3b12341995bfe Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-24Sonar and eclipse warnings commonPamela Dragosh2-8/+5
Unused imports Not enough arguments Issue-ID: POLICY-2204 Change-Id: I6405cb697ea976096b1276e2291b1c73617d33b5 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-20Bump common to 1.6.3-SNAPSHOTPamela Dragosh1-1/+1
Released 1.6.2 Issue-ID: POLICY-2378 Change-Id: I12c93a88af2b00c25d457ff9aa9e50c1845e004c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-03-03Use policy/parent awaitilityPamela Dragosh1-1/+0
Consolidate to what is in policy/parent - this upgrades the version. Issue-ID: POLICY-2381 Change-Id: Ibf18fb131c7fc694215a5d34d734392e722f5970 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2020-02-17Add PseudoExecutor to utils-testJim Hahn2-0/+130
Moved MyExec from actors package to policy-common/utils-test, renaming it to PseudoExecutor. Updated per review comment(s): - declare "task" of type "Queue" instead of "LinkedList" Issue-ID: POLICY-2363 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I40049ca52defecc4f3f7479470c28da58521866d
2020-01-20Replace deprecated Nashorn javascript engineJim Hahn3-15/+21
Some test drivers use javascript to evaluate expected results. In java 8, the standard javascript engine was Nashorn, but that has been deprecated. As the test scripts use a simple xxx.yyy.zzz notation, decided to go with a small expression language, Apache JEXL, instead. Issue-ID: POLICY-2324 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: Iffff468a880c612bdb31da84964dfa4132fa15e3
2020-01-10Address items deprecated by move to java 11Jim Hahn1-2/+4
Addressed the following deprecated items: - "new Integer(xxx)" - Observable/Observer - Mockito.anyObject() Added assertion to a junit test to address a sonar issue. Did not address deprecated Nashorn javascript interpreter; that will be done in a separate review. Updated licenses. Issue-ID: POLICY-1406 Signed-off-by: Jim Hahn <jrh3@att.com> Change-Id: I81fd158f831e01d5410d79898ced658285787d47
2020-01-09policy/common jdk11 upgradesHOCKLA1-3/+3
Issue-ID: POLICY-1583 Change-Id: I6bcd320a6cdedd84dad9b54fdb4fec0cb8443b44 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-06Bumped policy/common patch version to 1.6.2-SNAPSHOTHOCKLA1-1/+1
Issue-ID: POLICY-1583 Change-Id: I4a1c5848f158d10b4b6f21f048f92d69ccc90a83 Signed-off-by: HOCKLA <ah999m@att.com>
2019-12-05Changed project version to 1.6.1-SNAPSHOT to isolate for java 11 upgradesHOCKLA1-1/+1
Issue-ID: POLICY-1583 Change-Id: I805ebed75e7e0cb5109946328958341018421aad Signed-off-by: HOCKLA <ah999m@att.com>
2019-09-16Eliminate constructors with side-effectsJim Hahn1-1/+1
Several of the Gson and Jackson handlers take a GsonBuilder, which they then configure with additional adapters prior to create a Gson object that they subsequently use. The code has been modified so that the constructors no longer take a GsonBuilder, thus eliminating the side-effects that they had on the builders. Instead, a configBuilder() method has been added to the handler classes that makes it clear tht they modify the GsonBuilder. This also has the advantage that classes that want a Gson object configured per a given handler need only call that handler's configBuilder() method; previously, they had to constructor the handler and then retrieve its gson object. Also updated a few tests to specify the HTTP "Accept" header to ensure that return results are in yaml format. Change-Id: I2ef98198041ff9f73913d01ee6ee14ecf20ba617 Issue-ID: POLICY-2081 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-09-06Bump version in policy/common masterJim Hahn1-1/+1
Change-Id: If86cac60ee143b1d8ae92fd3893ea33a0d3e1b81 Issue-ID: POLICY-2045 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-21Enhance TestTimeMultiJim Hahn19-185/+2405
Enhance TestTimeMulti to support execution of tasks, whether submitted via Timers or via Executors. Change-Id: Ib5f216730b3b69028e9581052645370b827cd446 Issue-ID: POLICY-1968 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-08-02Bump version in policy/commonJim Hahn1-1/+1
Change-Id: I7efbdf7c36907eb10ae5ce4c9d7d4988d7e2d68a Issue-ID: POLICY-1965 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-06-25Moving ToStringTester to utils-test moduleramverma2-0/+72
Moving ToStringTester to utils-test as thos module holds all test related utilities. Keeping the original one for now as it will break build for all the repos. Will delete the original one after pointing all the dependent repos to the new one. Change-Id: I5f90b722452178e1e1a30d759679b8738dadfb65 Issue-ID: POLICY-1746 Signed-off-by: ramverma <ram.krishna.verma@est.tech>
2019-06-21Bump common to 1.5.1 SNAPSHOTPamela Dragosh1-1/+1
Released 1.5.0 Issue-ID: POLICY-1737 Change-Id: I51b1c264d52cab2b2501dce7c5b0e7805d39ad5c Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-06-12Apply simple sonar fixesJim Hahn6-71/+72
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-05-28Change version to 1.5.0Pamela Dragosh1-1/+1
Upgrade minor review for El Alto. Update to policy/parent Issue-ID: POLICY-1747 Change-Id: I5c54479d7b1e1951e52580c40127177e5f6d389d Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-05-01Bump common snapshotPamela Dragosh1-1/+1
In prep for next version. Issue-ID: POLICY-1700 Change-Id: I4dec2414dbd3d0d941bf24e9cd359265d7105371 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2019-02-28Get proper message in test logger appenderJim Hahn2-9/+18
The logger appender that's used in junit tests was getting the raw message, which still had "{}" place-holders in it. Fixed that. Split a test method to avoid checkstyle error. Change-Id: I57571d8717aaee4adb7df186fe156501e9cc669e Issue-ID: POLICY-1444 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-15Fix sonar issues with gson codeJim Hahn2-12/+28
Fixed issues with GsonTestUtils: - don't set static from within a non-static method - don't throw generic RuntimeException Resolved checkstyle issue. Removed trailing spaces. Change-Id: If0c85733f62a24b56088dc90aadd4b95b3a6c91a Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-14Sonar fixesJim Hahn4-15/+50
Added test for Serializer to increase junit coverage. Added tests for TestTimeMulti to increase junit coverage. Sonar fixes for PropertyConfiguration: - use equalsIgnoreCase - use the exception Updated license dates. Some fixes for LoggerFactoryWrapper to address sonar issue - utility classes should typically have a private constructor. Change-Id: I8957e9673fe8371ecca7abbb7ece87b0d6f46c1a Issue-ID: POLICY-1519 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-13Add gson handler and testsJim Hahn8-1/+809
Added JacksonHandler which provides jackson behavior in gson. Also added classes to facilitate testing of gson serializations. Added compareGson(xxx, Class). Removed trailing spaces from some files. Updated license dates. Replaced incorrect constant with ${xxx} in json test file. Fixed typo in test method name. Change-Id: If05b654d76a4ffc88646f03334be82b32506f28f Issue-ID: POLICY-1428 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-02-08Replace PolicyAssert with assertjJim Hahn2-149/+0
Removed PolicyAssert from utils-test, as its functionality is superseded by assertj. Change-Id: Ie7620fea98cd368a8ce4f8511e8e88f291013cff Issue-ID: POLICY-1392 Signed-off-by: Jim Hahn <jrh3@att.com>
2019-01-08Replace expectException with AssertJJim Hahn2-32/+17
Change-Id: I73c186f181960ac7ac8cd985e55db1831963910f Issue-ID: POLICY-1392 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-10-31Set new master version for Dublinliamfallon1-4/+3
Issue-ID: POLICY-1232 Change-Id: Icb6179ace3f320bdda3da2160afd2d058762ae5e Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-10-24Fix refering to snapshot in policy/common1.3.1ramverma1-1/+1
Issue-ID: POLICY-1213 Change-Id: Id34f28a3f41687993009128940e9ddec69d5b88f Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
2018-10-03Support Throwables in expectException()Jim Hahn2-18/+39
Also fixed some bugs in the junit tests. Renamed expectException() to assertThrows(). Added test cases. Change-Id: I13dff0007e35c2d2521a4ca40bb65e6820416ed1 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-10-02Add expectException to policy-commonJim Hahn2-0/+128
Also fixed new checkstyle error. Change-Id: I2d2c2518f3f7da1a0ace8c32e10b4151d941bb6f Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-26Use powermock version from parent pomJim Hahn1-1/+0
Change-Id: I84fd562e7050508a75b4192ba162a09acd938986 Issue-ID: POLICY-1148 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-21Fix policy/common checkstyle issuesPamela Dragosh1-0/+7
The root pom.xml had a syntax error in a declaration. The suppressions xml was not being found by the sub-modules. It was better to create a copy in each of the sub-modules where we will not be fixing abbreviations or the interface declarations in own java file. Added specific checkstyle files for each submodule. One interesting note for the InheritDoc tag. It seems that the mvn compile has a bug that interprets these as missing a period after the tag. Even though the parent interface has it correctly. It was easier to just remove it than duplicate. There are new JIRA's for that work to be done in Dublin. Fixed some spacing in pom's. Issue-ID: POLICY-1131 Change-Id: I5f845958ccefd50a3b7290662da43c994870f1f7 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-09-21new sonar issues in policy/commonJim Hahn2-29/+56
Only throw one type of exception in Serializer. Try to increase test coverage in Serializer. Change-Id: I170de0ab727041aa42731c08d6cc454731d29a20 Issue-ID: POLICY-1130 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-14add more junit coverage to new Serializer classJim Hahn3-78/+410
Removed calls to superclass methods so that appropriate exceptions are thrown. Better comments for new tests. Removed @Ignore from tests. Removed tabs from pom. Change-Id: I97fa63951eed4c2ac5ce0a267d8da5134a2a1c71 Issue-ID: POLICY-1106 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-09-13add utility class to test serializable classesJim Hahn2-0/+184
Closed the ByteArrayXxxStreams. Closed byte output stream, even if exception in object stream. Change-Id: I3f779a5c0e6df3ac3496abe60a46e0696b4e261c Issue-ID: POLICY-1106 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-08-13Fix checkstyle in utilsPamela Dragosh10-909/+920
Cleared all the checkstyle in these 2 submodules. Issue-ID: POLICY-881 Change-Id: I248e1894aebf549d5a4f8669a6466ec227d40b55 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-08-10get time from correct timer objectJim Hahn1-1/+1
Change-Id: Ie060e45d2cda368ffbb5908b41594d7795bae40b Issue-ID: POLICY-1045 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-07-10fixed Checkstyle warningsvamshi.nemalikonda2-138/+201
Issue-ID: POLICY-881 Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com> Change-Id: I4057306bec83a48921c90a081fb9752f663ee3b6
2018-07-03fixed Checkstyle warningsvamshi.nemalikonda1-31/+32
Issue-ID: POLICY-881 Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com> Change-Id: Idc0c088497b4a49789c3f0aedf034d380bd3af1c
2018-06-19Add CurrentTime utilitiesJim Hahn5-0/+446
Add some comments. Update license text. Change-Id: I4cee208378c44d9730274aee337feb95f9026add Issue-ID: POLICY-908 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-06-07Removing checkstyle warnings from ErrorsTestervamshi.nemalikonda1-15/+17
Change-Id: Ifc70d9682317033fd98b43ba802f9fd1acf519a8 Issue-ID: POLICY-881 Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com>
2018-06-07Fixed most of the Checkstyle warnings.vamshi.nemalikonda1-14/+14
Change-Id: I80b05663e81648058f84aff5d5cda2deaa2d87c9 Issue-ID: POLICY-881 Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com>
2018-06-05Update policy-common to SNAPSHOT-1.3.0liamfallon1-1/+1
Snapshot updated for Casablanca. Change-Id: Ife941f771b02be68e35fd638adfac78cf2b3ba99 Issue-ID: POLICY-875 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-05-21Update Policy Common to 1.2.3-SNAPSHOTliamfallon1-1/+1
These reviews must be merged in order because of layering. This review should be merged FIRST. Issue-ID: POLICY-844 Change-Id: I7cf07902c3b2d7766dc64f1c1dd80d91dee18467 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-05-16Upgrade SNAPSHOT to 1.2.2liamfallon1-1/+1
These reviews must be merged in order because of layering. This review should be merged FIRST Change-Id: If143b2d23487c073fafad8f6208cd8d320ec98e9 Issue-ID: POLICY-798 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-04-13Upgrade SNAPSHOT to 1.2.1Pamela Dragosh1-1/+1
Issue-ID: POLICY-736 Change-Id: Iccb43b692908ffc35fc0d18da1e967718e3c3519 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-03-15Removed checkstyle warningsmmis5-754/+742
Removed checkstyle warnings in policy/common/utils-test Issue-ID: POLICY-695 Change-Id: I9962b2f815d2c116f77475944bc17ea1cb0af539 Signed-off-by: mmis <michael.morris@ericsson.com>
2018-02-20Merge "Consolidating and organizing dependencies"Jorge Hernandez1-2/+0
2018-02-20Consolidating and organizing dependenciesPamela Dragosh1-2/+0
This is the first sweep to organize the dependencies. I did upgrade the JUnit in this repo to 4.12 as I thought this would be harmless. Issue-ID: POLICY-626 Change-Id: I4dc120d2d48830b282d9a173ab69cc553a4d5e78 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-19Rename utils-test testXxx() methodsJim Hahn6-52/+52
Fixed sonar complaints about the testXxx_Yyy() methods in the XxxTester classes. In most cases, they were renamed to testYyy(). The top-level method, test(), was not renamed so-as not to break existing tests that already depend on it. Renamed testStringConstuctor() to testString(). Change-Id: I00e8993c71fa9d9cb83bea82276d9706dd0e7c45 Issue-ID: POLICY-246 Signed-off-by: Jim Hahn <jrh3@att.com>