b9d57cf14d1967b00d49c747b7fae33a61196cf7
[cps.git] /
1 /*
2  *  ============LICENSE_START=======================================================
3  *  Copyright (C) 2025 Nordix Foundation
4  *  ================================================================================
5  *  Licensed under the Apache License, Version 2.0 (the 'License');
6  *  you may not use this file except in compliance with the License.
7  *  You may obtain a copy of the License at
8  *
9  *        http://www.apache.org/licenses/LICENSE-2.0
10  *
11  *  Unless required by applicable law or agreed to in writing, software
12  *  distributed under the License is distributed on an 'AS IS' BASIS,
13  *  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  *  See the License for the specific language governing permissions and
15  *  limitations under the License.
16  *
17  *  SPDX-License-Identifier: Apache-2.0
18  *  ============LICENSE_END=========================================================
19  */
20
21 package org.onap.cps.integration.performance.ncmp
22
23 import org.onap.cps.integration.ResourceMeter
24 import org.onap.cps.integration.base.CpsIntegrationSpecBase
25
26 /**
27  * This test does not depend on common performance test data. Hence it just extends the integration spec base.
28  */
29 class AlternateIdPerfTest extends CpsIntegrationSpecBase {
30
31     def resourceMeter = new ResourceMeter()
32
33     def 'Alternate Id Lookup Performance.'() {
34         given: 'register 1,000 cm handles (with alternative ids)'
35             registerSequenceOfCmHandlesWithManyModuleReferencesButDoNotWaitForReady(DMI1_URL, 'tagA', 1000, 1)
36         when: 'perform a 1,000 lookups by alternate id'
37             resourceMeter.start()
38             (1..1000).each {
39                 networkCmProxyInventoryFacade.getNcmpServiceCmHandle("alt=${it}")
40             }
41             resourceMeter.stop()
42         then: 'record the result. Not asserted, just recorded in See https://lf-onap.atlassian.net/browse/CPS-2605'
43             println "*** CPS-2605 Execution time: ${resourceMeter.totalTimeInSeconds} ms"
44         cleanup: 'deregister test cm handles'
45             deregisterSequenceOfCmHandles(DMI1_URL, 1000, 1)
46     }
47 }