aboutsummaryrefslogtreecommitdiffstats
AgeCommit message (Collapse)AuthorFilesLines
2018-02-20Sonar fixes to drools-pdpJim Hahn50-856/+792
Fixed most of the instances of the following sonar issues: Moved array designator Used diamond operator Changed System.out/err to use a logger Changed several Thread.sleep() in test code to a single sleep() Useless assignments Replaced comparison with "" to string.isEmpty() Merged if's Replaced ArrayList with List in method returns Reordered type modifiers Reordered constructor methods Defined constants for literals, or replaced them with method calls Removed "throws Xxx" for subclasses of RuntimeException Combined identical "catch" blocks Re-interrupted the current thread after catching an InterruptedException Removed tests against the literal "false" Fix indentation of new makeTopicOperError() method. Fix exception variable name in new methods, logNoUebEncoder() and logNoDmaapEncoder(). Change-Id: Iddae5210553662f733b67333b372dec8c3fe2c94 Issue-ID: POLICY-336 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-02-19Fix compilation issue due to generic ExceptionJim Hahn1-2/+2
After modifying common to remove generic Exceptions, drools-pdp would no longer compile. Had to modify drools-pdp to accomodate the specific exception. Change-Id: Ib804da2ebfc7dbf5f4035ba3d48832ffe541f902 Issue-ID: POLICY-246 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-02-16Modify sonar settings to include all sub-modulesPamela Dragosh1-104/+181
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: I916d90c27b316837284a635087665130dee5437b Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-14Replace bitronix and eclipselink in persistenceJim Hahn17-1111/+1377
Replaced bitronix transaction manager, which is not intended for production, with jboss transaction manager. Eliminated eclipselink so that only hibernate is used for persistence for both JPA and drools-persistence. Added more test cases to EntityMgrTrans to provide coverage for various exception types. Moved object store to features/session-persistence/jta. Wrapped RuntimeException in specific type. Modified test to throw specific exception type. Converted GenSchema from an @Test to a main(). Logged caught exceptions in junit tests. Change-Id: I4b02efc8da43d20b2dbb3c0b25adc382e80474ec Issue-ID: POLICY-191 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-02-13protocol coder and null drools controller junitsJorge Hernandez2-74/+266
Change-Id: Ie26a8cd44a39007e38c9dc8c28418e988df70c77 Issue-ID: POLICY-583 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-02-09Upgrade Jetty to remove security warningPamela Dragosh2-2/+2
This may not be red status, but I felt it was worthwhile to upgrade this. It resolves a timing issue when checking passwords. Issue-ID: POLICY-506 Change-Id: I926d2ee90529130d0c74285f4c4876083eb78f1f Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-08Merge "protocol coder junits"Jorge Hernandez1-0/+242
2018-02-08protocol coder junitsJorge Hernandez1-0/+242
Change-Id: I7a02a8767dbb19724715e057b1da82f7045d6a44 Issue-ID: POLICY-583 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-02-08programatic install of rules artifacts for junitsJorge Hernandez8-54/+26
instead of relying on pom.xml, build settings. since jenkins jobs that generate sonars don't seem to go through a build phase anymore, therefore the preceding artifacts are not available in the local repository, which is required by the tests. Change-Id: Icfd14b2f8a6c6e1ac7d986bd6eb977b2a83b044d Issue-ID: POLICY-621 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-02-08Merge "expose immutable list of filters to its users"Pamela Dragosh7-134/+337
2018-02-08Security issue with jackson-databindPamela Dragosh1-1/+1
I should have upgraded to 2.9.4, my mistake. This has the actual fix in it for the security issue. Issue-ID: POLICY-506 Change-Id: I11d22b83a60789160852e17204ac3c03cb44f6c1 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-07expose immutable list of filters to its usersJorge Hernandez7-134/+337
+ additional related junits Change-Id: I00293cd9aa911dfb3d658cad4ee0441ad3410e9c Issue-ID: POLICY-164 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-02-07Upgrade dependencies to solve security issuesPamela Dragosh1-4/+4
Not guaranteed, but these are dependencies that we can fix that will hopefully close some of the security issues flagged by LF. Issue-ID: POLICY-506 Change-Id: I2ddd5254e53241159f9483b5442cac6f8a1bdbab Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-06Fix sonar issues with RepositoryAuditJim Hahn1-2/+0
Per sonar, removed commented code from RepositoryAudit. Change-Id: Ia81780f7528bd4fc42062454728a2c215709ea45 Issue-ID: POLICY-469 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-02-01Reduce technical debt add coveragePamela Dragosh8-18/+119
* add empty constructor message * remove unnecessary exception declaration * add @FunctionalInterface declaration * switched around public static per java conventions * fixed up JUnit ordering * added some trivial JUnit tests to bump coverage > 70% Issue-ID: POLICY-460 Change-Id: I13b6de29f66d692143b06180feed76dd6332d6cf Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2018-02-01Merge "Fix sonar issues in feature-state-management"Jorge Hernandez4-184/+198
2018-02-01Merge "Fix sonar code issues for api-state-management"Jorge Hernandez2-15/+12
2018-02-01Merge "junits+utils to generate/test rules applications"Jorge Hernandez9-1/+497
2018-01-31fix typo when configuring fetch-limit parameterJorge Hernandez2-4/+2
Change-Id: Iea108fe035bea14e2ecd12db68b331dd2d546591 Issue-ID: POLICY-596 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-01-31Fix sonar issues in feature-state-managementJim Hahn4-184/+198
DroolsPDPIntegrityMonitor.java: Modified init() to throw just IntegrityMonitorException. Modified DroolsPDPIntegrityMonitor init() method to throw specific types of exceptions. StateManagementFeature.java: Sonar complained about needing to merge "if" statements, but chose to eliminate the "if(logger.isDebugEnabled())" instead - did this through-out the source file. Removed extra runtime exception from "throws" declaration. DbAudit.java: Fixed sonar issue regarding setting a static variable from within a non-static method. Removed logger.isDebugEnabled() tests where method calls are not involed. Simplified invoke() method complexity as reported by sonar. DroolsPDPIntegrityMonitor.java: Reduced init() complexity reported by sonar. Change-Id: Ib2722b21bbf3aad130af46c8790f40d8777e36be Issue-ID: POLICY-469 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-01-31Fix sonar code issues for api-state-managementJim Hahn2-15/+12
Renamed constants, adding "DO_" prefix or "_STATE" suffix. Removed spurious exceptions from "throws" clauses. Change-Id: I0abd74d736009480614f0653fe5aaf1ddbe77b08 Issue-ID: POLICY-468 Signed-off-by: Jim Hahn <jrh3@att.com>
2018-01-31junits+utils to generate/test rules applicationsJorge Hernandez9-1/+497
1. utilities to generate rules applications and installing in local maven repository programmatically. 2. using these utilities, use policy abstractions, ie. controllers, containers, .. to junit test it. Change-Id: I13c35e631a1120fad503feef2593d32a99e3358f Issue-ID: POLICY-583 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2018-01-18Resolve bug in DroolsPDPIntegrityMonitorMagnusen, Drew (dm741q)1-8/+20
This fix ensures that the testServices, testRestClasses, tesManaged, and testSwagger properties are all populated in the stateManagementProperties object within DroolsPDPIntegrityMonitor class. Issue-ID: POLICY-564 Change-Id: Ie517b19f61ab084416ce1e6f8418d69dc9e4f85d Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2018-01-08Initialize allSeemsWell CorrectlyKevin McKiou1-3/+8
Patch 1: Correctly initialize DroolsPdpsElectionHandler.allSeemsWell upon the first call to checkWaitTimer(). Issue-ID: POLICY-519 Change-Id: I0b9ad0bfba211d705c2d9f9305694956ca3951b6 Signed-off-by: Kevin McKiou <km097d@att.com>
2017-12-21Merge "Fix issues blocking election handler thread"Jorge Hernandez10-141/+548
2017-12-21Merge "Reduce tech debt in policy-management"Jorge Hernandez11-118/+189
2017-12-19Reduce tech debt in policy-managementMagnusen, Drew (dm741q)11-118/+189
Changes to reduce tech debt in the policy-management module. Issue-ID: POLICY-463 Change-Id: I41f6b66d25a805706e5c9ed2cef2eda256153a37 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-12-14Add a DMaaP simulatorCharles Cole4-0/+541
Added a DMaaP simulator for testing applications. One current limitation is that the simulator does not support multiple "subscribers" on the same topic; if someone gets a message, that message cannot be subsequently retrieved by anyone else. The simulator has also not been tested for concurrent getting and posting. Also added a way to set the response code DMaaP would return for a get to test that policy can gracefully handle errors. It may need some work to become truely its own "feature" Issue-ID: POLICY-489 Change-Id: I524981bdf5e4e825f13e6197dda11d9498e4f4bf Signed-off-by: Charles Cole <cc847m@att.com>
2017-12-13Fix issues blocking election handler threadKevin McKiou10-141/+548
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. Issue-ID: POLICY-501 Change-Id: I7b8180d11077ccf59b21b6484cb58b5522a3df8f Signed-off-by: Kevin McKiou <km097d@att.com>
2017-12-08Merge "Multiple small changes to reduce technical debt."Jorge Hernandez9-38/+42
2017-12-07Multiple small changes to reduce technical debt.Magnusen, Drew (dm741q)9-38/+42
Made multiple changes across several classes to reduce technical debt in policy-endpoints project. Issue-ID: POLICY-462 Change-Id: I0338b9e98dd5a39492f3880c2e3a5d35b3957811 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-12-05feature-healthcheck technical debtMagnusen, Drew (dm741q)2-49/+119
Made multiple changes to feature-healthcheck module to reduce technical debt identified by sonar. Issue-ID: POLICY-464 Change-Id: Ie168821611db5c0b171114e4fdd90411ce38a796 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-12-01Merge "Modified state mgmt to fix some sonar issues"Jorge Hernandez6-159/+198
2017-12-01Modified state mgmt to fix some sonar issuesJim Hahn6-159/+198
Reordered modifiers. Reordered variables, methods, and constructors. Removed useless parentheses. Removed unneeded "catch" clauses. Extracted nested try blocks into their own method. Replaced a string with a constant. Removed extra thrown exceptions when they are unnecessary (i.e., they're subclasses of RuntimeException, or the method is already declared to throw an Exception). Replaced a large anonymous class with a named, nested class. Separated variable declarations onto individual lines. Changed "String args[]" to "String[] args". Replaced if-then-else by single return statement. Invoked super() inside empty, default constructor. Removed Thread.sleep() calls from junit test per comments on 11/29. Commented out Thread.sleep() in junit tests, as they don't appear to be necessary. If that turns out to be untrue, then CountdownLatch.await() can be used instead. Sonar complained about useless assignments to "phase", but those did not appear to be useless. Did not remove commented-out lines, as they may be needed when debugging. Change-Id: I90ba6f7317a18a10ce1b881cfc6d21a602171ff5 Issue-ID: POLICY-469 Signed-off-by: Jim Hahn <jrh3@att.com>
2017-12-01Fix sonar-maven-plugin version mismatchHockla, Ali (ah999m)1-4/+0
Removed the sonar-maven-plugin tag from drools-pdp/pom.xml as it contained a different groupId than the one in oparent. Change-Id: Ibb8e798a4360eaa78c7e2430a398a1b71b9174f6 Issue-ID: POLICY-485 Signed-off-by: Hockla, Ali (ah999m) <ah999m@att.com>
2017-12-01Merge "make volatile access to alive and locked flags"Jorge Hernandez2-9/+5
2017-11-30make volatile access to alive and locked flagsJorge Hernandez2-9/+5
instead of synchronized read access Change-Id: I3f4457f798d6f4d4a013bf023ed2d9c1b75d4f1f Issue-ID: POLICY-487 Signed-off-by: Jorge Hernandez <jh1730@att.com>
2017-11-30Merge "Refactored code to reduce technical debt."Pamela Dragosh2-33/+40
2017-11-30Refactored code to reduce technical debt.Magnusen, Drew (dm741q)2-33/+40
Major changes in this commit include the refactoring of the run method in TestTransaction.java to reduce the amount of technical debt identified by sonar. Other small changes were also made. Issue-ID: POLICY-467 Change-Id: I2522f690de58e3c6f4cc894e6dea47277404d745 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-11-30Merge "Made some changes per sonar"Pamela Dragosh1-2/+2
2017-11-29Made some changes per sonarJim Hahn1-2/+2
Reordered modifiers. Used diamond operator. Change-Id: Iba3a2e035dd233574058f426744d1722a30083f7 Issue-ID: POLICY-468 Signed-off-by: Jim Hahn <jrh3@att.com>
2017-11-29Fix Sonar issues in policy-coreCharles Cole3-22/+24
Fixed the Sonar issues in policy-core that required minimal refactoring of the code. Issue-ID: POLICY-461 Change-Id: I3d0f7c4411855b2c75d5ae6968665753b50bde75 Signed-off-by: Charles Cole <cc847m@att.com>
2017-11-29Fix Sonar issues in policy-utilsCharles Cole3-31/+35
Fixed the Sonar issues in policy-utils that required minimal refactoring of the code. Issue-ID: POLICY-460 Change-Id: Ie88fb1d819f343c8c0bc4d0b73e41089d79cdb6c Signed-off-by: Charles Cole <cc847m@att.com>
2017-11-21Election Handler CleanupKevin McKiou2-6/+6
Under stress, the election handler in feature-active-standby-management may not get a chance to run within the allowed window causing the "watcher" thread to kill it and restart it. The run window is expanded. Also the pdp.updateInterval and pdp.checkInterval parameter values are increased appropriately in the properties file. Issue-ID: POLICY-484 Change-Id: I0c1c2d4fdfbc408be929c56e451b92fc7ad4464a Signed-off-by: Kevin McKiou <km097d@att.com>
2017-11-21Merge "Fix fortify issues identified in drools"Pamela Dragosh2-10/+7
2017-11-21Merge "Modified dmaapClient dependency GroupId/Version"Pamela Dragosh2-3/+3
2017-11-21Modified dmaapClient dependency GroupId/VersionMagnusen, Drew (dm741q)2-3/+3
Changed GroupId of dmaapClient dependency to org.onap.dmaap.messagerouter.mirroragent and version to 1.0.0. Issue-Id: POLICY-370 Change-Id: I165d6f0b4a64a80f344646ea1972654718ebbf96 Signed-off-by: Magnusen, Drew (dm741q) <dm741q@att.com>
2017-11-21Bump minor versionJessica Wagantall17-18/+18
Bump minor version in preparation for Amsterdam branching. Change-Id: I7a10894837580ae898573156e47e31f32ae0d041 Issue-ID: CIMAN-120 Signed-off-by: Jessica Wagantall <jwagantall@linuxfoundation.org>
2017-11-15Update to 1.1.2-SNAPSHOTPamela Dragosh1-1/+1
One last file was forgotten - released 1.1.1. Bump patch to 1.1.2 Issue-ID: POLICY-436 Change-Id: I509efb33da9aa49b8c6b47927fca0c056d5401e2 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>
2017-11-15Update to 1.1.2-SNAPSHOTPamela Dragosh16-16/+16
Released 1.1.1, bump patch to 1.1.2 Issue-ID: POLICY-436 Change-Id: Idc58c1dc0cd66243ca1b94cce2ef4254ef2d87c8 Signed-off-by: Pamela Dragosh <pdragosh@research.att.com>