From 98d5d20abfcf71f6c84fd42140283c012a58a205 Mon Sep 17 00:00:00 2001 From: ranim-n Date: Mon, 5 Aug 2024 16:53:17 +0200 Subject: [PATCH 1/4] feat: add test cases for observationSpace and operationSpace geospatial properties --- .../Entity/RetrieveEntity/018_08.robot | 49 +++++++++++++++++++ .../Entity/RetrieveEntity/018_09.robot | 49 +++++++++++++++++++ .../Entities/CreateEntity/001_12.robot | 42 ++++++++++++++++ .../Entities/CreateEntity/001_13.robot | 42 ++++++++++++++++ .../AppendEntityAttributes/010_08.robot | 47 ++++++++++++++++++ .../AppendEntityAttributes/010_09.robot | 47 ++++++++++++++++++ .../DeleteEntityAttribute/013_05.robot | 46 +++++++++++++++++ .../DeleteEntityAttribute/013_06.robot | 46 +++++++++++++++++ ...lding-observation-space-geoproperty.jsonld | 17 +++++++ ...uilding-operation-space-geoproperty.jsonld | 37 ++++++++++++++ ...vation-space-geoproperty-normalized.jsonld | 14 ++++++ ...vation-space-geoproperty-simplified.jsonld | 11 +++++ ...ration-space-geoproperty-normalized.jsonld | 34 +++++++++++++ ...ration-space-geoproperty-simplified.jsonld | 31 ++++++++++++ .../observation-space-fragment.json | 12 +++++ .../operation-space-fragment.json | 32 ++++++++++++ 16 files changed, 556 insertions(+) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot create mode 100644 data/entities/building-observation-space-geoproperty.jsonld create mode 100644 data/entities/building-operation-space-geoproperty.jsonld create mode 100644 data/entities/expectations/building-observation-space-geoproperty-normalized.jsonld create mode 100644 data/entities/expectations/building-observation-space-geoproperty-simplified.jsonld create mode 100644 data/entities/expectations/building-operation-space-geoproperty-normalized.jsonld create mode 100644 data/entities/expectations/building-operation-space-geoproperty-simplified.jsonld create mode 100644 data/entities/fragmentEntities/observation-space-fragment.json create mode 100644 data/entities/fragmentEntities/operation-space-fragment.json diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot new file mode 100644 index 00000000..7b90563d --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot @@ -0,0 +1,49 @@ +*** Settings *** +Documentation Check that an entity with observationSpace geospatial Property can be retrieved + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Initial Entity +Suite Teardown Delete Created Entity +Test Template Retrieve Entity With observationSpace Geospatial Property + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-observation-space-geoproperty.jsonld + + +*** Test Cases *** OPTIONS EXPECTATION_FILENAME +018_08_01 Simplified + [Tags] e-retrieve 6_3_7 4_7_1 since_v1.4.1 + keyValues building-observation-space-geoproperty-simplified.jsonld +018_08_02 Normalized + [Tags] e-retrieve 6_3_7 4_7_1 since_v1.4.1 + ${EMPTY} building-observation-space-geoproperty-normalized.jsonld + + +*** Keywords *** +Retrieve Entity With observationSpace Geospatial Property + [Documentation] Check that an entity with observationSpace geospatial Property can be retrieved + [Arguments] ${options} ${expectation_filename} + ${response}= Query Entity + ... id=${entity_id} + ... options=${options} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} + +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Created Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot new file mode 100644 index 00000000..5b095c94 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot @@ -0,0 +1,49 @@ +*** Settings *** +Documentation Check that an entity with operationSpace geospatial Property can be retrieved + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Initial Entity +Suite Teardown Delete Created Entity +Test Template Retrieve Entity With operationSpace Geospatial Property + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-operation-space-geoproperty.jsonld + + +*** Test Cases *** OPTIONS EXPECTATION_FILENAME +018_09_01 Simplified + [Tags] e-retrieve 6_3_7 4_7_1 since_v1.4.1 + keyValues building-operation-space-geoproperty-simplified.jsonld +018_09_02 Normalized + [Tags] e-retrieve 6_3_7 4_7_1 since_v1.4.1 + ${EMPTY} building-operation-space-geoproperty-normalized.jsonld + + +*** Keywords *** +Retrieve Entity With operationSpace Geospatial Property + [Documentation] Check that an entity with operationSpace geospatial Property can be retrieved + [Arguments] ${options} ${expectation_filename} + ${response}= Query Entity + ... id=${entity_id} + ... options=${options} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element ${expectation_filename} ${entity_id} ${response.json()} + +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${entity_id} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + +Delete Created Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot new file mode 100644 index 00000000..d2e04c77 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that one can create an entity with observationSpace geospatial Property + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Teardown Delete Entity + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-observation-space-geoproperty.jsonld + + +*** Test Cases *** +001_12 Create Entity + [Documentation] Check that one can create an entity with observationSpace geospatial Property + [Tags] e-create 5_6_1 4_7_1 since_v1.4.1 + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + + ${response}= Create Entity + ... ${filename} + ... ${entity_id} + + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${entity_id} ${response.headers} + ${created_entity}= Load Test Sample entities/${filename} ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... context=${ngsild_test_suite_context} + Check Created Resource Set To + ... created_resource=${created_entity} + ... response_body=${response1.json()} + + +*** Keywords *** +Delete Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot new file mode 100644 index 00000000..df19d4d9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot @@ -0,0 +1,42 @@ +*** Settings *** +Documentation Check that one can create an entity with operationSpace geospatial Property + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Teardown Delete Entity + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-operation-space-geoproperty.jsonld + + +*** Test Cases *** +001_13 Create Entity + [Documentation] Check that one can create an entity with operationSpace geospatial Property + [Tags] e-create 5_6_1 4_7_1 since_v1.4.1 + + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + + ${response}= Create Entity + ... ${filename} + ... ${entity_id} + + Check Response Status Code 201 ${response.status_code} + Check Response Headers Containing URI set to ${entity_id} ${response.headers} + ${created_entity}= Load Test Sample entities/${filename} ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... context=${ngsild_test_suite_context} + Check Created Resource Set To + ... created_resource=${created_entity} + ... response_body=${response1.json()} + + +*** Keywords *** +Delete Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot new file mode 100644 index 00000000..f7244fa0 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot @@ -0,0 +1,47 @@ +*** Settings *** +Documentation Check that one can append an observationSpace geospatial Property to an entity + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal.jsonld +${observation_space_fragment_filename}= observation-space-fragment.json +${expectation_filename}= building-observation-space-geoproperty-normalized.jsonld + + +*** Test Cases *** +010_08 Append observationSpace geospatial Property to an entity + [Documentation] Check that one can append an observationSpace geospatial Property to an entity + [Tags] ea-append 5_6_3 4_7_1 since_v1.4.1 + ${response}= Append Entity Attributes + ... ${entity_id} + ... ${observation_space_fragment_filename} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + ${response}= Create Entity + ... ${filename} + ... ${entity_id} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot new file mode 100644 index 00000000..c4c11711 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot @@ -0,0 +1,47 @@ +*** Settings *** +Documentation Check that one can append an operationSpace geospatial Property to an entity + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-minimal.jsonld +${operation_space_fragment_filename}= operation-space-fragment.json +${expectation_filename}= building-operation-space-geoproperty-normalized.jsonld + + +*** Test Cases *** +010_09 Append operationSpace geospatial Property to an entity + [Documentation] Check that one can append an operationSpace geospatial Property to an entity + [Tags] ea-append 5_6_3 4_7_1 since_v1.4.1 + ${response}= Append Entity Attributes + ... ${entity_id} + ... ${operation_space_fragment_filename} + ... ${CONTENT_TYPE_JSON} + Check Response Status Code 204 ${response.status_code} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... accept=${CONTENT_TYPE_JSON} + ... context=${ngsild_test_suite_context} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + ${response}= Create Entity + ... ${filename} + ... ${entity_id} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot new file mode 100644 index 00000000..b977f662 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check that one can delete an observationSpace geospatial Property from an entity + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-observation-space-geoproperty.jsonld +${expectation_filename}= building-minimal-compacted.json + + +*** Test Cases *** +013_05 Delete an observationSpace geospatial Property from an entity + [Documentation] Check that one can delete an observationSpace geospatial Property from an entity + [Tags] ea-delete 5_6_5 4_7_1 since_v1.4.1 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... observationSpace + ... ${EMPTY} + ... false + Check Response Status Code 204 ${response.status_code} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response}= Query Entity + ... id=${entity_id} + ... context=${ngsild_test_suite_context} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + ${response}= Create Entity + ... ${filename} + ... ${entity_id} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot new file mode 100644 index 00000000..cda5d61b --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check that one can delete an operationSpace geospatial Property from an entity + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-operation-space-geoproperty.jsonld +${expectation_filename}= building-minimal-compacted.json + + +*** Test Cases *** +013_05 Delete an operationSpace geospatial Property from an entity + [Documentation] Check that one can delete an operationSpace geospatial Property from an entity + [Tags] ea-delete 5_6_5 4_7_1 since_v1.4.1 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... operationSpace + ... ${EMPTY} + ... false + Check Response Status Code 204 ${response.status_code} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response}= Query Entity + ... id=${entity_id} + ... context=${ngsild_test_suite_context} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + ${response}= Create Entity + ... ${filename} + ... ${entity_id} + Check Response Status Code 201 ${response.status_code} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/data/entities/building-observation-space-geoproperty.jsonld b/data/entities/building-observation-space-geoproperty.jsonld new file mode 100644 index 00000000..b276a083 --- /dev/null +++ b/data/entities/building-observation-space-geoproperty.jsonld @@ -0,0 +1,17 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "observationSpace": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-operation-space-geoproperty.jsonld b/data/entities/building-operation-space-geoproperty.jsonld new file mode 100644 index 00000000..64d7a528 --- /dev/null +++ b/data/entities/building-operation-space-geoproperty.jsonld @@ -0,0 +1,37 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "operationSpace": { + "type": "GeoProperty", + "value": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.12, + 0.23 + ], + [ + 101.12, + 0.23 + ], + [ + 101.12, + 1.23 + ], + [ + 100.12, + 1.23 + ], + [ + 100.12, + 0.23 + ] + ] + ] + } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/expectations/building-observation-space-geoproperty-normalized.jsonld b/data/entities/expectations/building-observation-space-geoproperty-normalized.jsonld new file mode 100644 index 00000000..c11feb29 --- /dev/null +++ b/data/entities/expectations/building-observation-space-geoproperty-normalized.jsonld @@ -0,0 +1,14 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "observationSpace": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + } +} \ No newline at end of file diff --git a/data/entities/expectations/building-observation-space-geoproperty-simplified.jsonld b/data/entities/expectations/building-observation-space-geoproperty-simplified.jsonld new file mode 100644 index 00000000..828675a1 --- /dev/null +++ b/data/entities/expectations/building-observation-space-geoproperty-simplified.jsonld @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "observationSpace": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } +} \ No newline at end of file diff --git a/data/entities/expectations/building-operation-space-geoproperty-normalized.jsonld b/data/entities/expectations/building-operation-space-geoproperty-normalized.jsonld new file mode 100644 index 00000000..be26fcba --- /dev/null +++ b/data/entities/expectations/building-operation-space-geoproperty-normalized.jsonld @@ -0,0 +1,34 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "operationSpace": { + "type": "GeoProperty", + "value": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.12, + 0.23 + ], + [ + 101.12, + 0.23 + ], + [ + 101.12, + 1.23 + ], + [ + 100.12, + 1.23 + ], + [ + 100.12, + 0.23 + ] + ] + ] + } + } +} \ No newline at end of file diff --git a/data/entities/expectations/building-operation-space-geoproperty-simplified.jsonld b/data/entities/expectations/building-operation-space-geoproperty-simplified.jsonld new file mode 100644 index 00000000..d7d24168 --- /dev/null +++ b/data/entities/expectations/building-operation-space-geoproperty-simplified.jsonld @@ -0,0 +1,31 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "operationSpace": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.12, + 0.23 + ], + [ + 101.12, + 0.23 + ], + [ + 101.12, + 1.23 + ], + [ + 100.12, + 1.23 + ], + [ + 100.12, + 0.23 + ] + ] + ] + } +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/observation-space-fragment.json b/data/entities/fragmentEntities/observation-space-fragment.json new file mode 100644 index 00000000..cc9bde0b --- /dev/null +++ b/data/entities/fragmentEntities/observation-space-fragment.json @@ -0,0 +1,12 @@ +{ + "observationSpace": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [ + 13.3986, + 52.5547 + ] + } + } +} \ No newline at end of file diff --git a/data/entities/fragmentEntities/operation-space-fragment.json b/data/entities/fragmentEntities/operation-space-fragment.json new file mode 100644 index 00000000..399db52d --- /dev/null +++ b/data/entities/fragmentEntities/operation-space-fragment.json @@ -0,0 +1,32 @@ +{ + "operationSpace": { + "type": "GeoProperty", + "value": { + "type": "Polygon", + "coordinates": [ + [ + [ + 100.12, + 0.23 + ], + [ + 101.12, + 0.23 + ], + [ + 101.12, + 1.23 + ], + [ + 100.12, + 1.23 + ], + [ + 100.12, + 0.23 + ] + ] + ] + } + } +} \ No newline at end of file -- GitLab From b461acce62444869b5f0cb6941167c59015e62ec Mon Sep 17 00:00:00 2001 From: ranim-n Date: Tue, 6 Aug 2024 10:32:28 +0200 Subject: [PATCH 2/4] minor fixes in the tags --- .../Consumption/Entity/RetrieveEntity/018_08.robot | 4 ++-- .../Consumption/Entity/RetrieveEntity/018_09.robot | 4 ++-- .../Provision/Entities/CreateEntity/001_12.robot | 2 +- .../Provision/Entities/CreateEntity/001_13.robot | 2 +- .../EntityAttributes/AppendEntityAttributes/010_08.robot | 2 +- .../EntityAttributes/AppendEntityAttributes/010_09.robot | 2 +- .../EntityAttributes/DeleteEntityAttribute/013_05.robot | 2 +- .../EntityAttributes/DeleteEntityAttribute/013_06.robot | 2 +- 8 files changed, 10 insertions(+), 10 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot index 7b90563d..91b3ba08 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot @@ -18,10 +18,10 @@ ${filename}= building-observation-space-geoproperty.jsonld *** Test Cases *** OPTIONS EXPECTATION_FILENAME 018_08_01 Simplified - [Tags] e-retrieve 6_3_7 4_7_1 since_v1.4.1 + [Tags] e-retrieve 5_7_1 4_7 keyValues building-observation-space-geoproperty-simplified.jsonld 018_08_02 Normalized - [Tags] e-retrieve 6_3_7 4_7_1 since_v1.4.1 + [Tags] e-retrieve 5_7_1 4_7 ${EMPTY} building-observation-space-geoproperty-normalized.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot index 5b095c94..88fa7699 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot @@ -18,10 +18,10 @@ ${filename}= building-operation-space-geoproperty.jsonld *** Test Cases *** OPTIONS EXPECTATION_FILENAME 018_09_01 Simplified - [Tags] e-retrieve 6_3_7 4_7_1 since_v1.4.1 + [Tags] e-retrieve 5_7_1 4_7 keyValues building-operation-space-geoproperty-simplified.jsonld 018_09_02 Normalized - [Tags] e-retrieve 6_3_7 4_7_1 since_v1.4.1 + [Tags] e-retrieve 5_7_1 4_7 ${EMPTY} building-operation-space-geoproperty-normalized.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot index d2e04c77..fb0c1369 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot @@ -17,7 +17,7 @@ ${filename}= building-observation-space-geoproperty.jsonld *** Test Cases *** 001_12 Create Entity [Documentation] Check that one can create an entity with observationSpace geospatial Property - [Tags] e-create 5_6_1 4_7_1 since_v1.4.1 + [Tags] e-create 5_6_1 4_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Test Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot index df19d4d9..3eaa2a4f 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot @@ -17,7 +17,7 @@ ${filename}= building-operation-space-geoproperty.jsonld *** Test Cases *** 001_13 Create Entity [Documentation] Check that one can create an entity with operationSpace geospatial Property - [Tags] e-create 5_6_1 4_7_1 since_v1.4.1 + [Tags] e-create 5_6_1 4_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Test Variable ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot index f7244fa0..8e74c852 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot @@ -20,7 +20,7 @@ ${expectation_filename}= building-observation-space-geoproper *** Test Cases *** 010_08 Append observationSpace geospatial Property to an entity [Documentation] Check that one can append an observationSpace geospatial Property to an entity - [Tags] ea-append 5_6_3 4_7_1 since_v1.4.1 + [Tags] ea-append 5_6_3 4_7 ${response}= Append Entity Attributes ... ${entity_id} ... ${observation_space_fragment_filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot index c4c11711..853f9724 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot @@ -20,7 +20,7 @@ ${expectation_filename}= building-operation-space-geoproperty *** Test Cases *** 010_09 Append operationSpace geospatial Property to an entity [Documentation] Check that one can append an operationSpace geospatial Property to an entity - [Tags] ea-append 5_6_3 4_7_1 since_v1.4.1 + [Tags] ea-append 5_6_3 4_7 ${response}= Append Entity Attributes ... ${entity_id} ... ${operation_space_fragment_filename} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot index b977f662..3a7162f8 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot @@ -19,7 +19,7 @@ ${expectation_filename}= building-minimal-compacted.json *** Test Cases *** 013_05 Delete an observationSpace geospatial Property from an entity [Documentation] Check that one can delete an observationSpace geospatial Property from an entity - [Tags] ea-delete 5_6_5 4_7_1 since_v1.4.1 + [Tags] ea-delete 5_6_5 4_7 ${response}= Delete Entity Attributes ... ${entity_id} ... observationSpace diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot index cda5d61b..a1170466 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot @@ -19,7 +19,7 @@ ${expectation_filename}= building-minimal-compacted.json *** Test Cases *** 013_05 Delete an operationSpace geospatial Property from an entity [Documentation] Check that one can delete an operationSpace geospatial Property from an entity - [Tags] ea-delete 5_6_5 4_7_1 since_v1.4.1 + [Tags] ea-delete 5_6_5 4_7 ${response}= Delete Entity Attributes ... ${entity_id} ... operationSpace -- GitLab From 117d0e9088ac5c39e9a8d332faa0dbad87fc113d Mon Sep 17 00:00:00 2001 From: ranim-n Date: Tue, 6 Aug 2024 17:12:33 +0200 Subject: [PATCH 3/4] added documentation of new test cases --- .../Entities/CreateEntity/001_12.robot | 11 ++-- .../Entities/CreateEntity/001_13.robot | 11 ++-- .../DeleteEntityAttribute/013_06.robot | 2 +- .../Consumption/018_08.json | 62 +++++++++++++++++++ .../Consumption/018_09.json | 62 +++++++++++++++++++ .../ContextInformation/Provision/001_12.json | 40 ++++++++++++ .../ContextInformation/Provision/001_13.json | 40 ++++++++++++ .../ContextInformation/Provision/010_08.json | 41 ++++++++++++ .../ContextInformation/Provision/010_09.json | 41 ++++++++++++ .../ContextInformation/Provision/013_05.json | 41 ++++++++++++ .../ContextInformation/Provision/013_06.json | 41 ++++++++++++ .../test_ContextInformation_Consumption.py | 14 +++++ .../test_ContextInformation_Provision.py | 42 +++++++++++++ 13 files changed, 437 insertions(+), 11 deletions(-) create mode 100644 doc/files/ContextInformation/Consumption/018_08.json create mode 100644 doc/files/ContextInformation/Consumption/018_09.json create mode 100644 doc/files/ContextInformation/Provision/001_12.json create mode 100644 doc/files/ContextInformation/Provision/001_13.json create mode 100644 doc/files/ContextInformation/Provision/010_08.json create mode 100644 doc/files/ContextInformation/Provision/010_09.json create mode 100644 doc/files/ContextInformation/Provision/013_05.json create mode 100644 doc/files/ContextInformation/Provision/013_06.json diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot index fb0c1369..7e462635 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot @@ -6,25 +6,26 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Teardown Delete Entity +Test Teardown Delete Initial Entity *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-observation-space-geoproperty.jsonld - +${content_type}= application/ld+json *** Test Cases *** -001_12 Create Entity +001_12 Create Entity With observationSpace Geospatial Property [Documentation] Check that one can create an entity with observationSpace geospatial Property [Tags] e-create 5_6_1 4_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Test Variable ${entity_id} - ${response}= Create Entity + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} + ... ${content_type} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${entity_id} ${response.headers} @@ -38,5 +39,5 @@ ${filename}= building-observation-space-geoproperty.jsonld *** Keywords *** -Delete Entity +Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot index 3eaa2a4f..c0334078 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot @@ -6,25 +6,26 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption. Resource ${EXECDIR}/resources/AssertionUtils.resource Resource ${EXECDIR}/resources/JsonUtils.resource -Test Teardown Delete Entity +Test Teardown Delete Initial Entity *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-operation-space-geoproperty.jsonld - +${content_type}= application/ld+json *** Test Cases *** -001_13 Create Entity +001_13 Create Entity With operationSpace Geospatial Property [Documentation] Check that one can create an entity with operationSpace geospatial Property [Tags] e-create 5_6_1 4_7 ${entity_id}= Generate Random Entity Id ${building_id_prefix} Set Test Variable ${entity_id} - ${response}= Create Entity + ${response}= Create Entity Selecting Content Type ... ${filename} ... ${entity_id} + ... ${content_type} Check Response Status Code 201 ${response.status_code} Check Response Headers Containing URI set to ${entity_id} ${response.headers} @@ -38,5 +39,5 @@ ${filename}= building-operation-space-geoproperty.jsonld *** Keywords *** -Delete Entity +Delete Initial Entity Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot index a1170466..4aa62543 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot @@ -17,7 +17,7 @@ ${expectation_filename}= building-minimal-compacted.json *** Test Cases *** -013_05 Delete an operationSpace geospatial Property from an entity +013_06 Delete an operationSpace geospatial Property from an entity [Documentation] Check that one can delete an operationSpace geospatial Property from an entity [Tags] ea-delete 5_6_5 4_7 ${response}= Delete Entity Attributes diff --git a/doc/files/ContextInformation/Consumption/018_08.json b/doc/files/ContextInformation/Consumption/018_08.json new file mode 100644 index 00000000..da24e296 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_08.json @@ -0,0 +1,62 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_08", + "test_objective": "Check that an entity with observationSpace geospatial Property can be retrieved", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.7, 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.7", + "5.7.1" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Entity With observationSpace Geospatial Property", + "Create Initial Entity", + "Delete Created Entity" + ], + "teardown": "Delete Created Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_08_01 Simplified", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_08_01", + "doc": "Check that an entity with observationSpace geospatial Property can be retrieved", + "tags": [ + "4_7", + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With observationSpace Geospatial Property", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-observation-space-geoproperty-simplified.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: options set to 'keyValues' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_08_02 Normalized", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_08_02", + "doc": "Check that an entity with observationSpace geospatial Property can be retrieved", + "tags": [ + "4_7", + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With observationSpace Geospatial Property", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-observation-space-geoproperty-normalized.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_08", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/018_09.json b/doc/files/ContextInformation/Consumption/018_09.json new file mode 100644 index 00000000..555900f4 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_09.json @@ -0,0 +1,62 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_09", + "test_objective": "Check that an entity with operationSpace geospatial Property can be retrieved", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.7, 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.7", + "5.7.1" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Entity With operationSpace Geospatial Property", + "Create Initial Entity", + "Delete Created Entity" + ], + "teardown": "Delete Created Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "018_09_01 Simplified", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_09_01", + "doc": "Check that an entity with operationSpace geospatial Property can be retrieved", + "tags": [ + "4_7", + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With operationSpace Geospatial Property", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-operation-space-geoproperty-simplified.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: options set to 'keyValues' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_09_02 Normalized", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_09_02", + "doc": "Check that an entity with operationSpace geospatial Property can be retrieved", + "tags": [ + "4_7", + "5_7_1", + "e-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With operationSpace Geospatial Property", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-operation-space-geoproperty-normalized.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_09", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_12.json b/doc/files/ContextInformation/Provision/001_12.json new file mode 100644 index 00000000..cbb978f1 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_12.json @@ -0,0 +1,40 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_12", + "test_objective": "Check that one can create an entity with observationSpace geospatial Property", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.7, 5.6.1", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.7", + "5.6.1" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial Entity" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_12 Create Entity With observationSpace Geospatial Property", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_12", + "doc": "Check that one can create an entity with observationSpace geospatial Property", + "tags": [ + "4_7", + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Header: Location containing $${entity_id} and\n Retrieve Entity by Id with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'created_entity' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-observation-space-geoproperty.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_12", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_13.json b/doc/files/ContextInformation/Provision/001_13.json new file mode 100644 index 00000000..d16cb863 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_13.json @@ -0,0 +1,40 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_13", + "test_objective": "Check that one can create an entity with operationSpace geospatial Property", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.7, 5.6.1", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.7", + "5.6.1" + ], + "pics_selection": "", + "keywords": [ + "Delete Initial Entity" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_13 Create Entity With operationSpace Geospatial Property", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_13", + "doc": "Check that one can create an entity with operationSpace geospatial Property", + "tags": [ + "4_7", + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Create Entity Selecting Content Type with Response Status Code set to 201 and\n Create Entity Selecting Content Type with Response Header: Location containing $${entity_id} and\n Retrieve Entity by Id with Check Created Resource Set To and\n Query Parameter: 'created_resource' set to 'created_entity' and\n Query Parameter: 'response_body' set to 'response1.json()' and\n Query Parameter: 'ignored_keys' set to '${None}' list of keys\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'POST'\n Request Header['Content-Type'] set to 'application/ld+json' and\n payload defined in file: 'building-operation-space-geoproperty.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_13", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_08.json b/doc/files/ContextInformation/Provision/010_08.json new file mode 100644 index 00000000..e87abdb6 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_08.json @@ -0,0 +1,41 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_08", + "test_objective": "Check that one can append an observationSpace geospatial Property to an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.7, 5.6.3", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.7", + "5.6.3" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Entity", + "Delete Initial Entity" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "010_08 Append observationSpace geospatial Property to an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_08", + "doc": "Check that one can append an observationSpace geospatial Property to an entity", + "tags": [ + "4_7", + "5_6_3", + "ea-append" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Append Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/AppendEntityAttributes", + "robotfile": "010_08", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_09.json b/doc/files/ContextInformation/Provision/010_09.json new file mode 100644 index 00000000..294e4627 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_09.json @@ -0,0 +1,41 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_09", + "test_objective": "Check that one can append an operationSpace geospatial Property to an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.7, 5.6.3", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.7", + "5.6.3" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Entity", + "Delete Initial Entity" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "010_09 Append operationSpace geospatial Property to an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_09", + "doc": "Check that one can append an operationSpace geospatial Property to an entity", + "tags": [ + "4_7", + "5_6_3", + "ea-append" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Append Entity Attributes with Response Status Code set to 204 and\n Append Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "http_verb": "GET", + "endpoint": "" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/AppendEntityAttributes", + "robotfile": "010_09", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/013_05.json b/doc/files/ContextInformation/Provision/013_05.json new file mode 100644 index 00000000..bfbebeec --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_05.json @@ -0,0 +1,41 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/013_05", + "test_objective": "Check that one can delete an observationSpace geospatial Property from an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.7, 5.6.5", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.7", + "5.6.5" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Entity", + "Delete Initial Entity" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "013_05 Delete an observationSpace geospatial Property from an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_05", + "doc": "Check that one can delete an observationSpace geospatial Property from an entity", + "tags": [ + "4_7", + "5_6_5", + "ea-delete" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity Attributes with Response Status Code set to 204 and\n Delete Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute", + "robotfile": "013_05", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/013_06.json b/doc/files/ContextInformation/Provision/013_06.json new file mode 100644 index 00000000..549f4305 --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_06.json @@ -0,0 +1,41 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/013_06", + "test_objective": "Check that one can delete an operationSpace geospatial Property from an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.7, 5.6.5", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.7", + "5.6.5" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Entity", + "Delete Initial Entity" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "013_06 Delete an operationSpace geospatial Property from an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_06", + "doc": "Check that one can delete an operationSpace geospatial Property from an entity", + "tags": [ + "4_7", + "5_6_5", + "ea-delete" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity Attributes with Response Status Code set to 204 and\n Delete Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute", + "robotfile": "013_06", + "error_while_autogenerating": "no error" +} \ No newline at end of file diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py index a4c28356..f6d79a18 100644 --- a/doc/tests/test_ContextInformation_Consumption.py +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -315,6 +315,20 @@ class TestCIConsumptions(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_018_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_018_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_021_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_01.json' diff --git a/doc/tests/test_ContextInformation_Provision.py b/doc/tests/test_ContextInformation_Provision.py index eb503a0f..338d13e6 100644 --- a/doc/tests/test_ContextInformation_Provision.py +++ b/doc/tests/test_ContextInformation_Provision.py @@ -308,6 +308,20 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_001_12(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_12.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_12.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_001_13(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_13.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_13.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_002_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/DeleteEntity/002_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/002_01.json' @@ -378,6 +392,20 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_010_08(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_08.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_08.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_08.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_010_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_09.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_013_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/013_01.json' @@ -406,6 +434,20 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_013_05(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_05.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/013_05.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_013_05.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_013_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/013_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_013_06.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_012_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/012_01.json' -- GitLab From a3f238f34733539c89913ae419e34a1bdad108ab Mon Sep 17 00:00:00 2001 From: ranim-n Date: Tue, 6 Aug 2024 17:33:39 +0200 Subject: [PATCH 4/4] fixed robotidy issues --- .../Provision/Entities/CreateEntity/001_12.robot | 3 ++- .../Provision/Entities/CreateEntity/001_13.robot | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot index 7e462635..d1357bca 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_12.robot @@ -12,7 +12,8 @@ Test Teardown Delete Initial Entity *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-observation-space-geoproperty.jsonld -${content_type}= application/ld+json +${content_type}= application/ld+json + *** Test Cases *** 001_12 Create Entity With observationSpace Geospatial Property diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot index c0334078..08bcaa12 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_13.robot @@ -12,7 +12,8 @@ Test Teardown Delete Initial Entity *** Variables *** ${building_id_prefix}= urn:ngsi-ld:Building: ${filename}= building-operation-space-geoproperty.jsonld -${content_type}= application/ld+json +${content_type}= application/ld+json + *** Test Cases *** 001_13 Create Entity With operationSpace Geospatial Property -- GitLab