aboutsummaryrefslogtreecommitdiffstats
path: root/cps-service/src/test
AgeCommit message (Collapse)AuthorFilesLines
2023-07-11Combine alreadyDefinedException classesdanielhanrahan1-4/+5
Issue-ID: CPS-1774 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I52ff9074a9f8188e8635a811b0d2713a97cb4b10
2023-06-29Improved code coverage (branches) around multipart file utilsToineSiebelink1-37/+37
- added test - moved wrongly placed test (from MultipartFileUtilSpec to DataMapUtilsSpec) - applied curent conventions to DataMapUtilsSpec Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ie8dc7f6802bb6ff0a256dc05df73da6af75409f3
2023-06-27NCMP : Handle non-existing and non-ready cm handlessourabh_sourabh1-3/+5
- Modified data operation schema to contains cm handle as steing and response content field name as result. - Added a new common cloud event builder for NCMP to create an event. - Added data operation event creater that uses cloud event builder to create a cloud event. - Introduced a new method onto json object mapper to convert json object to bytes. - Modified EventDateTimeFormatter and added a new method to convert date timestamp into offsetdateTime. - Added a new code into ResourceRequestUtil to identify non-ready cm handle and non-existing cm handle and later publish it as cloud event to tha client given topic. - Introduced CpsApplicationContext to get spring mannaged bean into non spring managed java object. Issue-ID: CPS-1583, CPS-1614 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I24a39d2cb2c54dea25cd2f17e7748e21cd83a088 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2023-05-16Fixing minor compilationwaqas.ikram1-1/+1
- Complilation issues while importing project in eclipse - Fixing CSIT Change-Id: Idb85b08066d27a7f2a9b297d1580915df2b67541 Issue-ID: CPS-1672 Signed-off-by: waqas.ikram <waqas.ikram@est.tech>
2023-05-09Support for Patch across multiple data nodes--global1-9/+20
- Added new method updateMultipleDataLeaves to perform Update on multiple data nodes - Deprecated singular method of update data node(updateDataLeaves) - Refactored code where singular version was used - Updated release notes Issue-ID: CPS-1006 Signed-off-by: <as00745003@techmahindra.com> Change-Id: If67280e2dd3ad566de9a8217489f168415e624bc
2023-05-02Align the hazelcast cluster namesmpriyank2-3/+6
- We need to align the hazelcast cluster names as members of the same cluster can join each other. We will still have exclusivity as the instance names and configs are different for each distributed object. - Exposing env variable to override the cluster name depending on the env it is run on. - Modified test cases to validate the cluster names as well Issue-ID: CPS-1637 Change-Id: Ib0f8c80dc9b2268f976b0c2d3ccd6d64792d4781 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-04-24Extend capability of distributed cachempriyank2-1/+34
- Extend cache configs to be able to work in stanalone mode as well as in cluster mode in kubernetes. - Expose the parameters to enable or disable the feature. - to make it work in standalone mode autodiscovery config will take care , and to run it on kubernetes enable the kubernetes option and provide the service name property. Issue-ID: CPS-1637 Change-Id: I704c4aa11e65b17b5be80048e4246079014d8bb7 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2023-03-21Query data nodes across all anchors under one dataspacerajesh.kumar2-0/+46
Issue-ID: CPS-1396 Change-ID: I73f97f986a817d423f93a8d922dcd9647b1412ab Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2023-03-20CPS-1526 Fix response message for PATCH operationarpitsingh1-0/+11
- Fixed the Response code and message when trying to update multiple data trees at once - Response code changed to 400 - Since the patch operation across multiple data trees is not supported when xpath is set to root node xpath, appropriate message is returned in response - Existing functionality of updating one data node with root node xpath remains as it is. - Updated API documentation and release notes Issue-ID: CPS-1526 Signed-off-by: arpitsingh <as00745003@techmahindra.com> Change-Id: I5d25a06bb5d407316ccfb2f85877cbe56a9f6f31
2023-03-14Reduce dataspace/anchor lookups in CpsDataServicedanielhanrahan3-28/+29
- Use Anchor object instead of names in processDataUpdatedEventAsync - Use Anchor object instead of names in buildDataNodes - Avoid unnecessary ArrayList copy in updateDataNodesAndDescendants Issue-ID: CPS-1536 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I46936a655a3d151357e55b68e1c4161e07100e84
2023-02-27Expand CPS Service Integration Test (framework)ToineSiebelink2-11/+23
- Created package structure - Created several test bases - Created complete test set for Admin service - Created first test for Data service - Added human-readable toString() to FetchDescendantsOption for test reporting and debuging purposes - Renamed fetch descendants (enum) direct children option for consistency with others options - TODO: Add sample performance test (and base) Issue-ID: CPS-475 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I75317686161be41662b6bf81314a9cd425ddd6eb
2023-02-20Merge "CPS-1401 Implement V2 of GET Data Node API"Luke Gleeson2-9/+24
2023-02-17CPS-1401 Implement V2 of GET Data Node APIarpitsingh2-9/+24
- Modified the GET Data Node API so it returns all the data nodes when xpath set to root "/" - Fragment Repository now returns a collection of Fragment Entities - Instead of returning only the first Fragment Entity now all fragment entities are returned when xpath is set to root - The Fragemnt Entities are further processed to a Collection of Data Nodes. As opposed to singular Data Node in current implementation. - Finally the DataRestController also returns a Collection of Data Nodes when xpath is set to root and valid data is present - Response body changed from JSON object to JSON Array. - Exception handling for invalid xpath and non-existing xpath is now done separately at persistence layer. - Refactored code against CPS-1422 - Deprecated getDataNode method from Service and Persistence layer - Modified V1 of Get Data Node API to use the getDataNodes method and get the first data node from the collection returned. - Modified NCMP to use getDataNodes method - NCMP still does not support multiple data nodes. It retrieves the first data node from the collection returned by getDataNodes Signed-off-by: arpitsingh <as00745003@techmahindra.com> Change-Id: I494a5740a53f65376d135fcb9f1e2e8900a2803e
2023-02-16Improve batch delete schemasets performancedanielhanrahan3-5/+42
- Bulk delete anchors and datanodes associated with schemasets. Improves de-registration performance by approx 10% Issue-ID: CPS-1423 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ie38e8b4c64356bf5935d8c7a5d3f5bfa73fb1714
2023-02-15Bulk delete schemasets in CM handle deregistrationdanielhanrahan1-0/+22
- Batch delete schema sets in single query - Call deleteUnusedYangResourceModules once per batch, not per CM handle - Results for deregistering 10k: 14 mins before; 6 mins after Issue-ID: CPS-1423 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: Ia3a86a0dc88677323e2f386253a99022a7f02603
2023-02-01Create plural version of deleteDataNodedanielhanrahan1-0/+13
- Add method to CpsDataService to batch delete data nodes and lists - Use native queries to batch delete fragment entities by xpaths, for data nodes and lists - Add performance tests for batch delete - Refactor FragmentNativeRepository - Add single-column version of createTemporaryTable - Renamed metric cps.data.service.datanode.batch.delete to cps.data.service.datanode.all.delete Issue-ID: CPS-1438 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I1851f9c7ef0b1be4bd421b3352d9697a2dd23f79
2023-01-31Introduce InstrumentationToineSiebelink3-7/+17
- Add instrumentation related dependency - Added Timed Instrumentation - CPS-Service Crud methods - CPS Yang parsing - NCMP Registration methods - NCMP Events handling - Remove manual Gauge for YanResources Cache as (better!) instrumentation is already built into the 3PP - Sorted dependecies alphabetically (as we used to enforce, to prevent duplicates) - Added ## P E R F O R M A N C E T E S T R E S U L T S ### mini report - (unrelated) test improvement (because of bug that turned out to be invalid) Reviewers: Sourabh,Priyank, Luke Issue-ID: CPS-1457 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: I34b20bece2f59488b022b8effa9470704c57be4d
2023-01-23Added depth parameter in query nodes API.rajesh.kumar2-2/+19
Issue-ID: CPS-1381 Change-ID: I73f97f986a817d423f93a8d922dcd9647b1206bb Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-12-22Merge "XML content on create anchors node support"Toine Siebelink6-16/+200
2022-12-22XML content on create anchors node supportMichal Jagiello6-16/+200
Add XML content type support on anchor node creation. Issue-ID: CPS-1257 Change-Id: I7e7a9a1961b6e81de93a4e32e842b47f8a163a09 Signed-off-by: Michal Jagiello <michal.jagiello@t-mobile.pl> Signed-off-by: Lee Anjella Macabuhay <lee.anjella.macabuhay@est.tech>
2022-12-22Add fix for posting nodes with xPath with '/'emaclee2-5/+5
- YangUtils method changed from using REGEX to cps path parser - unit test added for cps path util Issue-ID: CPS-1433 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ibb9efdd09423f9bade4a4a557d7d9ed49aa44ef4
2022-12-15CPS-341 Support for multiple data tree instances under 1 anchorarpitsingh6-65/+101
- Updated the parseJsonData method so it can parse JSON with multiple data trees, now it returns a ContainerNode - ContainerNode holds a collection of NormalizedNodes - Updated DataNodeBuilder and FragmentRepository as well to support collection of NormalizedNodes - Added new methods in CpsDataPersistenceService to store multiple Data Nodes - Added new test cases - Updated existing test cases and fixed code coverage - Addressed comments from previous patch Issue-ID: CPS-341 Change-Id: Ie893e91c0fbfb139a1a406e962721b0f52412ced Signed-off-by: arpitsingh <as00745003@techmahindra.com>
2022-12-13Merge "Fixing SonarQube violations"Toine Siebelink1-1/+1
2022-12-12Fix DataNodeBuilder for ChoiceNodesLena Peuker3-0/+54
Fix implemented to handle YangChoiceNode in right format Issue-ID: CPS-1352 Signed-off-by: Lena Peuker <PeukerL@telekom.de> Change-Id: I48d433bac96cfc647bc31c82817870995bace860
2022-12-12Fixing SonarQube violationsleventecsanyi1-1/+1
- Code smell fixes Signed-off-by: leventecsanyi <levente.csanyi@est.tech> Issue-ID: CPS-475 Change-Id: I4b47ece82aed7e4b31aaa28e601e419fb6f06718
2022-12-09Merge "Added API to get all schema sets for a given dataspace."Toine Siebelink1-0/+22
2022-12-09Added API to get all schema sets for a given dataspace.rajesh.kumar1-0/+22
Issue-ID: CPS-1187 Change-ID: I73f97f986a817d423f93a8d922dcd9647b0914aa Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-12-06Merge "Upgrade Open daylight yang tool to version 8.0.6"Toine Siebelink2-7/+7
2022-12-06Upgrade Open daylight yang tool to version 8.0.6emaclee2-7/+7
- changed classes according to upgrade of yang tool - changed methods in YangUtils class to accomodate change for jSonParserStream method - updated unit tests for the upgrade Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ib62fe424150ed0695eed168e1ae21f4d9a61cdf4
2022-12-01Filter on private properties of CM Handlesleventecsanyi1-121/+0
- Moved cm handle query validation to cps-ncmp-service (where it belongs!) - Added new enum type for private/public field types - Created new methods for private and public queries - Added new REST endpoint - Created service methods for filtering on different types of properties - Refactored getPublicPropertyPairs and queryCmHandleAnyProperties - Added unit test for the controller layer - Fixed refactoring suggestions - Imporved code coverage with unit tests - Refactoring - Added new functionality to NcmpRestInputMapper - Updated version number to 3.2.1-SNAPSHOT and updated release-notes.rst Issue-ID: CPS-1236 Change-Id: I0ddf6866473f7c3c6b8507d222d441bf97ca6bdc Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2022-11-18Added get APIs for dataspace.rajesh.kumar1-0/+18
Issue-ID: CPS-1186 Change-ID: I73f97f986a817d423f93a8d922dcd9647b0829aa Signed-off-by: rajesh.kumar <rk00747546@techmahindra.com>
2022-11-11Temporary registry updatempriyank1-1/+1
- temporarily updating the registry to test the failing tests. Issue-ID: CPS-1360 Change-Id: I7e303bb72b3f87565e27bcca7b1d9f5afc2b1417 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-11-08Node API - GET Method performance issuesourabh_sourabh1-2/+2
- Modified toDataNode call based on fetch descendants option. - Used fragment extract to build fragment entity. - Modified data set to have correct parent id for descendants. Reviewers : Toine, Priyank and Joe Issue-ID: CPS-1171 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech> Change-Id: I27a537fe72dd396722e6cfde7d8c454ed2579ec0 Signed-off-by: sourabh_sourabh <sourabh.sourabh@est.tech>
2022-11-02Ensure prefix is correct module prefixToineSiebelink7-11/+221
- Moved Prefix logic from RI to Service layer - Prefix is no PREFIX propety, not the moduel name! == RI (DB Layer) Changes - Removed prefix logic incl hazelcast - Added new basic ri-test for getDataNode and assert prefix is null - Updated exsiting ri-test to us getDataNode - Updated existing ri-test to only use " where really needed == CPS Service Layer Changes - Introduced PrefixResolver with clear and limited responsibility - Use PrefixResolver where needed - Cache prefix map per anchor, use cached entry when available - Disabled SONAR on new Regex == REST Layer - Use PrefixResolver where needed Issue-ID: CPS-1353 Signed-off-by: ToineSiebelink <toine.siebelink@est.tech> Change-Id: Ie16f0e1ee1c280f3eb69c9e64fab69a780fb692a
2022-10-20CPS Validator Changeslukegleeson7-488/+115
Changed CPS Validator from static to non-static Moved CPSValidator implementation to rest interface layer to prevent duplicated usage Created CPSValidator interface in persistence layer Removed unnecessary tests Refactored misplaced tests Copyright fixes Copyright Check Script output formatting fix Issue-ID: CPS-1228 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I4c99a51870e7d3b8e416bc1f909aeed5dc3baa42
2022-10-19Improve code coverageleventecsanyi2-2/+20
- Fixed and refactored unit test to get over the 97% coverage baseline. - Removed unused exception. Issue-ID: CPS-475 Change-Id: I6dbcba58b880a584f6d9346e2aca6c763e5d2081 Signed-off-by: leventecsanyi <levente.csanyi@est.tech>
2022-10-13Merge "Fix Id-searches endpoint performance degradation"Toine Siebelink3-3/+78
2022-10-12Fix Id-searches endpoint performance degradationkissand3-3/+78
- create more flexible control over fetch descendants - add a new FETCH_DIRECT_CHILDREN_ONLY option to fetch descendants options - enabel create custom fetch descendants option Reviewer: Toine, Joe, Priyank Issue-ID: CPS-1216 Change-Id: I900b32e813367aa9566c1dec986b20f009d27203 Signed-off-by: kissand <andras.zoltan.kiss@est.tech>
2022-10-04Tests added for multiple data tree analysisemaclee4-0/+122
**this commit is for analysis purposes only, not for merge - add unit test for gson JSONreader - add unit test for ODL JsonParserStream Issue-ID: CPS-1286 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Ia4a8c3e36f83b4cd857b4ff20f6a37e418ffd2ec
2022-09-27Fix security bug in logslukegleeson1-18/+36
When a method with signature containing "AuthPassword" is passed, the value returned is changed to *********** in logs e.g... Execution time of : DmiProperties.getAuthPassword() with argument[s] = *********** ... Legacy code cleaning also included Issue-ID: CPS-1226 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: Ic4914eae7e5ed6d361287413d17abfe50a3788ae
2022-09-20Merge "Xpath to NodeId invalid"aditya puthuparambil1-0/+12
2022-09-12Handle partial failurempriyank1-1/+1
- Removing the transaction boundaries as it was getting rollbacked on partial failures - Handled adding the elements in batch and if it fails try them individually - Refactored code a bit and when there is partial failure we try one more time in sequence and even if there are failures we collect the failures Issue-ID: CPS-1232 Issue-ID: CPS-1126 Change-Id: I7824c9f37f80cbaeedd5dc06d598ca0e3a69c59b Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-09-06Xpath to NodeId invalidGandhapu, Yashwanth1-0/+12
Issue-ID: CPS-1244 Signed-off-by: Gandhapu, Yashwanth <gandhapu.yashwanth@wipro.com> Change-Id: Ib091de1247cb0bb48d3157bf2c5becfc9189b773
2022-09-01Implement merging all ncmp datastore endpoints into onebmiklos1-14/+0
- Merging all endpoints under /v1/ch/{cm-handle}/data/ds/ncmp-datastore:* to /v1/ch/{cm-handle}/data/ds/{ncmp-datastore-name} - Implementing missing tests from parent - Introducing abstract class to keep the common code and just pass in the supplier to be executed in sync or async manner - Removed the existing get endpoints for passthrough-running, passthrough-operational and operational and merged them into a common get endpoint Issue-ID: CPS-1178 Issue-ID: CPS-1001 Change-Id: I6956c81d5acfa8fb11217bcc16cb795b62070fa3 Signed-off-by: bmiklos <miklos.baranyak@est.tech>
2022-08-29Performance Improvement:save cmhandles capabilitympriyank1-0/+21
- add saveCmHandleBatch in InventoryPersistence - add saveListElementsBatch in CpsDataService - have addListElementsBatch in CpsDataPersistenceService - Test scenarios for the same Issue-ID: CPS-1229 Issue-ID: CPS-1126 Change-Id: I0a1401818da5a4e523d7d0751cac6a526d1611b2 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-08-25Performance Improvement: Batch Update DataNodeslukegleeson1-6/+39
Implemented methods to perform a batch operation on updating datanodes Refactored replace data node(s) tree methods to update data node(s) and descendants Issue-ID: CPS-1203 Signed-off-by: lukegleeson <luke.gleeson@est.tech> Change-Id: I365d657422b19c9ce384110c9a23d041eaed06f4
2022-08-19Performance Improvement: Temporal eventmpriyank2-37/+48
- Call the admin service in the async pool thread to fetch the anchor details in case of raising event on save, update and delete a node or delete list elements - Admin service is still called in the main thread in case of DeleteNodes method as we require to have anchor as we are deleting all the anchors. - Fixed the test scenarios related to processing async event - Rearranged method formal params Issue-ID: CPS-1126 Issue-ID: CPS-1209 Change-Id: Ibd8f001c4d7c7de63914f6de24042aaf01a063b2 Signed-off-by: mpriyank <priyank.maheshwari@est.tech>
2022-08-11Get Node API fixputhuparambil.aditya1-4/+6
Issue-ID: CPS-1179 Signed-off-by: puthuparambil.aditya <aditya.puthuparambil@bell.ca> Change-Id: I1450ed5d05afd6dd30484eaf19b1e40fd586df8e
2022-07-29Query CmHandles using CPS pathlukegleeson1-0/+25
Added withCpsPath condition parameter Validated to prevent misuse and blocking of querying using private properties Updated OpenAPI with examples and links to documentation Moved methods related to cmHandle querying using cps path from InventoryPersistence to CmHandleQueries Renamed private method deleteSchemaSetAndListElementByCmHandleId to deleteCmHandleByCmHandleId Issue-ID: CPS-977 Change-Id: I83827215b7e58de74f8f62cd0140516d217d93f1 Signed-off-by: lukegleeson <luke.gleeson@est.tech>
2022-07-13Refactor unit test for Notification Error Handleremaclee1-7/+24
Issue-ID: CPS-1146 Signed-off-by: emaclee <lee.anjella.macabuhay@est.tech> Change-Id: Idd1c1236b9574c1d070c3dc4111ebcce8d800b23