From: ToineSiebelink Date: Tue, 3 Jun 2025 11:16:35 +0000 (+0100) Subject: Clean up Groovy Graphs, part 1a, fixed NB comments X-Git-Url: https://gerrit.onap.org/r/gitweb?a=commitdiff_plain;h=153c88a689d0616fa511c20f2678c5466677c714;p=cps.git Clean up Groovy Graphs, part 1a, fixed NB comments Issue-ID: CPS-2814 Change-Id: I5e3909938946939c05c52cff3ebd96b1eaf499a6 Signed-off-by: ToineSiebelink --- diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy index 3da328e98d..2b3cdd9bbb 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/base/CpsPerfTestBase.groovy @@ -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 ##') diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy index 56b7977bb0..80ec56257e 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/UpdatePerfTest.groovy @@ -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.'() { diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/WritePerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/WritePerfTest.groovy index c624622b46..82c69248df 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/WritePerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/cps/WritePerfTest.groovy @@ -21,10 +21,10 @@ 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 { diff --git a/integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy b/integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy index e4379180c5..79bcfb1a0d 100644 --- a/integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy +++ b/integration-test/src/test/groovy/org/onap/cps/integration/performance/ncmp/CmHandleQueryPerfTest.groovy @@ -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 }