From 96a2f7b1d9891d40cdeeaa657ee84af0d00dcc9b Mon Sep 17 00:00:00 2001 From: danielhanrahan Date: Tue, 4 Apr 2023 19:00:44 +0100 Subject: Migrate query tests to integration-test module #2 - Migrate some query tests to integration-test - Edit bookstore model to add integer leaf-list 'editions' - Lower cps-ri code coverage Issue-ID: CPS-1597 Signed-off-by: danielhanrahan Change-Id: If50bf15ad7d7f147448f6b60d464efc1cdc91005 --- .../CpsDataPersistenceQueryDataNodeSpec.groovy | 26 ---------------------- 1 file changed, 26 deletions(-) (limited to 'cps-ri/src') diff --git a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy index 8e5001774..5f8d1caf3 100644 --- a/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy +++ b/cps-ri/src/test/groovy/org/onap/cps/spi/impl/CpsDataPersistenceQueryDataNodeSpec.groovy @@ -37,32 +37,6 @@ class CpsDataPersistenceQueryDataNodeSpec extends CpsPersistenceSpecBase { static final String SET_DATA = '/data/cps-path-query.sql' - @Sql([CLEAR_DATA, SET_DATA]) - def 'Cps Path query using descendant anywhere with #scenario '() { - when: 'a query is executed to get a data node by the given cps path' - def result = objectUnderTest.queryDataNodes(DATASPACE_NAME, ANCHOR_FOR_SHOP_EXAMPLE, cpsPath, OMIT_DESCENDANTS) - then: 'the correct number of data nodes are retrieved' - result.size() == expectedXPaths.size() - and: 'xpaths of the retrieved data nodes are as expected' - for (int i = 0; i < result.size(); i++) { - assert result[i].getXpath() == expectedXPaths[i] - } - where: 'the following data is used' - scenario | cpsPath || expectedXPaths - 'fully unique descendant name' | '//categories[@code=2]' || ["/shops/shop[@id='1']/categories[@code='2']", "/shops/shop[@id='2']/categories[@code='1']", "/shops/shop[@id='2']/categories[@code='2']"] - 'descendant name match end of other node' | '//book' || ["/shops/shop[@id='1']/categories[@code='1']/book", "/shops/shop[@id='1']/categories[@code='2']/book"] - 'descendant with text condition on leaf' | '//book/title[text()="Chapters"]' || ["/shops/shop[@id='1']/categories[@code='2']/book"] - 'descendant with text condition case mismatch' | '//book/title[text()="chapters"]' || [] - 'descendant with text condition on int leaf' | '//book/price[text()="5"]' || ["/shops/shop[@id='1']/categories[@code='1']/book"] - 'descendant with text condition on leaf-list' | '//book/labels[text()="special offer"]' || ["/shops/shop[@id='1']/categories[@code='1']/book"] - 'descendant with text condition partial match' | '//book/labels[text()="special"]' || [] - 'descendant with text condition (existing) empty string' | '//book/labels[text()=""]' || ["/shops/shop[@id='1']/categories[@code='1']/book"] - 'descendant with text condition on int leaf-list' | '//book/editions[text()="2000"]' || ["/shops/shop[@id='1']/categories[@code='2']/book"] - 'descendant name match of leaf containing /' | '//categories/type[text()="text/with/slash"]' || ["/shops/shop[@id='1']/categories[@code='string/with/slash/']"] - 'descendant with text condition on leaf containing /' | '//categories[@code=\'string/with/slash\']' || ["/shops/shop[@id='1']/categories[@code='string/with/slash/']"] - 'descendant with text condition on leaf containing [' | '//book/author[@Address="String[with]square[bracket]"]'|| [] - } - @Sql([CLEAR_DATA, SET_DATA]) def 'Cps Path query using descendant anywhere with #scenario condition(s) for a container element.'() { when: 'a query is executed to get a data node by the given cps path' -- cgit 1.2.3-korg