summaryrefslogtreecommitdiffstats
path: root/context/context-management/src
AgeCommit message (Collapse)AuthorFilesLines
2021-08-31Fix sonar issues in apex-pdpRam Krishna Verma6-17/+23
Issue-ID: POLICY-3077 Change-Id: Id5e7c2ddada2bac3b73fe543f9adade6f9b83e6c Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-08-26Fix sonar issuesRam Krishna Verma7-38/+38
Issue-ID: POLICY-3077 Change-Id: I480b97984754ec4b69c6cde6481510fbbf62252e Signed-off-by: Ram Krishna Verma <ram_krishna.verma@bell.ca>
2021-08-24Use CompareToBuilderJim Hahn1-8/+6
Also added lombok to test classes. Issue-ID: POLICY-3391 Change-Id: I9ecf479f3861a2e5211b037e885029d1719b6a56 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-24More lombok for apex-pdpJim Hahn1-9/+3
Added lombok to auth thru context-management, excluding basic-model and context-model. Issue-ID: POLICY-3391 Change-Id: I1c3a69d52d3bc65a99126ad44126e5a97424c66f Signed-off-by: Jim Hahn <jrh3@att.com>
2021-08-05Use lombok in apex-pdp #2Jim Hahn16-396/+78
Updated context to use lombok. Issue-ID: POLICY-3391 Change-Id: I349e0202fffad161cac08cebaea4a9571db58bda Signed-off-by: Jim Hahn <jrh3@att.com>
2021-05-03Remove GroupValidationResultJim Hahn8-194/+74
Removed GroupValidationResult, replacing it with BeanValidationResult. Modified the ParameterGroup subclasses to use BeanValidator, adding annotations where needed to trigger the validations that had been automatically performed by GroupValidationResult. Issue-ID: POLICY-2059 Change-Id: I2c0c01fac355e6cde4d8d6998dc42f8a2e2ebb65 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-18Fix sonars in apex-pdpJim Hahn2-8/+8
Addressed the following issues: - initialize mocks before use - use parameterized queries - Random() is not secure - provide parameterized type for generics - unused imports - constructor visibility - use compute() instead of containsKey()/put() - make final fields static - rename constants to all upper case - no assert() in Thread.run() methods - nested try - nested if/else - too many break/continue - use try-with-resources - repeatable annotations - overlapping characters in reg ex - hashcode is not sufficient in compareTo() - need equals() with compareTo() - make class an interface - use parameterized test - multiple calls in assert() - log or re-throw - use different type of lambda - use parameterized logging - use StringBuilder instead of concatenation - use StandardCharsets.UTF_8 Issue-ID: POLICY-2906 Change-Id: I2cf8c885e3e22c2c6cbe6403a34906928afad022 Signed-off-by: Jim Hahn <jrh3@att.com>
2021-02-18Replace GsonXxxAdaptersJim Hahn3-16/+78
The GsonXxxAdapters were removed from the models Serialization classes and replaced with type adapters from common. Modified the code to refer to the new adapters. Without this fix, examples-onap-vcpe will not compile. Could that be the cause of the apex-pdp standalone issue, POLICY-3066? Allow TypeAdapter in lieu of JsonSerializer/Deserializer adapters in config files. Note: examples-ona-bbs refers to the following, which were removed several releases ago (during the actor re-write?): - appclcm.util.Serialization$RequestAdapter & Serialization$ResponseAdapter Issue-ID: POLICY-2905 Change-Id: Ia57e0346343614cbd4a1cffd9c8393f207284244 Signed-off-by: Jim Hahn <jrh3@att.com>
2020-09-03Clean up warnings and SONAR issuesliamfallon1-35/+30
Issue-ID: POLICY-2654 Change-Id: Ifd391ea9141d37cfd3ca4110d66c667962230ae1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-07-20Replace try/catch with assertj - apex-pdpwaynedunican3-194/+72
Replaced try/catch blocks apex-pdp with assertj assertions. Part III of changes. Issue-ID: POLICY-2451 Change-Id: I77ee4140cdfc2066f463459f92163677c3e34ef2 Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-07-17Replace try/catch with assertj - apex-pdpwaynedunican1-149/+63
Replaced try/catch blocks in apex-pdp with assertj assertions. Part II of changes Issue-ID: POLICY-2451 Change-Id: I29823054fbeb6d1a287d1234859aaf2d4609ef6d Signed-off-by: waynedunican <wayne.dunican@est.tech>
2020-07-13Merge "Remove old documentation from build"Jim Hahn3-128/+0
2020-07-13Remove old documentation from buildliamfallon3-128/+0
apex-pdp had an in-line docuemntation build system built on asciidoc. It has proven to be very difficult to maintain and keep up to date and it is incompatible with the ONAP official RST/ReadTheDocs docuementation system. In the Dublin release, we converted the asciidoc documentation to RST format, and hae been updating the RST documentation since. The asciidoc docuemntation system is now so out of date that it is being removed. In this change, the "site" directory is removed from all modules in apex-pdp and a profile called "apexSite" is removed from the pom.xml file in all modules. Issue-ID: POLICY-2686 Change-Id: I645f3ed101159d356cd90e619cef791067ad5eb5 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-07-10Fix assertTrue SONAR issues in apex-pdp/contex and apex-pdp/coreJvD_Ericsson1-8/+9
Replace assertTrue with assertEquals and assertFalse with assertNotEquals in apex-pdp/client apex-pdp/context and apex-pdp/core Issue-ID: POLICY-2690 Change-Id: Ic1e69c75e5f8f887cac135b6728b007faf4b19a6 Signed-off-by: JvD_Ericsson <jeff.van.dam@est.tech>
2020-06-19Changes for checkstyle 8.32liamfallon21-34/+9
Issue-ID: POLICY-2188 Change-Id: I56bbf3aa3bd9e1ef433cc93ad2be0c54d141a2a5 Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-03-09Use Rhino javascript executor in apex-pdpliamfallon1-3/+2
Integation unit tests resultd in StackOverflowException errors in the Graal Javascript interpreter. Following extensive testing and trouobleshooting, it proved very difficult to fix these issues in Graal as the stck overflow errors were occurring in native class instantiation methods being invoked by Grall on the JVM. The alternative Rhino Javascript engine is developed by mozilla, and was incorporated into the Java 6 JVM and evolved into Nashorn in the Java 8 JVM. Oracle dropped Nashorn in Java 11. However, in parallel, Rhino development has continued. This review brings in the Rhino javascript engine into apex-pdp as the replacement for Nashorn and instead of Graal. Graal seems to be pretty unstable as yet so we may bring it in in future releases but for now Rhino is a more stable and reliable alternative. Issue-ID: POLICY-2106 Change-Id: I0edeff3b0bee404b38e3ebe22001a6e3375a44dc Signed-off-by: liamfallon <liam.fallon@est.tech>
2020-02-26Fix Java 11/Checkstyle/Sonar warningsliamfallon7-141/+140
A number of Java 11, checkstyle, and SONAR warnings have crept into the Apex codebase over the last number of reviews. This change fixes those issues. Issue-ID: POLICY-1913 Change-Id: I2afd607e80f48323355380fb2fe5e048e18879f9 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-28Replace getCaononicalName() with getName() in code baseliamfallon2-12/+13
Issue-ID: POLICY-1861 Change-Id: Iccbdcbc5b5978305c56ab74c01a52a562697bee1 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-26Reduce verbosity of logging during unit testliamfallon1-1/+1
Logging dialled back in logback.xml files and on ligging statements in unit test java code. Issue-ID: POLICY-2272 Change-Id: I3b9a46d8993b1571c8dc62687a9c136af46c1f51 Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-11-14Retaining context in APEX Engine based on policies received in PdpUpdatea.sreekumar2-10/+7
Change-Id: I73fad5bf76ed6b4979f5ab76013f204ea82da30b Issue-ID: POLICY-2215 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-06-28Replace non-Javadoc comments with inheritDocsliamfallon11-382/+184
Copyright headers not changed as this review only amends comments. Issue-ID: POLICY-1791 Change-Id: Icbeb2c6e591b3b160ae102bb67aef2d407924a4d Signed-off-by: liamfallon <liam.fallon@est.tech>
2019-06-21Replace uses of getCanonicalName() with getName() in APEXa.sreekumar3-7/+6
Change-Id: Ifcd8866e65a7bc1238d5a4137f7bad288a5bfb3b Issue-ID: POLICY-1861 Signed-off-by: a.sreekumar <ajith.sreekumar@est.tech>
2019-03-19Use Assertions class from policy-commonliamfallon5-6/+11
Change import line in all classes that use the Assertions class, there are a lot of them. Issue-ID: POLICY-1264 Change-Id: I8480264be4e36348b3fc63acf1bc36e9c9dd250b Signed-off-by: liamfallon <liam.fallon@est.tech>
2018-12-11Add period after inheritDocliamfallon5-9/+9
Issue-ID: POLICY-1074 Change-Id: I88dc888b2a374b38499241f578a36dd116e2b85b Signed-off-by: liamfallon <liam.fallon@est.tech>
2018-12-05Fix bugs in context flushingliamfallon1-41/+52
The context flushing support in the context distributor can throw a concurrent exception when a lot of context is active and a flush takes place. This fix introduces proper synchronized access to the album maps. In addition, there was an incorrect cast in the call to the persist() method of the persistor. Change-Id: I6594ffed83a0b34251a0c5c7893d4abb17437fd4 Issue-ID: POLICY-1380 Signed-off-by: liamfallon <liam.fallon@est.tech>
2018-12-03Rename test classes in apex-pdpParshad Patel8-18/+18
Make test classes name consitence by adding 'Support' or 'Dummy' at start of util or dummy type of test classes Issue-ID: POLICY-1263 Change-Id: I1dc1a7f174660a90664ebdcff2ea79ed30aa465c Signed-off-by: Parshad Patel <pars.patel@samsung.com>
2018-11-20Refactor Apex benchmark testsliamfallon1-1/+1
Apex performance tests are refactored and reorganised to be all in the one place and to be coherent. A test REST server that can generate events in batches is introduced and this can be configured to respond to REST calls from Apex with various batch sizes that can be varied for performance tests. Actual performance tests are added for the various executors in Apex. Change-Id: I692b41e1e4451e821a618c64dead5cc8e9685d08 Issue-ID: POLICY-812 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-10-05Set pretty print on JSON creationliamfallon1-1/+1
Pretty printing was set off, making debugging of JSON messages more difficult. Issue-ID: POLICY-954 Change-Id: Ifcc32cdba822f2bfc105c99cc3dc85ee05a89f6f Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-10-04Fix creation of sub Avro itemsliamfallon4-2/+24
When an Avro object is created, nested sub avro objects are not created automatically. This change allows invocation of a method to create sub objects of Avro objects. Issue-ID: POLICY-954 Change-Id: Ie510867f2631ba6a8c6f5452c08aef5db67e8997 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-10-03Add unit test for core events and contextliamfallon3-8/+399
This code is covered by feature testing but does not show up in Sonar. These unit tests give coverage on engine modules. Issue-ID: POLICY-1034 Change-Id: Ib7a288bcb9729ec88346cc8047e38f3a58f9a97c Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-09-26Allow custom JSON adapter specificationliamfallon11-68/+768
In order to decode and encode complex Java POJOs with GSON, type adapters must be specified. This change allows specification of GSON type adapters for decoding and encoding of JSON in apex. Issue-ID: POLICY-954 Change-Id: Ib402d4e82c4f22fa4d532c016f77fb8e7bb568d3 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-09-14Fix exception not logged or rethrownliamfallon1-1/+1
Eclipse sonarlint does not check for exception dropping by default, it must be configured. This commit addresses exception dropping in apex. Change-Id: I406838990b3424c2912124b25d7326502cacc96c Issue-ID: POLICY-1034 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-09-13Sonar/Checkstyle in service/pluginsliamfallon1-2/+2
Sonar and Checkstyle changes in plugins and services, and knock on changes Issue-ID: POLICY-1034 Change-Id: Iff7df74e54fce2c661dcc2fae75ae93d4cacfe5b Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-09-12Sonar/Checkstyle in model/context/coreliamfallon7-67/+88
Checkstyle and sonar changes in the model, contexot and core modules. Issue-ID: POLICY-1034 Change-Id: I2d40bc877f3a548844470fc290fc89d63fa465ae Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-09-10Checkstyle changes for apex modelliamfallon12-51/+54
Fix checkstyle warnings in the apex mode and knock on changes. Issue-ID: POLICY-1034 Change-Id: I10537e4288e9cad5ef18165ed2cdc1d3ab3139c1 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-09-07Parameter group fields must have gettersliamfallon1-1/+1
Modifications to apex parameters to include getters that follow naming conventions, and knock on changes. Also checkstyle fixes taken in modifified classes. Issue-ID: POLICY-1095 Change-Id: Iff5ccc7a069a4ec2b2b974ed9f5ed70a88692e00 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-09-06Fix package of apex examples and documentsliamfallon1-1/+1
The examples are not packaged correctly in the apex build and the client wars are missing The links and location of the documents are corrected. Some POM duplicate dependencies removed. Javadoc warnings removed. Issue-ID: POLICY-867 Change-Id: I555c29191c61c0a9887365d95005dbc584eddf04 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-09-04Fix checkstyle issues in apex model basicliamfallon9-41/+41
CHeckstyle issues in apex model basic and knock on changes in other apex modules. Issue-ID: POLICY-1034 Change-Id: I65823f5e2e344526abc74b0812877113acb056ec Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-08-31Use parameter service in apexliamfallon15-151/+288
Switch parameter handling in apex to use the ONAP PF common parameter service Change-Id: Id318d19c726b18b1a69c630fa81ca7d695355e9c Issue-ID: POLICY-954 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-08-27Fix checkstyle warning in tools & context packagesDinh Danh Le5-47/+60
Change-Id: I5b72c7a35d56296cd5053659a9d4c1e8f3b058be Signed-off-by: Dinh Danh Le <dinh.danh.le@ericsson.com> Issue-ID: POLICY-1034
2018-08-11Checkstyle the context-management packageDinh Danh Le14-96/+115
Change-Id: Ifc4fef920681f21b0a965ea55d9bb78785ec66f9 Signed-off-by: Dinh Danh Le <dinh.danh.le@ericsson.com> Issue-ID: POLICY-1034
2018-07-31Adding first set of apex-pdp document changesramverma3-0/+128
Adding document changes for auth, context, core, model, services & the main apex-pdp module. Change-Id: Id0d026baa258f1dc6998978f9911f3c4a73b5b3b Issue-ID: POLICY-867 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>
2018-07-06Refactoring existing integration testswaqas.ikram2-15/+21
Change-Id: I1aedd94d5197b8c6513fc701e9df2aab4edec088 Issue-ID: POLICY-865 Signed-off-by: waqas.ikram <waqas.ikram@ericsson.com>
2018-06-21Add unit test for apex pdp context schemaliamfallon8-11/+482
Unit tests added for context schema handling in the APEX PDP. Code coverage in the schema packages now above required limit. Issue-ID: POLICY-857 Change-Id: I66ad6eb0e758f7a80492caae514875229c28924f Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-06-18Fix package name, Unit Test for Context Albumliamfallon4-1/+352
package org.onap.policy.core renamed to org.onap.policy.apex.core Added unit text for context exceptions and context album Issue-ID: POLICY-857 Change-Id: I24f376245d9bc46db6a6a47ac3e8e6c559a16465 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-06-14Add YAML plugin and cleanup for checkstyleliamfallon2-24/+36
Bringing in the APEX YAML plugin, allows events with YAML bodies to be consumed by APEX. Also clean up of event protocol interface to make it not specific for JSON. Also some checkstyle changes on classes impacted by event protocol interface change. Change-Id: I7c3867ac508096fd8acad2488e61db87dfa1d6bd Issue-ID: POLICY-862 Signed-off-by: liamfallon <liam.fallon@ericsson.com>
2018-05-30Adding apex context moduleramverma42-0/+4139
Change-Id: I1284c2ba4c41a9cf721e141e096d1021be599a2d Issue-ID: POLICY-857 Signed-off-by: ramverma <ram.krishna.verma@ericsson.com>