policy/common.git
6 years agofixed Checkstyle warnings 23/54823/3
vamshi.nemalikonda [Thu, 14 Jun 2018 15:05:03 +0000 (20:35 +0530)]
fixed Checkstyle warnings

Issue-ID: POLICY-881
Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com>
Change-Id: Idc0c088497b4a49789c3f0aedf034d380bd3af1c

6 years agoMerge "IntegrityMonitor: remove sleep from junit tests"
Pamela Dragosh [Mon, 25 Jun 2018 14:00:03 +0000 (14:00 +0000)]
Merge "IntegrityMonitor: remove sleep from junit tests"

6 years agoIntegrityAuditor: remove sleep from junit tests 35/55235/3
Jim Hahn [Thu, 21 Jun 2018 20:23:19 +0000 (16:23 -0400)]
IntegrityAuditor: remove sleep from junit tests

Modified the code to use a CurrentTime object for its "time" operations
(e.g., sleep(), currentTimeInMillis()). Modified junit tests to replace
the CurrentTime object with TestTime objects so they don't actually
do any sleeping.
Reformat "commit" message.
Remove TODO from junit test.
Init testTime in junit setUp().
Add AuditorTime and test classes.
Change "latch" to "semaphore" in comments.
Change time units in junit test from SECONDS to MILLISECONDS.
Add sleep() method to auditor test class.
Reorder field qualifiers.
Change utils scope to "compile" in pom.

Change-Id: I8aa8b642b315156c00422192e4aa8e47b4503c2f
Issue-ID: POLICY-908
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoIntegrityMonitor: remove sleep from junit tests 27/55227/2
Jim Hahn [Thu, 21 Jun 2018 19:43:32 +0000 (15:43 -0400)]
IntegrityMonitor: remove sleep from junit tests

Modified the code to use a CurrentTime object for its "time"
operations (e.g., sleep(), currentTimeInMillis()).  Modified
junit tests to replace the CurrentTime object with TestTime
objects so they don't actually do any sleeping.
Update license date.
Remove unneeded dependency from pom.
Don't start FpManager thread within its own constructor.
toMillis() should handle -1 as an input.
Fix comment in test base superclass.
Change time units in test base from DAYS to MILLISECONDS.

Change-Id: Id6a4edb1747ca1a683e5d37522872b781294532d
Issue-ID: POLICY-908
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoMerge "PropertyUtil: remove sleep when running junit test"
Pamela Dragosh [Thu, 21 Jun 2018 19:54:37 +0000 (19:54 +0000)]
Merge "PropertyUtil: remove sleep when running junit test"

6 years agoMerge "Delete SpecPropertyConfiguration class"
Pamela Dragosh [Thu, 21 Jun 2018 19:35:42 +0000 (19:35 +0000)]
Merge "Delete SpecPropertyConfiguration class"

6 years agoMerge "IntegrityMonitory - remove latch for non-test code"
Pamela Dragosh [Thu, 21 Jun 2018 19:35:25 +0000 (19:35 +0000)]
Merge "IntegrityMonitory - remove latch for non-test code"

6 years agoMerge "IntegrityAudit - remove latches from non-test code"
Pamela Dragosh [Thu, 21 Jun 2018 19:34:21 +0000 (19:34 +0000)]
Merge "IntegrityAudit - remove latches from non-test code"

6 years agoPropertyUtil: remove sleep when running junit test 55/55155/3
Jim Hahn [Fri, 15 Jun 2018 00:09:37 +0000 (20:09 -0400)]
PropertyUtil: remove sleep when running junit test

Update licenses.
Remove uneeded dependencies.
Make "timer" field private.
Make LazyHolder protected.
Add comment to TestListener.
Combine copyright lines.

Change-Id: I77c198c9bc6c224fa93ef74d0c56aa73b187e169
Issue-ID: POLICY-908
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoIntegrityAudit - remove latches from non-test code 51/55151/1
Jim Hahn [Wed, 13 Jun 2018 16:23:26 +0000 (12:23 -0400)]
IntegrityAudit - remove latches from non-test code

Change-Id: I5d5cc7d581f78d5551e2fe7447720403bb63ada2
Issue-ID: POLICY-908
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoIntegrityMonitory - remove latch for non-test code 47/55147/1
Jim Hahn [Thu, 14 Jun 2018 13:05:50 +0000 (09:05 -0400)]
IntegrityMonitory - remove latch for non-test code

Change-Id: I95ebcf8aabfa01eb6453a4ba5dd88d11c8f025c9
Issue-ID: POLICY-908
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoMerge "Add CurrentTime utilities"
Pamela Dragosh [Wed, 20 Jun 2018 17:25:18 +0000 (17:25 +0000)]
Merge "Add CurrentTime utilities"

6 years agoDelete SpecPropertyConfiguration class 33/55133/1
Jim Hahn [Wed, 20 Jun 2018 13:10:06 +0000 (09:10 -0400)]
Delete SpecPropertyConfiguration class

Change-Id: Ie97d2c396ec6df1e03287a7ecb866bc8acf6cfbc
Issue-ID: POLICY-907
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoAdd CurrentTime utilities 75/55075/2
Jim Hahn [Fri, 15 Jun 2018 13:10:00 +0000 (09:10 -0400)]
Add CurrentTime utilities

Add some comments.  Update license text.

Change-Id: I4cee208378c44d9730274aee337feb95f9026add
Issue-ID: POLICY-908
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoMerge "Move SpecProperties from drools-pdp to common"
Pamela Dragosh [Tue, 19 Jun 2018 15:13:58 +0000 (15:13 +0000)]
Merge "Move SpecProperties from drools-pdp to common"

6 years agoMove SpecProperties from drools-pdp to common 37/55037/1
Jim Hahn [Mon, 18 Jun 2018 21:29:01 +0000 (17:29 -0400)]
Move SpecProperties from drools-pdp to common

Change-Id: Ifa1785922b42f990d4d84c1410dd1d881b10647d
Issue-ID: POLICY-907
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoUse setXxx() methods for @Property fields 25/55025/2
Jim Hahn [Mon, 18 Jun 2018 19:53:30 +0000 (15:53 -0400)]
Use setXxx() methods for @Property fields

Fortify generates a security exception when PropertyConfiguration
attempts to directly update private fields.  PropertyConfiguration
has been modified to invoke setXxx() methods, instead, to set the
values for the fields.
Add junit tests for new methods.

Change-Id: Ic4420b6348724c5a384d3c2c8bf7b4c0c6350fa9
Issue-ID: POLICY-906
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoMerge "Fix entry in logging message catalog"
Pamela Dragosh [Sun, 10 Jun 2018 00:04:32 +0000 (00:04 +0000)]
Merge "Fix entry in logging message catalog"

6 years agoRemove "&quot;" from logback xml files 65/51065/2
Jim Hahn [Fri, 8 Jun 2018 15:50:22 +0000 (11:50 -0400)]
Remove "&quot;" from logback xml files

Logback complains if %d{} values contain "&quot;", but it works fine
without them, thus they have been removed.
Update license header.

Change-Id: Ie72cc5ec922c161e1fd5058021a57282c4f0134b
Issue-ID: POLICY-785
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoFix entry in logging message catalog 55/51055/1
Jim Hahn [Fri, 8 Jun 2018 14:55:10 +0000 (10:55 -0400)]
Fix entry in logging message catalog

Replaced hyphen with underscore in a resource id in the message
catalog.

Change-Id: I3734d87361a3a58f92db48a8c22b40e5eadead42
Issue-ID: POLICY-785
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoRemoving checkstyle warnings from ErrorsTester 19/50919/1
vamshi.nemalikonda [Thu, 7 Jun 2018 12:23:14 +0000 (17:53 +0530)]
Removing checkstyle warnings from ErrorsTester

Change-Id: Ifc70d9682317033fd98b43ba802f9fd1acf519a8
Issue-ID: POLICY-881
Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com>
6 years agoFixed most of the Checkstyle warnings. 11/50911/1
vamshi.nemalikonda [Thu, 7 Jun 2018 11:17:07 +0000 (16:47 +0530)]
Fixed most of the Checkstyle warnings.

Change-Id: I80b05663e81648058f84aff5d5cda2deaa2d87c9
Issue-ID: POLICY-881
Signed-off-by: vamshi.nemalikonda <vn00480215@techmahindra.com>
6 years agoUpdate policy-common to SNAPSHOT-1.3.0 75/50375/1
liamfallon [Tue, 5 Jun 2018 14:41:08 +0000 (15:41 +0100)]
Update policy-common to SNAPSHOT-1.3.0

Snapshot updated for Casablanca.

Change-Id: Ife941f771b02be68e35fd638adfac78cf2b3ba99
Issue-ID: POLICY-875
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
6 years agoUse ${POLICY_LOGS} for log directory 89/48389/2 2.0.0-ONAP beijing 2.0.0-ONAP v1.2.3
Jim Hahn [Mon, 21 May 2018 21:49:13 +0000 (17:49 -0400)]
Use ${POLICY_LOGS} for log directory

Update license date.

Change-Id: I912e1d8ab56b124178b4bfdd8646ee62b48b386c
Issue-ID: POLICY-759
Signed-off-by: Jim Hahn <jrh3@att.com>
6 years agoUpdate Policy Common to 1.2.3-SNAPSHOT 89/48289/1
liamfallon [Mon, 21 May 2018 11:56:13 +0000 (12:56 +0100)]
Update Policy Common to 1.2.3-SNAPSHOT

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>
6 years agoUpgrade 1.2.2 version.properties 73/47873/1 v1.2.2
Pamela Dragosh [Wed, 16 May 2018 18:01:42 +0000 (14:01 -0400)]
Upgrade 1.2.2 version.properties

This file needs to be upgraded also.

Issue-ID: POLICY-798
Change-Id: I9a899b9889e0cb0cf82d65dba6f86af5613e201e
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
6 years agoUpgrade SNAPSHOT to 1.2.2 07/47807/2
liamfallon [Wed, 16 May 2018 11:41:31 +0000 (12:41 +0100)]
Upgrade SNAPSHOT to 1.2.2

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>
7 years agoAdd INFO.yaml file 53/45353/4 v1.2.1
Jessica Wagantall [Tue, 1 May 2018 03:07:43 +0000 (20:07 -0700)]
Add INFO.yaml file

Add INFO.yaml to list:
- Project description
- Properties
- PTL information
- Meeting information
- Committer information

Change-Id: Ia4f34d6a00c7d5f0b5a830ca58de20445ff2b224
Issue-ID: CIMAN-134
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
7 years agoAdd missing licenses 93/42793/1
Pamela Dragosh [Fri, 13 Apr 2018 18:49:59 +0000 (14:49 -0400)]
Add missing licenses

Issue-ID: POLICY-741
Change-Id: Iac1b4a61dbdc6de46fa82357076d6b3b44b128f1
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoUpgrade SNAPSHOT to 1.2.1 81/42781/2
Pamela Dragosh [Fri, 13 Apr 2018 16:14:42 +0000 (12:14 -0400)]
Upgrade SNAPSHOT to 1.2.1

Issue-ID: POLICY-736
Change-Id: Iccb43b692908ffc35fc0d18da1e967718e3c3519
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoRemove ECOMP trademark 69/39769/1 v1.2.0
Pamela Dragosh [Wed, 28 Mar 2018 18:19:59 +0000 (11:19 -0700)]
Remove ECOMP trademark

Issue-ID: POLICY-696
Change-Id: I036dbbe004e4e37b5ffa95e416dab3ec507046d2
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoRemoved checkstyle warnings 01/39701/2
eikrwaq [Wed, 28 Mar 2018 14:50:57 +0000 (15:50 +0100)]
Removed checkstyle warnings

Change-Id: I350bbd414477fe0b480c1bc4e7fa60b1e63842a7
Issue-ID: POLICY-712
Signed-off-by: eikrwaq <waqas.ikram@ericsson.com>
7 years agoAdd PropertyConfiguration class 79/38179/15
Jim Hahn [Fri, 23 Mar 2018 18:47:42 +0000 (14:47 -0400)]
Add PropertyConfiguration class

Added PropertyConfiguration class, which provides for the loading of
properties into the fields of a subclass.  Annotations are used to
identify the field to be loaded and the name of the property from
which it is to be loaded.
Changed attribute "useDefault" to "emptyOk" so that it only has to
be specified when the default value is empty.
Reformatted a couple of files.
Added setAllFields() method.
Added getRawPropertyValue() method so subclasses can change how
values are extracted from the property set.
Added SpecPropertyConfiguration so controller or session names
may be embedded within property names.
Fixed some typos.
Refactored out generalizeType2().
Changed exception classes to take field name instead of Field object.
Modified getValue() to take the field name and class type instead of
Field object.
Removed or fixed comments in junit tests.
Added more junit tests.
Changed emptyOk attribute to accept, to facilitate adding other
options in the future.
Corrected comments on the isEmptyOk() methods.

Change-Id: I6b190fea687f87cf512fb3236bfcf40b7adc4566
Issue-ID: POLICY-577
Signed-off-by: Jim Hahn <jrh3@att.com>
7 years agoAdd junit and refactor code 01/37501/9
eikrwaq [Wed, 21 Mar 2018 15:31:05 +0000 (15:31 +0000)]
Add junit and refactor code

Adding Junit tests in modules and refactoring code

Change-Id: I887f1b2371d9e3d4a4e2ce6e7e1f3c97a361f283
Issue-ID: POLICY-704
Signed-off-by: eikrwaq <waqas.ikram@ericsson.com>
7 years agoMerge "Removed checkstyle warnings"
Pamela Dragosh [Wed, 21 Mar 2018 13:21:23 +0000 (13:21 +0000)]
Merge "Removed checkstyle warnings"

7 years agoMerge "Removed checkstyle warnings"
Pamela Dragosh [Wed, 21 Mar 2018 12:10:13 +0000 (12:10 +0000)]
Merge "Removed checkstyle warnings"

7 years agoRemoved checkstyle warnings 73/37073/3
mmis [Tue, 20 Mar 2018 11:46:13 +0000 (11:46 +0000)]
Removed checkstyle warnings

Removed checkstyle warnings in policy/common/ia

Issue-ID: POLICY-695
Change-Id: I25f589dff5ce1dba0681ba549a53087426593d71
Signed-off-by: mmis <michael.morris@ericsson.com>
7 years agoRemoved checkstyle warnings 63/37163/1
mmis [Tue, 20 Mar 2018 15:28:46 +0000 (15:28 +0000)]
Removed checkstyle warnings

Removed checkstyle warnings in policy/common/sitemanager

Issue-ID: POLICY-695
Change-Id: I9ac6f95e7e259016e0ad9ad7caced59e4d6b84a0
Signed-off-by: mmis <michael.morris@ericsson.com>
7 years agoRemoved checkstyle warnings 53/37153/1
mmis [Tue, 20 Mar 2018 15:02:53 +0000 (15:02 +0000)]
Removed checkstyle warnings

Removed checkstyle warnings in policy/common/im

Issue-ID: POLICY-695
Change-Id: I32b4797249386c0d1bd0f50792880a1759503a67
Signed-off-by: mmis <michael.morris@ericsson.com>
7 years agoMerge "Removed checkstyle warnings"
Pamela Dragosh [Tue, 20 Mar 2018 14:49:45 +0000 (14:49 +0000)]
Merge "Removed checkstyle warnings"

7 years agoRemoved checkstyle warnings 29/36229/3
mmis [Fri, 16 Mar 2018 14:42:22 +0000 (14:42 +0000)]
Removed checkstyle warnings

Removed checkstyle warnings in policy/common/logging

Some warnings remain that required renaming of classes and public methods.
These will be taken separately

Issue-ID: POLICY-695
Change-Id: Id604c66708917de390c556b50f6266f929b09134
Signed-off-by: mmis <michael.morris@ericsson.com>
7 years agoFixing reported bug in Sonar for policy/common 33/36233/5
eikrwaq [Fri, 16 Mar 2018 15:05:41 +0000 (15:05 +0000)]
Fixing reported bug in Sonar for policy/common

Change-Id: I449259749f93a5b9058c76e99d96465466458a56
Issue-ID: POLICY-661
Signed-off-by: eikrwaq <waqas.ikram@ericsson.com>
7 years agoMerge "Fixing 12 reported bugs in Sonar for policy/common"
Pamela Dragosh [Fri, 16 Mar 2018 13:58:57 +0000 (13:58 +0000)]
Merge "Fixing 12 reported bugs in Sonar for policy/common"

7 years agoFixing 12 reported bugs in Sonar for policy/common 99/35999/6
eikrwaq [Thu, 15 Mar 2018 12:59:14 +0000 (12:59 +0000)]
Fixing 12 reported bugs in Sonar for policy/common

Change-Id: I7bf453828f7a62070e7a73362798e6f2d4806b2f
Issue-ID: POLICY-661
Signed-off-by: eikrwaq <waqas.ikram@ericsson.com>
7 years agoRemoved checkstyle warnings 97/36197/1
mmis [Fri, 16 Mar 2018 09:44:46 +0000 (09:44 +0000)]
Removed checkstyle warnings

Removed checkstyle warnings in policy/common/utils

Issue-ID: POLICY-695
Change-Id: I831b74c889d44784d6328619d88eb92fb524ce74
Signed-off-by: mmis <michael.morris@ericsson.com>
7 years agoMerge "Removed checkstyle warnings"
Pamela Dragosh [Thu, 15 Mar 2018 20:07:31 +0000 (20:07 +0000)]
Merge "Removed checkstyle warnings"

7 years agoRemoved checkstyle warnings 39/36039/1
mmis [Thu, 15 Mar 2018 10:59:51 +0000 (10:59 +0000)]
Removed checkstyle warnings

Removed checkstyle warnings in policy/common/utils-test

Issue-ID: POLICY-695
Change-Id: I9962b2f815d2c116f77475944bc17ea1cb0af539
Signed-off-by: mmis <michael.morris@ericsson.com>
7 years agoUpdate oparent version to 1.1.0 31/35831/1
liamfallon [Wed, 14 Mar 2018 21:39:21 +0000 (21:39 +0000)]
Update oparent version to 1.1.0

Directive from ONAP project that all repos should be
updated. Change vierified with a build with .m2 /org/onap
cleared.

Change-Id: Iff212a0f7b2917b20237ec7ef5f4b2cbd13d7dcb
Issue-ID: POLICY-693
Signed-off-by: liamfallon <liam.fallon@ericsson.com>
7 years agoClean up pom.xml due to redesign 63/34963/1
Pamela Dragosh [Fri, 9 Mar 2018 14:26:17 +0000 (09:26 -0500)]
Clean up pom.xml due to redesign

No need for this anymore as the staging builds won't work
anyway and this is in the settings.

Issue-ID: POLICY-623
Change-Id: I98a61be05d25083f595fb308bfefd942a02c8208
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoAdded junit tests in ONAP-Logging 79/33179/2
mmis [Tue, 27 Feb 2018 14:05:23 +0000 (14:05 +0000)]
Added junit tests in ONAP-Logging

Added junit tests to org.onap.policy.common.logging.flexlogger package in ONAP-Logging

Issue-ID: POLICY-582
Change-Id: I024f990960fa71bff7655da9c2cd5dd0db8ee33c
Signed-off-by: mmis <michael.morris@ericsson.com>
7 years agoAdded junit tests in ONAP-Logging 79/32679/2
mmis [Fri, 23 Feb 2018 11:32:19 +0000 (11:32 +0000)]
Added junit tests in ONAP-Logging

Added junit tests to org.onap.policy.common.logging.eelf package in ONAP-Logging

Issue-ID: POLICY-582
Change-Id: Ifca9c38d8b8703b183c25d891d6ed257eb21c91b
Signed-off-by: mmis <michael.morris@ericsson.com>
7 years agoUpgrade EELF to fix license 91/32391/1
Pamela Dragosh [Wed, 21 Feb 2018 14:08:31 +0000 (09:08 -0500)]
Upgrade EELF to fix license

We asked EELF to upgrade qos.logback to 1.2.3, they upgraded to 1.2.1.

This will also fix a compilation error we have due to a combination
of commits and ordering of inclusion of qos.logback.

Issue-ID: POLICY-505
Change-Id: Ia086ceae5e1468d34a8db053818fef3f50585f25
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoMerge "Increase junit coverage in ONAP-logging"
Jorge Hernandez [Tue, 20 Feb 2018 22:34:11 +0000 (22:34 +0000)]
Merge "Increase junit coverage in ONAP-logging"

7 years agoIncrease junit coverage in ONAP-logging 97/32297/3
Jim Hahn [Tue, 20 Feb 2018 18:41:59 +0000 (13:41 -0500)]
Increase junit coverage in ONAP-logging

Added some junit tests to increase coverage of ONAP-logger.
Many classes still need test cases.

Also fixed some sonar issues:
Returned interface instead of ConcurrentHashMap.
Used EnumMap instead of HashMap.
Used StringBuilder instead of StringBuffer.
Replaced literals with constants.
Replaced enum1.toString().equals(enum2.toString()) with enum1 == enum2

Updated license dates.
Updated another license date.

Change-Id: I777b6a913d7d03187a29dfeb817800b386ee23aa
Issue-ID: POLICY-582
Signed-off-by: Jim Hahn <jrh3@att.com>
7 years agoMerge "Consolidating and organizing dependencies"
Jorge Hernandez [Tue, 20 Feb 2018 17:54:03 +0000 (17:54 +0000)]
Merge "Consolidating and organizing dependencies"

7 years agoConsolidating and organizing dependencies 17/32117/3
Pamela Dragosh [Mon, 19 Feb 2018 16:37:11 +0000 (11:37 -0500)]
Consolidating and organizing dependencies

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>
7 years agoRename utils-test testXxx() methods 43/32143/2
Jim Hahn [Mon, 19 Feb 2018 15:24:33 +0000 (10:24 -0500)]
Rename utils-test testXxx() methods

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>
7 years agoMerge "Replace System.out by logger"
Pamela Dragosh [Mon, 19 Feb 2018 13:10:56 +0000 (13:10 +0000)]
Merge "Replace System.out by logger"

7 years agoMerge "Replace System.out by logger"
Pamela Dragosh [Mon, 19 Feb 2018 13:10:49 +0000 (13:10 +0000)]
Merge "Replace System.out by logger"

7 years agoReplace System.out by logger 73/32073/1
Swapnali Pode [Mon, 19 Feb 2018 06:41:17 +0000 (12:11 +0530)]
Replace System.out by logger

Replace this use of System.out or System.err by a logger
Main.java:L610

Sonar Link:
https://sonar.onap.org/project/issues?assignees=swapnalipode&id=org.onap.policy.common%3Acommon-modules&resolved=false

Location:
src\main\java\org\onap\policy\common\sitemanager\Main.java

Change-Id: If40b049f2458a381e79168824caeb68bad4bc26f
Issue-ID: POLICY-636
Signed-off-by: Swapnali Pode <SP00501638@techmahindra.com>
7 years agoReplace System.out by logger 67/32067/1
Swapnali Pode [Mon, 19 Feb 2018 06:03:06 +0000 (11:33 +0530)]
Replace System.out by logger

Replace this use of System.out or System.err by a logger
Main.java:L605

Sonar Link:
https://sonar.onap.org/project/issues?assignees=swapnalipode&id=org.onap.policy.common%3Acommon-modules&resolved=false

Location:
src\main\java\org\onap\policy\common\sitemanager\Main.java

Change-Id: I6f39ee886e4d3caf8e9a1ae9ab57dd8e4847e3bd
Issue-ID: POLICY-635
Signed-off-by: Swapnali Pode <SP00501638@techmahindra.com>
7 years agoFix more generic exceptions in common 17/32017/2
Jim Hahn [Fri, 16 Feb 2018 23:11:21 +0000 (18:11 -0500)]
Fix more generic exceptions in common

Fixed a few more generic exceptions in integrity-audit and
integrity-monitor.
Fixed license dates.

Change-Id: Ibbc21ae5f853896e0d3e416e33b5ea2a13672f62
Issue-ID: POLICY-246
Signed-off-by: Jim Hahn <jrh3@att.com>
7 years agoMerge "Add test coverage to integrity-monitor"
Pamela Dragosh [Fri, 16 Feb 2018 17:02:51 +0000 (17:02 +0000)]
Merge "Add test coverage to integrity-monitor"

7 years agoModify sonar settings to include all sub-modules 77/31977/2
Pamela Dragosh [Fri, 16 Feb 2018 15:29:09 +0000 (10:29 -0500)]
Modify sonar settings to include all sub-modules

We are now including all the sub-modules coverage into one file.
This will now reflect correct statistics for any sub-module that
tests code located in another sub-module.

Issue-ID: POLICY-634
Change-Id: I37f1f02fa1763bd02adb425b8a6f5ddbb760a9f0
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoMerge "Speed up integrity-audit tests"
Jorge Hernandez [Thu, 15 Feb 2018 20:03:50 +0000 (20:03 +0000)]
Merge "Speed up integrity-audit tests"

7 years agoReplace System.out or System.err by logger 77/31677/1
Swapnali Pode [Wed, 14 Feb 2018 06:02:23 +0000 (11:32 +0530)]
Replace System.out or System.err by logger

Replace this use of System.out or System.err by a logger
Main.java:L600

Sonar Link:
https://sonar.onap.org/project/issues?assignees=swapnalipode&id=org.onap.policy.common%3Acommon-modules&resolved=false

Location:
src\main\java\org\onap\policy\common\sitemanager\Main.java

Change-Id: I3e2461e7a49d8e480e4ce4692e625284811a0e02
Issue-ID: POLICY-630
Signed-off-by: Swapnali Pode <SP00501638@techmahindra.com>
7 years agoAdd test coverage to integrity-monitor 45/31645/5
Jim Hahn [Tue, 13 Feb 2018 14:19:43 +0000 (09:19 -0500)]
Add test coverage to integrity-monitor

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>
7 years agoSpeed up integrity-audit tests 27/31627/2
Jim Hahn [Tue, 13 Feb 2018 19:16:47 +0000 (14:16 -0500)]
Speed up integrity-audit tests

Added additional DbDAO constructors to facilitate JUnit testing.
Added DbDAO destroy() method to close the EntityManagerFactory.
Pulled out common code into IntegrityAuditTestBase and subclassed
the tests from there.
Added hooks to IntegrityAudit so that the AuditThread timers could
be set to smaller values so that all of the junit tests could be
run in much less time.
Added similar hooks to DbAudit.
Modified integrity-audit tests to use new utility classes to auto-close
JPA managers.
Modified integrity-audit tests to use new utility class to scan logger
items without the need to scan the actual log file.
Added code to new test superclass to truncate the four ONAP logs.
Modified hooks in IntegrityAuditEntity to adjust serialization
so that dates are not serialized/de-serialized when used in junit
tests.
Deleted TestingUtils.
Added a test for invalid nodeType property.
Fixed issue wherein AuditThread doesn't stop when interrupted.

Change-Id: I5101995b6b68655b2810777bc4d2ec80c7cbc363
Issue-ID: POLICY-582
Signed-off-by: Jim Hahn <jrh3@att.com>
7 years agoAdd AutoClose wrappers for JPA classes 23/31123/7
Jim Hahn [Fri, 9 Feb 2018 17:20:56 +0000 (12:20 -0500)]
Add AutoClose wrappers for JPA classes

Added EntityMgrCloser and EntityMgrTrans classes that will automatically
close/rollback the wrapped JPA classes.  As a result, these classes can
be used in try-with-resource statements to ensure that the JPA
EntityTransaction is rolled back and the EntityManager is closed.
Add "build" section into pom to make it consistent with other poms
in common.
Changed scope to "provided" in utils pom for javax.persistence to
prevent clashes with other projects that depend on the utils project.
Changed scope to "test" in utils pom and to "provided" in utils-test
pom for junit.
Fixed license date in EntityTransCloser.
Fixed license titles in utils & utils-test source files.
Moved files from package xxx.test.jpa to package xxx.jpa, because they
are not test-specific classes.
Include exception when logging message in ThrowablesTester, hopefully
eliminating sonar complaint.

Change-Id: I531f20d93a679d4bb432c1d75c1feac0e334bc44
Issue-ID: POLICY-582
Signed-off-by: Jim Hahn <jrh3@att.com>
7 years agoAdd ExtractAppender to facilite junit tests 65/30765/8
Jim Hahn [Wed, 7 Feb 2018 22:13:32 +0000 (17:13 -0500)]
Add ExtractAppender to facilite junit tests

Added ExtractAppender to provide a way for junit tests to capture
data sent to a logger.
Changed logback.version to 1.2.3 and moved the property to the
top-level pom.
Updated license date in top-level pom.
Refactored ExceptionsText, adding ErrorsTester and
ThrowablesTester classes to reduce sonar issues.

Change-Id: Ief7d08972bf4e7037b59c2afe4b77b252f2ad60a
Issue-ID: POLICY-582
Signed-off-by: Jim Hahn <jrh3@att.com>
7 years agoAdd utils-test project 13/30313/3
Jim Hahn [Mon, 5 Feb 2018 17:05:26 +0000 (12:05 -0500)]
Add utils-test project

Added utils-test project to policy/common.
Modified integrity-audit and integrity-monitor to use the new
utils-test project to test the Exception subclasses.

Change-Id: If4a27cdb2351b7c49b084dbf287950172fa059cf
Issue-ID: POLICY-582
Signed-off-by: Jim Hahn <jrh3@att.com>
7 years agoRemoved commented code and add JUnit tests 49/30149/2
Pamela Dragosh [Fri, 2 Feb 2018 14:25:14 +0000 (09:25 -0500)]
Removed commented code and add JUnit tests

* Useless assignments
* Commented out code
* Unused imports
* Add simple JUnit for exception classes

Issue-ID: POLICY-456
Change-Id: I012c2b6bdaf1b5803b2f1c37fd4d9514055e4ef0
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoAddressing technical debt integrity-monitor 37/30037/1
Pamela Dragosh [Thu, 1 Feb 2018 19:17:30 +0000 (14:17 -0500)]
Addressing technical debt integrity-monitor

Issue-ID: POLICY-457
Change-Id: I6e4bc00bc85f73bcb4c58c54378f062d98e6876d
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoFix sonar generic Exceptions in policy/common 95/29895/3
Jim Hahn [Wed, 31 Jan 2018 23:10:34 +0000 (18:10 -0500)]
Fix sonar generic Exceptions in policy/common

IntegrityMonitor.java:
Renamed variables, Ex: dep_groups => depGroups.
Renamed enum constants, Ex: pdp_xacml => PDP_XACML.
Merged "if" tests.
Cast values to "long" before multiplying.
Re-throw interrupt().
Write exception via logger instead of e.printStackTrace().
Moved constructor to top of the file.
Removed most logger.isDebugEnabled() checks.
Returned generic List instead of ArrayList.
Used entrySet() instead of keySet().
Removed useless parentheses.
Removed superfluous exceptions from "throws" declaration.

DbAudit.java:
Modified DbAudit to throw DbAuditException.
Replaced references to HashSet and HashMap with generic Set and Map.
Modified DbAudit to iterate over entrySet() instead of keySet().

ComponentAdminException:
Created ComponentAdminException class.
Modified ComponentAdmin methods to throw new exception class.
Extracted "stateManager" String constant.
Eliminated logger.isDebugEnabled() calls.
Updated the license data.

Eliminated double-checked locking problem from PropertyUtil:
Modified code to use Initialization On Demand Holder idiom.

Change-Id: Ic01288542041da26df483ce85ecaf292ac138f85
Issue-ID: POLICY-246
Signed-off-by: Jim Hahn <jrh3@att.com>
7 years agoStateManagement EntityManager Creation 67/27567/1
Kevin McKiou [Fri, 5 Jan 2018 22:44:51 +0000 (16:44 -0600)]
StateManagement EntityManager Creation

Patch 1:
This change modifies StateManagement methods that use transactions so
that an EntityManager is created each time the method is called. This
eliminates issues with EntityManager transactions being shared across
threads causing errors when multiple threads are active.

Issue-ID: POLICY-518
Change-Id: I071660a530de610ec56af82347b92496f87bf4e1
Signed-off-by: Kevin McKiou <km097d@att.com>
7 years agoFix issues blocking election handler thread 61/26261/6
Kevin McKiou [Wed, 13 Dec 2017 21:11:08 +0000 (15:11 -0600)]
Fix issues blocking election handler thread

Patch 1:
This bug tracks the AT&T bug 355533.  The symptom was that drools pdps
that were backing each other up were becoming stuck in a standby state.
The cause was that the election handler thread was being hung by a call
to PolicyEngine.manager.deactivate which shuts down the topic endpoints
when the drools pdp operational state transitions to disabled. Related
problems were that the election handler heartbeat was NOT blocked when
the main thread was blocked and the IntegrityMonitor forward progress
counter was NOT blocked from incrementing when the election handler
thread was blocked.  This prevented the correct failover of the drools
pdp to another healthy one. This change fixes the two causes of the
thread blockage, moves the election handler heartbeat to the main
thread and adds an interface (AllSeemsWell) which is called when
the election handler has stalled/resumed. The AllSeemsWell interface
will block forward progress counter increments when ALLNOTWELL and will
resume forward progress counter increments when ALLSEEMSWELL. In
addition, it reduces the run time of the StandbyStateManagementTest
from approximately 8 minutes to approximately 2 minutes. Since this
changes classes also changed by POLICY-444, this change must be merged
before POLICY-444 can be merged.
Patch 2: Extended sleep times in AllSeemsWellTest.
Patch 3: Commented out asserts that are keeping it from building.
Note: It builds just fine in local environment.
Patch 4: Moved the check of allNotWellMap from testTransaction to
endTransaction so it will cover calls to endTransaction from application
code rather than just calls from testTransaction.
Patch 5: Fixed potential Sonar issue in initialization of HashMaps
allSeemsWellMap and allNotWellMap
Patch 6: Changes to IntegrityMonitorTest to make it run faster and
more deterministically.  This satisfies POLICY-444.

Issue-ID: POLICY-501
Change-Id: I8fbbdc481839ec6066f26392d30e230d6b1293f2
Signed-off-by: Kevin McKiou <km097d@att.com>
7 years agoFix technical debt in common integrity-audit 47/25347/4
Temoc Rodriguez [Tue, 28 Nov 2017 17:59:02 +0000 (09:59 -0800)]
Fix technical debt in common integrity-audit

Address technical debt in policy/common integrity-audit submodule.
Implementation for empty constructors, remove useless assignment,
use <> on constructor, use @Override. Not all technical debt
addressed, only the ones specified by Pam in POLICY-336, except
the use Set instead of HashSet where a method signature would
change.

Issue-ID: POLICY-456
Change-Id: If8f9f4151503bdd22c8c405485538f8be779cabd
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
7 years agoMerge "Fix bug where paramsAreBad doesn't update string"
Pamela Dragosh [Tue, 5 Dec 2017 15:24:13 +0000 (15:24 +0000)]
Merge "Fix bug where paramsAreBad doesn't update string"

7 years agoMerge "Fix sonar issues in ONAP-logging"
Pamela Dragosh [Tue, 5 Dec 2017 15:23:17 +0000 (15:23 +0000)]
Merge "Fix sonar issues in ONAP-logging"

7 years agoFix sonar issues in ONAP-logging 83/25483/2
Charles Cole [Mon, 4 Dec 2017 20:47:04 +0000 (14:47 -0600)]
Fix sonar issues in ONAP-logging

Fixed the Sonar issues in ONAP-logging that required minimal refactoring
of the code.  Many of the System.out and System.err issues I did not
fix, as I don't know what loggers to use.

Issue-ID: POLICY-458
Change-Id: I8eccb932b350a170b9cd680b90009e6612a0abcd
Signed-off-by: Charles Cole <cc847m@att.com>
7 years agoFix bug where paramsAreBad doesn't update string 73/25473/1
Temoc Rodriguez [Mon, 4 Dec 2017 19:39:54 +0000 (11:39 -0800)]
Fix bug where paramsAreBad doesn't update string

Replaced the string parameter with a StringBuilder so that the modified
version can be accessed outside the method, since strings are immutable.
Added null check for properties. Removed trim on properties in case the
property is null. Added junit to test that the modified StringBuilder can
be read outside the paramsAreBad method.

Issue-ID: POLICY-492
Change-Id: I0550e9d639cbbcc876e6aafb84f6e9a363b653ff
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
7 years agoMerge "Fix fortify Issue on Privacy Violation"
Jorge Hernandez [Tue, 28 Nov 2017 01:38:54 +0000 (01:38 +0000)]
Merge "Fix fortify Issue on Privacy Violation"

7 years agoIntegrityMonitor check before commit 57/24757/1
Kevin McKiou [Tue, 21 Nov 2017 19:36:04 +0000 (13:36 -0600)]
IntegrityMonitor check before commit

Under some conditions the JPA transaction may be already closed
when commit is called in StateManagement. Surround it with a
check to see if the transaction is active, so it will not
generate an error in the log.

Issue-ID: POLICY-484
Change-Id: Id54585e68361a0be9ae8afd7e9ccba2f7eadfe5f
Signed-off-by: Kevin McKiou <km097d@att.com>
7 years agoBump minor version of version.properties 31/24731/1
Charles Cole [Tue, 21 Nov 2017 16:44:57 +0000 (10:44 -0600)]
Bump minor version of version.properties

Changed version of version.properties from 1.1.2 to 1.2.0

Change-Id: I4d8eb4bdd52ae7d98627f28f0bca72443bfd23eb
Issue-ID: CIMAN-120
Signed-off-by: Charles Cole <cc847m@att.com>
7 years agoMerge "Fix bug when IntegrityMonitor runs subsystem late"
Pamela Dragosh [Tue, 21 Nov 2017 16:09:45 +0000 (16:09 +0000)]
Merge "Fix bug when IntegrityMonitor runs subsystem late"

7 years agoBump minor version 81/24281/1
Jessica Wagantall [Sun, 19 Nov 2017 02:34:43 +0000 (18:34 -0800)]
Bump minor version

Bump minor version in preparation for Amsterdam
branching.

Change-Id: Id33c61586582d008ecede4cd31ed6b046a5bafc0
Issue-ID: CIMAN-120
Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
7 years agoUpdate SNAPSHOT 1.1.2 87/23587/1
Pamela Dragosh [Wed, 15 Nov 2017 11:50:52 +0000 (06:50 -0500)]
Update SNAPSHOT 1.1.2

We release 1.1.1, now move up to 1.1.2

Issue-ID: POLICY-436
Change-Id: I5d2c79ac5f7a2561e79a6644785238465180c59c
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoFix release job 87/23187/2 1.0.0-Amsterdam 1.0.0-ONAP v1.1.1
Pamela Dragosh [Sat, 11 Nov 2017 00:18:46 +0000 (19:18 -0500)]
Fix release job

Missing staging repo

Issue-ID: POLICY-441
Change-Id: I7b74861d774685c5d0418fcde68fd0992dd58198
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoFix fortify Issue on Privacy Violation 67/23167/1
Joseph Chou [Fri, 10 Nov 2017 21:09:25 +0000 (16:09 -0500)]
Fix fortify Issue on Privacy Violation

Remove the line where password get stored in variable

Issue-ID: POLICY-442

Change-Id: I5d474c7a27dfbdcf49b5f1578be75bd2cb627afe
Signed-off-by: Joseph Chou <jc2555@att.com>
7 years agoUpdate SNAPSHOT version 33/22633/3
Pamela Dragosh [Wed, 8 Nov 2017 02:09:11 +0000 (21:09 -0500)]
Update SNAPSHOT version

Releasing version 1.1.0 so we need to update to 1.1.1

Issue-ID: POLICY-436
Change-Id: Ie8979e618b49ebd50d0527275cb70cc3824cde1f
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoFix bug when IntegrityMonitor runs subsystem late 05/22405/1
Temoc Rodriguez [Mon, 6 Nov 2017 21:29:30 +0000 (13:29 -0800)]
Fix bug when IntegrityMonitor runs subsystem late

Changes to dependencyCheck to correctly take into account subsystemTest on the first pass through dependencies. Allows for status of repo to remain failed in the case that it fails.

Issue-ID: POLICY-431
Change-Id: I23ce43ce41c546edad73ec8055e513ccc61933b0
Signed-off-by: Temoc Rodriguez <cr056n@att.com>
7 years agoTweak testTransaction 51/21051/1 v1.1.0
Kevin McKiou [Fri, 27 Oct 2017 17:52:36 +0000 (12:52 -0500)]
Tweak testTransaction

Remove startTransaction from testTransaction since it does
nothing functionally and causes exceptions which are logged.

Issue-ID: POLICY-369
Change-Id: Idd064b49e1d68832d14039870414626ca56c779b
Signed-off-by: Kevin McKiou <km097d@att.com>
7 years agoMerge "Redundant code removal and hadrcoded strings"
Jorge Hernandez [Thu, 21 Sep 2017 17:45:17 +0000 (17:45 +0000)]
Merge "Redundant code removal and hadrcoded strings"

7 years agoRedundant code removal and hadrcoded strings 27/13927/4
Bharat saraswal [Wed, 20 Sep 2017 16:03:45 +0000 (21:33 +0530)]
Redundant code removal and hadrcoded strings

Issue-Id:POLICY-252
Change-Id: I839811ba15d0c478c83c03818087d3153b77ddb1
Signed-off-by: Bharat saraswal <bharat.saraswal@huawei.com>
7 years agoUpgrade to release oparent version. 95/14295/1
Pamela Dragosh [Thu, 21 Sep 2017 15:02:36 +0000 (11:02 -0400)]
Upgrade to release oparent version.

Following independent release and versioning process guidelines.

Issue-ID: POLICY-225
Change-Id: I3dad2abc5040255c9271c45eae99394dfd4208b5
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoRedundant code removal and hadrcoded strings 23/13923/3
Bharat saraswal [Wed, 20 Sep 2017 15:13:20 +0000 (20:43 +0530)]
Redundant code removal and hadrcoded strings

Issue-Id:POLICY-252
Change-Id: Ibf8b6790cbf9f65f1d3b3fc4476f686ff8981a10
Signed-off-by: Bharat saraswal <bharat.saraswal@huawei.com>
7 years agoRemove sonar critical for public static 15/13515/1
Pamela Dragosh [Tue, 19 Sep 2017 15:59:31 +0000 (11:59 -0400)]
Remove sonar critical for public static

I think that making these private and using accessor functions
we can remove the sonar critical for them.

Issue-ID: POLICY-237
Change-Id: I4edbf909935fe17b0ef087b5cd0e384d78d104d6
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoFix sonar critical for password 59/12559/1
Pamela Dragosh [Thu, 14 Sep 2017 21:22:24 +0000 (17:22 -0400)]
Fix sonar critical for password

Focused on hard coded passwords. I believe they are only
used for JUnit tests so I moved them into a file for use.
If they still show up on sonar then I will move into a properties
file and/or mark as not going to fix.

Issue-ID: POLICY-237
Change-Id: I6fa561714091043a2ea5e2edfb0441c2dfc8b044
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
7 years agoChanged logger to slf4j 31/10931/5
Magnusen, Drew (dm741q) [Thu, 31 Aug 2017 16:32:51 +0000 (11:32 -0500)]
Changed logger to slf4j

Changed all instances of Sys.out or PolicyLogger to
slf4j.

Issue-ID: POLICY-178
Change-Id: Ia91af1deb18a9b5c466f6f8a6c546c17c54e14ad
Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
7 years agoLogging exceptions to clear sonar critical 69/12469/1
Pamela Dragosh [Thu, 14 Sep 2017 15:25:42 +0000 (11:25 -0400)]
Logging exceptions to clear sonar critical

Just logging the exceptions anyway and remove e.printstack since
that goes to stdout/stderr.

Issue-ID: POLICY-195
Change-Id: I60616bd6ce633e2fcae266bb37eb735c6e6bb4c4
Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>