Clean up Groovy Graphs, part 1a, fixed NB comments 66/141066/1
authorToineSiebelink <toine.siebelink@est.tech>
Tue, 3 Jun 2025 11:16:35 +0000 (12:16 +0100)
committerToineSiebelink <toine.siebelink@est.tech>
Tue, 3 Jun 2025 11:16:35 +0000 (12:16 +0100)
Issue-ID: CPS-2814
Change-Id: I5e3909938946939c05c52cff3ebd96b1eaf499a6
Signed-off-by: ToineSiebelink <toine.siebelink@est.tech>
integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy
integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy
integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/WritePerfTest.groovy
integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy

index 3da328e..2b3cdd9 100644 (file)
@@ -1,6 +1,6 @@
 /*
  *  ============LICENSE_START=======================================================
- *  Copyright (C) 2023-2024 Nordix Foundation
+ *  Copyright (C) 2023-2025 OpenInfra Foundation Europe. All rights reserved.
  *  Modifications Copyright (C) 2025 TechMahindra Ltd.
  *  ================================================================================
  *  Licensed under the Apache License, Version 2.0 (the 'License');
@@ -34,7 +34,7 @@ class CpsPerfTestBase extends PerfTestBase {
     static final def OPENROADM_DEVICES_PER_ANCHOR = 1000
     static final def OPENROADM_DATANODES_PER_DEVICE = 86
 
-    ResourceMeter resourceMeter = new ResourceMeter()
+    def resourceMeter = new ResourceMeter()
 
     def printTitle() {
         println('##                   C P S   P E R F O R M A N C E   T E S T   R E S U L T S                    ##')
index 56b7977..80ec562 100644 (file)
@@ -48,19 +48,19 @@ class UpdatePerfTest extends CpsPerfTestBase {
 
     def 'JVM warm up for update tests: #scenario.'() {
         given: 'replacement JSON for node containing list of device nodes'
-            def jsonData = '{ "openroadm-devices": ' + generateJsonForOpenRoadmDevices(startId, totalNodes, changeLeaves) + '}'
+            def jsonData = '{ "openroadm-devices": ' + generateJsonForOpenRoadmDevices(startId, numberOfNodesAfterUpdate, changeLeaves) + '}'
         when: 'the container node is updated'
             objectUnderTest.updateDataNodeAndDescendants(CPS_PERFORMANCE_TEST_DATASPACE, UPDATE_TEST_ANCHOR, '/', jsonData, now, ContentType.JSON)
         then: 'there are the expected number of total nodes'
-            assert totalNodes == countDataNodes('/openroadm-devices/openroadm-device')
+            assert numberOfNodesAfterUpdate == countDataNodes('/openroadm-devices/openroadm-device')
         where:
-            scenario                           | totalNodes | startId | changeLeaves
-            'Replace 0 nodes with 100'         | 100        | 1       | false
-            'Replace 100 using same data'      | 100        | 1       | false
-            'Replace 100 with new leaf values' | 100        | 1       | true
-            'Replace 100 with 100 new nodes'   | 100        | 101     | false
-            'Replace 50 existing and 50 new'   | 100        | 151     | true
-            'Replace 100 nodes with 0'         | 0          | 1       | false
+            scenario                           | startId | changeLeaves || numberOfNodesAfterUpdate
+            'Replace 0 nodes with 100'         | 1       | false        || 100
+            'Replace 100 using same data'      | 1       | false        || 100
+            'Replace 100 with new leaf values' | 1       | true         || 100
+            'Replace 100 with 100 new nodes'   | 101     | false        || 100
+            'Replace 50 existing and 50 new'   | 151     | true         || 100
+            'Replace 100 nodes with 0'         | 1       | false        || 0
     }
 
     def 'Replace single data node and descendants: #scenario.'() {
index c624622..82c6924 100644 (file)
 
 package org.onap.cps.integration.performance.cps
 
+import org.onap.cps.integration.performance.base.CpsPerfTestBase
 import org.onap.cps.utils.ContentType
 
 import java.time.OffsetDateTime
-import org.onap.cps.integration.performance.base.CpsPerfTestBase
 
 class WritePerfTest extends CpsPerfTestBase {
 
index e437918..79bcfb1 100644 (file)
@@ -21,7 +21,6 @@
 package org.onap.cps.integration.performance.ncmp
 
 import org.onap.cps.api.CpsQueryService
-import org.onap.cps.integration.ResourceMeter
 import org.onap.cps.integration.performance.base.NcmpPerfTestBase
 
 import java.util.stream.Collectors
@@ -32,7 +31,6 @@ import static org.onap.cps.api.parameters.FetchDescendantsOption.OMIT_DESCENDANT
 class CmHandleQueryPerfTest extends NcmpPerfTestBase {
 
     CpsQueryService objectUnderTest
-    ResourceMeter resourceMeter = new ResourceMeter()
 
     def setup() { objectUnderTest = cpsQueryService }