summaryrefslogtreecommitdiffstats
path: root/cps-ri/src/test/groovy
diff options
context:
space:
mode:
authordanielhanrahan <daniel.hanrahan@est.tech>2023-01-19 18:20:11 +0000
committerDaniel Hanrahan <daniel.hanrahan@est.tech>2023-01-24 10:24:09 +0000
commit4111a57d03f054b46fddf030730d2e42b2755233 (patch)
tree2c253dcb337ef052bb3f9b826316a419d84f76e8 /cps-ri/src/test/groovy
parenta9a9b6ccaee56d3622318215477798c79acd7586 (diff)
Handle root xpaths in getDataNodes
Issue-ID: CPS-1458 Signed-off-by: danielhanrahan <daniel.hanrahan@est.tech> Change-Id: I64abf97317afe4335c8d04169689ee1396e75860
Diffstat (limited to 'cps-ri/src/test/groovy')
-rwxr-xr-xcps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy6
-rw-r--r--cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy2
2 files changed, 6 insertions, 2 deletions
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy
index 6252fff56c..5f48469c01 100755
--- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy
+++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceServiceIntegrationSpec.groovy
@@ -20,6 +20,7 @@
* SPDX-License-Identifier: Apache-2.0
* ============LICENSE_END=========================================================
*/
+
package org.onap.cps.spi.impl
import com.fasterxml.jackson.databind.ObjectMapper
@@ -303,6 +304,7 @@ class CpsDataPersistenceServiceIntegrationSpec extends CpsPersistenceSpecBase {
assert results.size() == expectedResultSize
where: 'following parameters were used'
scenario | inputXpaths || expectedResultSize
+ '0 nodes' | [] || 0
'1 node' | ["/parent-200"] || 1
'2 unique nodes' | ["/parent-200", "/parent-201"] || 2
'3 unique nodes' | ["/parent-200", "/parent-201", "/parent-202"] || 3
@@ -314,6 +316,10 @@ class CpsDataPersistenceServiceIntegrationSpec extends CpsPersistenceSpecBase {
'existing and non-existing xpaths' | ["/parent-200", "/NO-XPATH", "/parent-201"] || 2
'invalid xpath' | ["INVALID XPATH"] || 0
'valid and invalid xpaths' | ["/parent-200", "INVALID XPATH", "/parent-201"] || 2
+ 'root xpath' | ["/"] || 7
+ 'empty (root) xpath' | [""] || 7
+ 'root and top-level xpaths' | ["/", "/parent-200", "/parent-201"] || 7
+ 'root and child xpaths' | ["/", "/parent-200/child-201"] || 8
}
@Sql([CLEAR_DATA, SET_DATA])
diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy
index 2346239dff..0407490274 100644
--- a/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy
+++ b/cps-ri/src/test/groovy/org/onap/cps/spi/performance/CpsDataPersistenceServicePerfTest.groovy
@@ -29,8 +29,6 @@ import org.onap.cps.spi.repository.FragmentRepository
import org.springframework.beans.factory.annotation.Autowired
import org.springframework.test.context.jdbc.Sql
-import java.util.concurrent.TimeUnit
-
import static org.onap.cps.spi.FetchDescendantsOption.INCLUDE_ALL_DESCENDANTS
import static org.onap.cps.spi.FetchDescendantsOption.OMIT_DESCENDANTS