From ad9de341c0127d3d057ec2163d67733f70045e30 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sun, 11 Feb 2024 15:52:18 +0100 Subject: [PATCH 1/7] feat: add tests for LanguageProperty properties --- .../Entity/RetrieveEntity/018_07.robot | 62 +++++++++++++++++++ .../020_12.robot | 48 ++++++++++++++ .../Entities/CreateEntity/001_01.robot | 3 + .../AppendEntityAttributes/010_01.robot | 3 + .../PartialAttributeUpdate/012_04.robot | 54 ++++++++++++++++ .../building-language-property-sample.jsonld | 14 +++++ ...nguage-property-sub-property-sample.jsonld | 18 ++++++ ...erty-any-language-filter-simplified.jsonld | 13 ++++ ...nguage-property-any-language-filter.jsonld | 14 +++++ ...guage-property-fr-filter-simplified.jsonld | 8 +++ ...uilding-language-property-fr-filter.jsonld | 12 ++++ ...anguage-property-update-expectation.jsonld | 22 +++++++ ...guage-property-appended-expectation.jsonld | 47 ++++++++++++++ ...building-language-property-fragment.jsonld | 13 ++++ ...icle-new-language-property-fragment.jsonld | 12 ++++ ...temporal-representation-expectation.jsonld | 33 ++++++++++ ...temporal-representation-expectation.jsonld | 32 ++++++++++ ...erty-temporal-representation-sample.jsonld | 36 +++++++++++ doc/analysis/requests.py | 6 +- .../test_ContextInformation_Consumption.py | 14 +++++ .../test_ContextInformation_Provision.py | 7 +++ .../ContextInformationConsumption.resource | 3 + 22 files changed, 472 insertions(+), 2 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot create mode 100644 TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot create mode 100644 data/entities/building-language-property-sample.jsonld create mode 100644 data/entities/building-language-property-sub-property-sample.jsonld create mode 100644 data/entities/expectations/building-language-property-any-language-filter-simplified.jsonld create mode 100644 data/entities/expectations/building-language-property-any-language-filter.jsonld create mode 100644 data/entities/expectations/building-language-property-fr-filter-simplified.jsonld create mode 100644 data/entities/expectations/building-language-property-fr-filter.jsonld create mode 100644 data/entities/expectations/building-language-property-update-expectation.jsonld create mode 100644 data/entities/expectations/vehicle-language-property-appended-expectation.jsonld create mode 100644 data/entities/fragmentEntities/building-language-property-fragment.jsonld create mode 100644 data/entities/fragmentEntities/vehicle-new-language-property-fragment.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-language-property-normalized-temporal-representation-expectation.jsonld create mode 100644 data/temporalEntities/expectations/vehicle-language-property-simplified-temporal-representation-expectation.jsonld create mode 100644 data/temporalEntities/vehicle-language-property-temporal-representation-sample.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot new file mode 100644 index 00000000..9ffd1626 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot @@ -0,0 +1,62 @@ +*** Settings *** +Documentation Check that you can retrieve an entity using Language Filter + +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 Language Filter + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-language-property-sample.jsonld + + +*** Test Cases *** LANGUAGE_FILTER OPTIONS EXPECTATION_FILENAME +018_07_01 Retrieve an entity using a specific natural language + fr ${EMPTY} building-language-property-fr-filter.jsonld +018_07_02 Retrieve an entity using multiple natural languages with no ranked preference + fr-CH,fr ${EMPTY} building-language-property-fr-filter.jsonld +018_07_03 Retrieve an entity with any supported language + * ${EMPTY} building-language-property-any-language-filter.jsonld +018_07_04 Retrieve an entity using multiple natural languages with ranked preferences + fr-CH,fr;q=0.9,en;q=0.8,*;q=0.5 ${EMPTY} building-language-property-fr-filter.jsonld +018_07_05 Retrieve an entity using a specific natural language with simplified representation + fr keyValues building-language-property-fr-filter-simplified.jsonld +018_07_06 Retrieve an entity with any supported language with simplified representation + * keyValues building-language-property-any-language-filter-simplified.jsonld + + +*** Keywords *** +Retrieve Entity With Language Filter + [Documentation] Check that you can retrieve an entity using Language Filter + [Tags] e-retrieve 5_7_1 4_15 + [Arguments] ${language_filter} ${options} ${expectation_filename} + ${response}= Query Entity + ... id=${entity_id} + ... accept=${CONTENT_TYPE_LD_JSON} + ... context=${ngsild_test_suite_context} + ... options=${options} + ... lang=${language_filter} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing Entity element + ... ${expectation_filename} + ... ${entity_id} + ... ${response.json()} + ... ${True} + +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/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot new file mode 100644 index 00000000..df28add9 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation Check that you can retrieve the temporal evolution of an entity with a LanguageProperty property + +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Create Temporal Entity +Suite Teardown Delete Initial Temporal Entity +Test Template Retrieve Temporal Entity + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${vehicle_payload_file}= vehicle-language-property-temporal-representation-sample.jsonld + + +*** Test Cases *** REPRESENTATION EXPECTATION_FILENAME +020_12_01 Retrieve the normalized temporal representation of an entity with a LanguageProperty property + [Tags] te-retrieve 5_7_3 4_5_7 4_5_18 + ${EMPTY} vehicle-language-property-normalized-temporal-representation-expectation.jsonld +020_12_02 Retrieve the simplified temporal representation of an entity with a LanguageProperty property + [Tags] te-retrieve 5_7_3 4_5_9 4_5_18 + temporalValues vehicle-language-property-simplified-temporal-representation-expectation.jsonld + + +*** Keywords *** +Retrieve Temporal Entity + [Documentation] Check that you can retrieve the temporal evolution of an entity with a LanguageProperty property + [Arguments] ${representation} ${expectation_filename} + ${response}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... options=${representation} + ... context=${ngsild_test_suite_context} + Check Response Status Code 200 ${response.status_code} + Check Response Body Containing EntityTemporal element + ... ${expectation_filename} + ... ${temporal_entity_representation_id} + ... ${response.json()} + +Create Temporal Entity + ${temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity ${vehicle_payload_file} ${temporal_entity_representation_id} + Set Suite Variable ${temporal_entity_representation_id} + +Delete Initial Temporal Entity + Delete Temporal Representation Of Entity ${temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 140e3887..5f771a9a 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -27,6 +27,9 @@ ${building_id_prefix}= urn:ngsi-ld:Building: 001_01_04 EntityWithLocationAttribute [Tags] e-create 5_6_1 building-location-attribute-sample.jsonld application/ld+json +001_01_05 EntityWithLanguageProperty + [Tags] e-create 5_6_1 4_5_18 + building-language-property-sample.jsonld application/ld+json *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index c4192926..7ea35fd9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -21,6 +21,9 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld 010_01_02 Append entity attributes with different datasetid 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld +010_01_03 Append a LanguageProperty property + [Tags] ea-append 5_6_3 4_5_18 + 204 vehicle-new-language-property-fragment.jsonld vehicle-language-property-appended-expectation.jsonld *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot new file mode 100644 index 00000000..f0a621c2 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot @@ -0,0 +1,54 @@ +*** Settings *** +Documentation Check that you can perform a partial update on a LanguageProperty property + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Initiate Test Case +Test Teardown Delete Initial Entities +Test Template Update Attributes + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Building: +${filename}= building-language-property-sub-property-sample.jsonld +${status_code}= 204 + + +*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME +012_04_01 Check that you can partially update a LanguageProperty property + building-language-property-fragment.jsonld street building-language-property-update-expectation.jsonld + + +*** Keywords *** +Update Attributes + [Documentation] Check that you can perform a partial update on a LanguageProperty property + [Tags] ea-partial-update 5_6_4 4_5_18 + [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} + ${response}= Partial Update Entity Attributes + ... entityId=${entity_id} + ... attributeId=${attribute_id} + ... fragment_filename=${fragment_filename} + ... content_type=${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response.status_code} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} + ${ignored_attributes}= Create List @context + Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} ${ignored_attributes} + +Initiate Test Case + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + Set Test 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 Initial Entities + Delete Entity by Id ${entity_id} diff --git a/data/entities/building-language-property-sample.jsonld b/data/entities/building-language-property-sample.jsonld new file mode 100644 index 00000000..86f2fcb2 --- /dev/null +++ b/data/entities/building-language-property-sample.jsonld @@ -0,0 +1,14 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "street": { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + } + }, + "@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-language-property-sub-property-sample.jsonld b/data/entities/building-language-property-sub-property-sample.jsonld new file mode 100644 index 00000000..a790f482 --- /dev/null +++ b/data/entities/building-language-property-sub-property-sample.jsonld @@ -0,0 +1,18 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "street": { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + }, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "@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-language-property-any-language-filter-simplified.jsonld b/data/entities/expectations/building-language-property-any-language-filter-simplified.jsonld new file mode 100644 index 00000000..b5449922 --- /dev/null +++ b/data/entities/expectations/building-language-property-any-language-filter-simplified.jsonld @@ -0,0 +1,13 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "street": { + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + } + }, + "@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-language-property-any-language-filter.jsonld b/data/entities/expectations/building-language-property-any-language-filter.jsonld new file mode 100644 index 00000000..86f2fcb2 --- /dev/null +++ b/data/entities/expectations/building-language-property-any-language-filter.jsonld @@ -0,0 +1,14 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "street": { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + } + }, + "@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-language-property-fr-filter-simplified.jsonld b/data/entities/expectations/building-language-property-fr-filter-simplified.jsonld new file mode 100644 index 00000000..cb34cdcb --- /dev/null +++ b/data/entities/expectations/building-language-property-fr-filter-simplified.jsonld @@ -0,0 +1,8 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "street": "Grand Place", + "@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-language-property-fr-filter.jsonld b/data/entities/expectations/building-language-property-fr-filter.jsonld new file mode 100644 index 00000000..0857281e --- /dev/null +++ b/data/entities/expectations/building-language-property-fr-filter.jsonld @@ -0,0 +1,12 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "street": { + "type": "Property", + "value": "Grand Place", + "lang": "fr" + }, + "@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-language-property-update-expectation.jsonld b/data/entities/expectations/building-language-property-update-expectation.jsonld new file mode 100644 index 00000000..5e9e9bde --- /dev/null +++ b/data/entities/expectations/building-language-property-update-expectation.jsonld @@ -0,0 +1,22 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "street": { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "es": "Gran Lugar" + }, + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + }, + "source": { + "type": "Property", + "value": "Speedometer" + } + }, + "@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/vehicle-language-property-appended-expectation.jsonld b/data/entities/expectations/vehicle-language-property-appended-expectation.jsonld new file mode 100644 index 00000000..f8e79f9e --- /dev/null +++ b/data/entities/expectations/vehicle-language-property-appended-expectation.jsonld @@ -0,0 +1,47 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "brandName": { + "type": "Property", + "value": "Mercedes" + }, + "speed": [ + { + "type": "Property", + "source": { + "type": "Property", + "value": "Speedometer" + }, + "datasetId": "urn:ngsi-ld:Property:speedometer", + "value": 55 + }, + { + "type": "Property", + "source": { + "type": "Property", + "value": "GPS" + }, + "datasetId": "urn:ngsi-ld:Property:gpsBxyz123-speed", + "value": 54.5 + } + ], + "street": { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + } + }, + "isParked": { + "type": "Relationship", + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:Bob" + }, + "object": "urn:ngsi-ld:OffStreetParking:Downtown1", + "observedAt": "2017-07-29T12:00:04Z" + }, + "@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/fragmentEntities/building-language-property-fragment.jsonld b/data/entities/fragmentEntities/building-language-property-fragment.jsonld new file mode 100644 index 00000000..fabcc51e --- /dev/null +++ b/data/entities/fragmentEntities/building-language-property-fragment.jsonld @@ -0,0 +1,13 @@ +{ + "languageMap": { + "fr": "Grand Place", + "es": "Gran Lugar" + }, + "providedBy": { + "type": "Relationship", + "object": "urn:ngsi-ld:Person:JohnDoe" + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} diff --git a/data/entities/fragmentEntities/vehicle-new-language-property-fragment.jsonld b/data/entities/fragmentEntities/vehicle-new-language-property-fragment.jsonld new file mode 100644 index 00000000..5c18ad06 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-new-language-property-fragment.jsonld @@ -0,0 +1,12 @@ +{ + "street": { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + } + }, + "@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/temporalEntities/expectations/vehicle-language-property-normalized-temporal-representation-expectation.jsonld b/data/temporalEntities/expectations/vehicle-language-property-normalized-temporal-representation-expectation.jsonld new file mode 100644 index 00000000..de53dbde --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-language-property-normalized-temporal-representation-expectation.jsonld @@ -0,0 +1,33 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "street":[ + { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + }, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt", + "es": "Gran Mercado" + }, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Marché", + "nl": "Grote Markt", + "es": "Gran Lugar", + "it": "Grande Mercato" + }, + "observedAt":"2020-08-01T12:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-language-property-simplified-temporal-representation-expectation.jsonld b/data/temporalEntities/expectations/vehicle-language-property-simplified-temporal-representation-expectation.jsonld new file mode 100644 index 00000000..2cdd3d78 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-language-property-simplified-temporal-representation-expectation.jsonld @@ -0,0 +1,32 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "street": { + "type": "LanguageProperty", + "languageMaps": [ + [ + { + "languageMap": { + "fr": "Grand Place", "nl": "Grote Markt" + } + }, + "2020-08-01T12:03:00Z" + ], + [ + { + "languageMap": { + "fr": "Grand Place", "nl": "Grote Markt", "es": "Gran Mercado" } + }, + "2020-08-01T12:05:00Z" + ], + [ + { + "languageMap": { + "fr": "Grand Marché", "nl": "Grote Markt", "es": "Gran Lugar", "it": "Grande Mercato" + } + }, + "2020-08-01T12:07:00Z" + ] + ] + } +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-language-property-temporal-representation-sample.jsonld b/data/temporalEntities/vehicle-language-property-temporal-representation-sample.jsonld new file mode 100644 index 00000000..f436ecc3 --- /dev/null +++ b/data/temporalEntities/vehicle-language-property-temporal-representation-sample.jsonld @@ -0,0 +1,36 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "street":[ + { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt" + }, + "observedAt":"2020-08-01T12:03:00Z" + }, + { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Place", + "nl": "Grote Markt", + "es": "Gran Mercado" + }, + "observedAt":"2020-08-01T12:05:00Z" + }, + { + "type": "LanguageProperty", + "languageMap": { + "fr": "Grand Marché", + "nl": "Grote Markt", + "es": "Gran Lugar", + "it": "Grande Mercato" + }, + "observedAt":"2020-08-01T12:07:00Z" + } + ], + "@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/doc/analysis/requests.py b/doc/analysis/requests.py index 612d9a58..798f0bb9 100644 --- a/doc/analysis/requests.py +++ b/doc/analysis/requests.py @@ -30,7 +30,7 @@ class Requests: }, 'Query Entity': { 'positions': [], - 'params': ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options'] + 'params': ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options', 'lang'] }, 'Retrieve Subscription': { 'positions': [], @@ -675,7 +675,7 @@ class Requests: @staticmethod def query_entity(kwargs) -> str: - expected_parameters = ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options'] + expected_parameters = ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options', 'lang'] result = [x for x in kwargs if x not in expected_parameters] response = "Get Entity Request:" @@ -694,6 +694,8 @@ class Requests: response = f"{response} and\n Query Parameter: geoproperty set to '{value}'" case 'options': response = f"{response} and\n Query Parameter: options set to '{value}'" + case 'lang': + response = f"{response} and\n Query Parameter: lang set to '{value}'" case _: raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are " f"'{expected_parameters}', but received: {kwargs}") diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py index fc7bc65d..533026a1 100644 --- a/doc/tests/test_ContextInformation_Consumption.py +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -294,6 +294,13 @@ class TestCIConsumptions(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_018_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_018_07.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' @@ -461,3 +468,10 @@ class TestCIConsumptions(TestCase): difference_file = f'{self.folder_test_suites}/doc/results/out_020_10.json' self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_12(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_12.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_12.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/doc/tests/test_ContextInformation_Provision.py b/doc/tests/test_ContextInformation_Provision.py index 9159720b..961fcc0e 100644 --- a/doc/tests/test_ContextInformation_Provision.py +++ b/doc/tests/test_ContextInformation_Provision.py @@ -357,6 +357,13 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_012_04(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/012_04.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_012_04.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_011_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/UpdateEntityAttributes/011_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/011_01.json' diff --git a/resources/ApiUtils/ContextInformationConsumption.resource b/resources/ApiUtils/ContextInformationConsumption.resource index 6f3d9d02..423fa366 100755 --- a/resources/ApiUtils/ContextInformationConsumption.resource +++ b/resources/ApiUtils/ContextInformationConsumption.resource @@ -146,9 +146,11 @@ Query Entity ... ${context}=${EMPTY} ... ${geoproperty}=${EMPTY} ... ${options}=${EMPTY} + ... ${lang}=${EMPTY} ${attrs_length}= Get Length ${attrs} ${accept_length}= Get Length ${accept} ${options_length}= Get Length ${options} + ${lang_length}= Get Length ${lang} &{headers}= Create Dictionary &{params}= Create Dictionary IF ${accept_length}>0 @@ -166,6 +168,7 @@ Query Entity IF ${options_length}>0 Set To Dictionary ${params} options=${options} END + IF ${lang_length}>0 Set To Dictionary ${params} lang=${lang} ${response}= GET ... url=${url}/${ENTITIES_ENDPOINT_PATH}${id} -- GitLab From 31155838fe9908f9c51e034f5eb5c314ba474c68 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 12 Mar 2024 14:41:51 +0100 Subject: [PATCH 2/7] fix: declaration of tags in permutations --- .../EntityAttributes/AppendEntityAttributes/010_01.robot | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index 7ea35fd9..a3b7ffd9 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -18,8 +18,10 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME 010_01_01 Append entity attributes + [Tags] ea-append 5_6_3 204 vehicle-new-attribute-fragment.jsonld vehicle-speed-appended-expectation.jsonld 010_01_02 Append entity attributes with different datasetid + [Tags] ea-append 5_6_3 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld 010_01_03 Append a LanguageProperty property [Tags] ea-append 5_6_3 4_5_18 @@ -29,7 +31,6 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld *** Keywords *** Append Attributes Without Params [Documentation] Check that you can append entity attributes - [Tags] ea-append 5_6_3 [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} Check Response Status Code ${status_code} ${response.status_code} -- GitLab From 5d0099098feea028142f47063c26e31843a81b2b Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Mon, 18 Mar 2024 08:01:53 +0100 Subject: [PATCH 3/7] fix: add missing updates in generated JSON files --- .../Consumption/018_07.json | 124 ++++++++++++++++++ .../Consumption/020_12.json | 58 ++++++++ .../ContextInformation/Provision/001_01.json | 17 +++ .../ContextInformation/Provision/010_01.json | 25 +++- .../ContextInformation/Provision/012_04.json | 33 +++++ 5 files changed, 253 insertions(+), 4 deletions(-) create mode 100644 doc/files/ContextInformation/Consumption/018_07.json create mode 100644 doc/files/ContextInformation/Consumption/020_12.json create mode 100644 doc/files/ContextInformation/Provision/012_04.json diff --git a/doc/files/ContextInformation/Consumption/018_07.json b/doc/files/ContextInformation/Consumption/018_07.json new file mode 100644 index 00000000..5b5adaf9 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_07.json @@ -0,0 +1,124 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/018_07", + "test_objective": "Check that you can retrieve an entity using Language Filter", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.1", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_7_1", + "keywords": [ + "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_07_01 Retrieve an entity using a specific natural language", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_01", + "doc": "Check that you can retrieve an entity using Language Filter", + "tags": [ + "e-retrieve", + "5_7_1", + "4_15" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Language Filter", + "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-language-property-fr-filter.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: accept set to 'application/ld+json' 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\"' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: lang set to 'fr'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_07_02 Retrieve an entity using multiple natural languages with no ranked preference", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_02", + "doc": "Check that you can retrieve an entity using Language Filter", + "tags": [ + "e-retrieve", + "5_7_1", + "4_15" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Language Filter", + "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-language-property-fr-filter.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: accept set to 'application/ld+json' 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\"' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: lang set to 'fr-CH,fr'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_07_03 Retrieve an entity with any supported language", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_03", + "doc": "Check that you can retrieve an entity using Language Filter", + "tags": [ + "e-retrieve", + "5_7_1", + "4_15" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Language Filter", + "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-language-property-any-language-filter.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: accept set to 'application/ld+json' 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\"' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: lang set to '*'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_07_04 Retrieve an entity using multiple natural languages with ranked preferences", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_04", + "doc": "Check that you can retrieve an entity using Language Filter", + "tags": [ + "e-retrieve", + "5_7_1", + "4_15" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Language Filter", + "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-language-property-fr-filter.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: accept set to 'application/ld+json' 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\"' and\n Query Parameter: options set to '${EMPTY}' and\n Query Parameter: lang set to 'fr-CH,fr;q=0.9,en;q=0.8,*;q=0.5'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_07_05 Retrieve an entity using a specific natural language with simplified representation", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_05", + "doc": "Check that you can retrieve an entity using Language Filter", + "tags": [ + "e-retrieve", + "5_7_1", + "4_15" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Language Filter", + "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-language-property-fr-filter-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: accept set to 'application/ld+json' 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\"' and\n Query Parameter: options set to 'keyValues' and\n Query Parameter: lang set to 'fr'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + }, + { + "name": "018_07_06 Retrieve an entity with any supported language with simplified representation", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_06", + "doc": "Check that you can retrieve an entity using Language Filter", + "tags": [ + "e-retrieve", + "5_7_1", + "4_15" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Entity With Language Filter", + "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-language-property-any-language-filter-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: accept set to 'application/ld+json' 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\"' and\n Query Parameter: options set to 'keyValues' and\n Query Parameter: lang set to '*'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity", + "robotfile": "018_07" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_12.json b/doc/files/ContextInformation/Consumption/020_12.json new file mode 100644 index 00000000..ed66686b --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_12.json @@ -0,0 +1,58 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_12", + "test_objective": "Check that you can retrieve the temporal evolution of an entity with a LanguageProperty property", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 4.5.18", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_4_5_18", + "keywords": [ + "Create Temporal Entity", + "Delete Initial Temporal Entity" + ], + "teardown": "Delete Initial Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "020_12_01 Retrieve the normalized temporal representation of an entity with a LanguageProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_12_01", + "doc": "Check that you can retrieve the temporal evolution of an entity with a LanguageProperty property", + "tags": [ + "4_5_18", + "4_5_7", + "5_7_3", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-language-property-normalized-temporal-representation-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: options set to '${EMPTY}' 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": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_12_02 Retrieve the simplified temporal representation of an entity with a LanguageProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_12_02", + "doc": "Check that you can retrieve the temporal evolution of an entity with a LanguageProperty property", + "tags": [ + "4_5_18", + "4_5_9", + "5_7_3", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-language-property-simplified-temporal-representation-expectation.jsonld'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: options set to 'temporalValues' 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": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_12" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_01.json b/doc/files/ContextInformation/Provision/001_01.json index 0bfc084d..fadae114 100644 --- a/doc/files/ContextInformation/Provision/001_01.json +++ b/doc/files/ContextInformation/Provision/001_01.json @@ -78,6 +78,23 @@ "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-location-attribute-sample.jsonld'\n}", "http_verb": "POST", "endpoint": "entities/" + }, + { + "name": "001_01_05 EntityWithLanguageProperty", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_01_05", + "doc": "Check that you can create an entity", + "tags": [ + "4_5_18", + "5_6_1", + "e-create" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Create Entity Scenarios", + "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}'\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-language-property-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" } ], "permutations": [ diff --git a/doc/files/ContextInformation/Provision/010_01.json b/doc/files/ContextInformation/Provision/010_01.json index dea3aca0..ecb8c250 100644 --- a/doc/files/ContextInformation/Provision/010_01.json +++ b/doc/files/ContextInformation/Provision/010_01.json @@ -21,8 +21,8 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_01_01", "doc": "Check that you can append entity attributes", "tags": [ - "ea-append", - "5_6_3" + "5_6_3", + "ea-append" ], "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", @@ -37,8 +37,8 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_01_02", "doc": "Check that you can append entity attributes", "tags": [ - "ea-append", - "5_6_3" + "5_6_3", + "ea-append" ], "setup": "Create Initial Entity", "teardown": "Delete Initial Entity", @@ -47,6 +47,23 @@ "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-different-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "POST", "endpoint": "entities/{id}/attrs" + }, + { + "name": "010_01_03 Append a LanguageProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_01_03", + "doc": "Check that you can append entity attributes", + "tags": [ + "4_5_18", + "5_6_3", + "ea-append" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes Without Params", + "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 Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-new-language-property-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs" } ], "permutations": [ diff --git a/doc/files/ContextInformation/Provision/012_04.json b/doc/files/ContextInformation/Provision/012_04.json new file mode 100644 index 00000000..293d383b --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_04.json @@ -0,0 +1,33 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/012_04", + "test_objective": "Check that you can perform a partial update on a LanguageProperty property", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.4", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_5_6_4", + "keywords": [], + "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 and an attribute with an id set to ${atrId}\n}", + "test_cases": [ + { + "name": "012_04_01 Check that you can partially update a LanguageProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_04_01", + "doc": "Check that you can perform a partial update on a LanguageProperty property", + "tags": [ + "ea-partial-update", + "5_6_4", + "4_5_18" + ], + "setup": "Initiate Test Case", + "teardown": "Delete Initial Entities", + "template": "Update Attributes", + "then": "then {\n the SUT sends a valid Response for the operations:\n Partial Update Entity Attributes with Response Status Code set to 204 and\n Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{entityId}/attrs/{attributeId}'\n method set to 'PATCH'\n Request Partial Update Entity Attributes and\n Query Parameter: entityId set to '${entity_id}' and\n Query Parameter: AttributeId set to 'street' and\n Query Parameter: fragment_filename set to 'building-language-property-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "PATCH", + "endpoint": "entities/{entityId}/attrs/{attributeId}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate", + "robotfile": "012_04" +} \ No newline at end of file -- GitLab From 4c62a509f334c7e8a0d47b4646ce4bd748ab12cc Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Tue, 19 Mar 2024 10:29:16 +0100 Subject: [PATCH 4/7] separate permutations with different tags --- .../Entity/RetrieveEntity/018_07.robot | 7 ++- .../020_12.robot | 4 +- .../Entities/CreateEntity/001_01.robot | 3 -- .../Entities/CreateEntity/001_10.robot | 45 +++++++++++++++++ .../AppendEntityAttributes/010_01.robot | 3 -- .../AppendEntityAttributes/010_06.robot | 48 +++++++++++++++++++ .../PartialAttributeUpdate/012_04.robot | 2 +- .../ContextInformation/Provision/001_10.json | 34 +++++++++++++ .../ContextInformation/Provision/010_06.json | 34 +++++++++++++ .../test_ContextInformation_Provision.py | 14 ++++++ 10 files changed, 184 insertions(+), 10 deletions(-) create mode 100644 TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot create mode 100644 TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot create mode 100644 doc/files/ContextInformation/Provision/001_10.json create mode 100644 doc/files/ContextInformation/Provision/010_06.json diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot index 9ffd1626..1b7834dc 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot @@ -18,23 +18,28 @@ ${filename}= building-language-property-sample.jsonld *** Test Cases *** LANGUAGE_FILTER OPTIONS EXPECTATION_FILENAME 018_07_01 Retrieve an entity using a specific natural language + [Tags] e-retrieve 5_7_1 4_15 since_v1.4.1 fr ${EMPTY} building-language-property-fr-filter.jsonld 018_07_02 Retrieve an entity using multiple natural languages with no ranked preference + [Tags] e-retrieve 5_7_1 4_15 since_v1.4.1 fr-CH,fr ${EMPTY} building-language-property-fr-filter.jsonld 018_07_03 Retrieve an entity with any supported language + [Tags] e-retrieve 5_7_1 4_15 since_v1.4.1 * ${EMPTY} building-language-property-any-language-filter.jsonld 018_07_04 Retrieve an entity using multiple natural languages with ranked preferences + [Tags] e-retrieve 5_7_1 4_15 since_v1.4.1 fr-CH,fr;q=0.9,en;q=0.8,*;q=0.5 ${EMPTY} building-language-property-fr-filter.jsonld 018_07_05 Retrieve an entity using a specific natural language with simplified representation + [Tags] e-retrieve 5_7_1 4_15 since_v1.4.1 fr keyValues building-language-property-fr-filter-simplified.jsonld 018_07_06 Retrieve an entity with any supported language with simplified representation + [Tags] e-retrieve 5_7_1 4_15 since_v1.4.1 * keyValues building-language-property-any-language-filter-simplified.jsonld *** Keywords *** Retrieve Entity With Language Filter [Documentation] Check that you can retrieve an entity using Language Filter - [Tags] e-retrieve 5_7_1 4_15 [Arguments] ${language_filter} ${options} ${expectation_filename} ${response}= Query Entity ... id=${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot index df28add9..61bdf8df 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_12.robot @@ -18,10 +18,10 @@ ${vehicle_payload_file}= vehicle-language-property-temporal-representation-sa *** Test Cases *** REPRESENTATION EXPECTATION_FILENAME 020_12_01 Retrieve the normalized temporal representation of an entity with a LanguageProperty property - [Tags] te-retrieve 5_7_3 4_5_7 4_5_18 + [Tags] te-retrieve 5_7_3 4_5_7 4_5_18 since_v1.4.1 ${EMPTY} vehicle-language-property-normalized-temporal-representation-expectation.jsonld 020_12_02 Retrieve the simplified temporal representation of an entity with a LanguageProperty property - [Tags] te-retrieve 5_7_3 4_5_9 4_5_18 + [Tags] te-retrieve 5_7_3 4_5_9 4_5_18 since_v1.4.1 temporalValues vehicle-language-property-simplified-temporal-representation-expectation.jsonld diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot index 5f771a9a..140e3887 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_01.robot @@ -27,9 +27,6 @@ ${building_id_prefix}= urn:ngsi-ld:Building: 001_01_04 EntityWithLocationAttribute [Tags] e-create 5_6_1 building-location-attribute-sample.jsonld application/ld+json -001_01_05 EntityWithLanguageProperty - [Tags] e-create 5_6_1 4_5_18 - building-language-property-sample.jsonld application/ld+json *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot new file mode 100644 index 00000000..f038a369 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot @@ -0,0 +1,45 @@ +*** Settings *** +Documentation Check that you can create an entity with a LanguageProperty 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 Initial Entity +Test Template Create Entity Scenarios + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** FILENAME CONTENT_TYPE +001_10_01 EntityWithLanguageProperty + [Tags] e-create 5_6_1 4_5_18 since_v1.4.1 + building-language-property-sample.jsonld application/ld+json + + +*** Keywords *** +Create Entity Scenarios + [Documentation] Check that you can create an entity with a LanguageProperty property + [Arguments] ${filename} ${content_type} + ${entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Test Variable ${entity_id} + ${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} + ${created_entity}= Load Test Sample entities/${filename} ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... accept=${content_type} + ... context=${ngsild_test_suite_context} + Check Created Resource Set To + ... created_resource=${created_entity} + ... response_body=${response1.json()} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot index a3b7ffd9..4cab8706 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -23,9 +23,6 @@ ${filename}= vehicle-speed-two-datasetid-sample.jsonld 010_01_02 Append entity attributes with different datasetid [Tags] ea-append 5_6_3 204 vehicle-speed-different-datasetid-fragment.jsonld vehicle-speed-different-datasetid-expectation.jsonld -010_01_03 Append a LanguageProperty property - [Tags] ea-append 5_6_3 4_5_18 - 204 vehicle-new-language-property-fragment.jsonld vehicle-language-property-appended-expectation.jsonld *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot new file mode 100644 index 00000000..0a2628d0 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot @@ -0,0 +1,48 @@ +*** Settings *** +Documentation Check that you can append a LanguageProperty 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 +Test Template Append Attributes Without Params + + +*** Variables *** +${vehicle_id_prefix}= urn:ngsi-ld:Vehicle: +${filename}= vehicle-speed-two-datasetid-sample.jsonld + + +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME +010_06_01 Append a LanguageProperty property + [Tags] ea-append 5_6_3 4_5_18 since_v1.4.1 + 204 vehicle-new-language-property-fragment.jsonld vehicle-language-property-appended-expectation.jsonld + + +*** Keywords *** +Append Attributes Without Params + [Documentation] Check that you can append a LanguageProperty property to an entity + [Arguments] ${status_code} ${fragment_filename} ${expectation_filename} + ${response}= Append Entity Attributes ${entity_id} ${fragment_filename} ${CONTENT_TYPE_LD_JSON} + Check Response Status Code ${status_code} ${response.status_code} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response1}= Retrieve Entity by Id + ... id=${entity_id} + ... context=${ngsild_test_suite_context} + ... accept=${CONTENT_TYPE_LD_JSON} + Check Updated Resource Set To ${entity_expectation_payload} ${response1.json()} + +Create Initial Entity + ${entity_id}= Generate Random Entity Id ${vehicle_id_prefix} + ${response}= Create Entity Selecting Content Type + ... ${filename} + ... ${entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${response.status_code} + Set Suite Variable ${entity_id} + +Delete Initial Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot index f0a621c2..5a4c7f9e 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_04.robot @@ -19,13 +19,13 @@ ${status_code}= 204 *** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME 012_04_01 Check that you can partially update a LanguageProperty property + [Tags] ea-partial-update 5_6_4 4_5_18 since_v1.4.1 building-language-property-fragment.jsonld street building-language-property-update-expectation.jsonld *** Keywords *** Update Attributes [Documentation] Check that you can perform a partial update on a LanguageProperty property - [Tags] ea-partial-update 5_6_4 4_5_18 [Arguments] ${fragment_filename} ${attribute_id} ${expectation_filename} ${response}= Partial Update Entity Attributes ... entityId=${entity_id} diff --git a/doc/files/ContextInformation/Provision/001_10.json b/doc/files/ContextInformation/Provision/001_10.json new file mode 100644 index 00000000..8a017ccd --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_10.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_10", + "test_objective": "Check that you can create an entity with a LanguageProperty property", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 4.5.18", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_4_5_18", + "keywords": [], + "teardown": "None", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "001_10_01 EntityWithLanguageProperty", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_10_01", + "doc": "Check that you can create an entity with a LanguageProperty property", + "tags": [ + "4_5_18", + "5_6_1", + "e-create", + "since_v1.4.1" + ], + "setup": null, + "teardown": "Delete Initial Entity", + "template": "Create Entity Scenarios", + "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}'\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-language-property-sample.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_10" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_06.json b/doc/files/ContextInformation/Provision/010_06.json new file mode 100644 index 00000000..5d24eae4 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_06.json @@ -0,0 +1,34 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_06", + "test_objective": "Check that you can append a LanguageProperty property to an entity", + "reference": "ETSI GS CIM 009 V1.3.1 [], clause 4.5.18", + "config_id": "", + "parent_release": "v1.3.1", + "pics_selection": "PICS_4_5_18", + "keywords": [], + "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_06_01 Append a LanguageProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_06_01", + "doc": "Check that you can append a LanguageProperty property to an entity", + "tags": [ + "4_5_18", + "5_6_3", + "ea-append", + "since_v1.4.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes Without Params", + "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 Retrieve Entity by Id with Updated Entity set to ${entity}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-new-language-property-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", + "http_verb": "POST", + "endpoint": "entities/{id}/attrs" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/AppendEntityAttributes", + "robotfile": "010_06" +} \ No newline at end of file diff --git a/doc/tests/test_ContextInformation_Provision.py b/doc/tests/test_ContextInformation_Provision.py index 961fcc0e..8464f4c9 100644 --- a/doc/tests/test_ContextInformation_Provision.py +++ b/doc/tests/test_ContextInformation_Provision.py @@ -259,6 +259,13 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_001_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_10.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' @@ -315,6 +322,13 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_010_06(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_06.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_06.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_06.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' -- GitLab From 83bd9dd81209bb46c60c3b1456e582202d3c878f Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Wed, 20 Mar 2024 11:58:46 +0100 Subject: [PATCH 5/7] fix: update since_x.y.z tags and separate permutations with different tags --- .../Consumption/018_07.json | 38 ++++++++++++------- .../Consumption/020_12.json | 12 +++++- .../ContextInformation/Provision/001_01.json | 17 --------- .../ContextInformation/Provision/001_10.json | 8 +++- .../ContextInformation/Provision/010_01.json | 17 --------- .../ContextInformation/Provision/010_06.json | 8 +++- .../ContextInformation/Provision/012_04.json | 13 +++++-- 7 files changed, 55 insertions(+), 58 deletions(-) diff --git a/doc/files/ContextInformation/Consumption/018_07.json b/doc/files/ContextInformation/Consumption/018_07.json index 5b5adaf9..8c7675d8 100644 --- a/doc/files/ContextInformation/Consumption/018_07.json +++ b/doc/files/ContextInformation/Consumption/018_07.json @@ -1,10 +1,14 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/E/018_07", "test_objective": "Check that you can retrieve an entity using Language Filter", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.1", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.15, 5.7.1", "config_id": "", "parent_release": "v1.3.1", - "pics_selection": "PICS_5_7_1", + "clauses": [ + "4.15", + "5.7.1" + ], + "pics_selection": "", "keywords": [ "Create Initial Entity", "Delete Created Entity" @@ -17,9 +21,10 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_01", "doc": "Check that you can retrieve an entity using Language Filter", "tags": [ - "e-retrieve", + "4_15", "5_7_1", - "4_15" + "e-retrieve", + "since_v1.4.1" ], "setup": null, "teardown": null, @@ -34,9 +39,10 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_02", "doc": "Check that you can retrieve an entity using Language Filter", "tags": [ - "e-retrieve", + "4_15", "5_7_1", - "4_15" + "e-retrieve", + "since_v1.4.1" ], "setup": null, "teardown": null, @@ -51,9 +57,10 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_03", "doc": "Check that you can retrieve an entity using Language Filter", "tags": [ - "e-retrieve", + "4_15", "5_7_1", - "4_15" + "e-retrieve", + "since_v1.4.1" ], "setup": null, "teardown": null, @@ -68,9 +75,10 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_04", "doc": "Check that you can retrieve an entity using Language Filter", "tags": [ - "e-retrieve", + "4_15", "5_7_1", - "4_15" + "e-retrieve", + "since_v1.4.1" ], "setup": null, "teardown": null, @@ -85,9 +93,10 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_05", "doc": "Check that you can retrieve an entity using Language Filter", "tags": [ - "e-retrieve", + "4_15", "5_7_1", - "4_15" + "e-retrieve", + "since_v1.4.1" ], "setup": null, "teardown": null, @@ -102,9 +111,10 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_06", "doc": "Check that you can retrieve an entity using Language Filter", "tags": [ - "e-retrieve", + "4_15", "5_7_1", - "4_15" + "e-retrieve", + "since_v1.4.1" ], "setup": null, "teardown": null, diff --git a/doc/files/ContextInformation/Consumption/020_12.json b/doc/files/ContextInformation/Consumption/020_12.json index ed66686b..aa4aab5b 100644 --- a/doc/files/ContextInformation/Consumption/020_12.json +++ b/doc/files/ContextInformation/Consumption/020_12.json @@ -1,10 +1,16 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_12", "test_objective": "Check that you can retrieve the temporal evolution of an entity with a LanguageProperty property", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 4.5.18", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.5.18, 4.5.7, 4.5.9, 5.7.3", "config_id": "", "parent_release": "v1.3.1", - "pics_selection": "PICS_4_5_18", + "clauses": [ + "4.5.18", + "4.5.7", + "4.5.9", + "5.7.3" + ], + "pics_selection": "", "keywords": [ "Create Temporal Entity", "Delete Initial Temporal Entity" @@ -20,6 +26,7 @@ "4_5_18", "4_5_7", "5_7_3", + "since_v1.4.1", "te-retrieve" ], "setup": null, @@ -38,6 +45,7 @@ "4_5_18", "4_5_9", "5_7_3", + "since_v1.4.1", "te-retrieve" ], "setup": null, diff --git a/doc/files/ContextInformation/Provision/001_01.json b/doc/files/ContextInformation/Provision/001_01.json index fadae114..0bfc084d 100644 --- a/doc/files/ContextInformation/Provision/001_01.json +++ b/doc/files/ContextInformation/Provision/001_01.json @@ -78,23 +78,6 @@ "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-location-attribute-sample.jsonld'\n}", "http_verb": "POST", "endpoint": "entities/" - }, - { - "name": "001_01_05 EntityWithLanguageProperty", - "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_01_05", - "doc": "Check that you can create an entity", - "tags": [ - "4_5_18", - "5_6_1", - "e-create" - ], - "setup": null, - "teardown": "Delete Initial Entity", - "template": "Create Entity Scenarios", - "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}'\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-language-property-sample.jsonld'\n}", - "http_verb": "POST", - "endpoint": "entities/" } ], "permutations": [ diff --git a/doc/files/ContextInformation/Provision/001_10.json b/doc/files/ContextInformation/Provision/001_10.json index 8a017ccd..99adc155 100644 --- a/doc/files/ContextInformation/Provision/001_10.json +++ b/doc/files/ContextInformation/Provision/001_10.json @@ -1,10 +1,14 @@ { "tp_id": "TP/NGSI-LD/CI/Prov/E/001_10", "test_objective": "Check that you can create an entity with a LanguageProperty property", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 4.5.18", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.5.18, 5.6.1", "config_id": "", "parent_release": "v1.3.1", - "pics_selection": "PICS_4_5_18", + "clauses": [ + "4.5.18", + "5.6.1" + ], + "pics_selection": "", "keywords": [], "teardown": "None", "initial_condition": "with {\n the SUT containing an initial state\n}", diff --git a/doc/files/ContextInformation/Provision/010_01.json b/doc/files/ContextInformation/Provision/010_01.json index ecb8c250..ec4d27d2 100644 --- a/doc/files/ContextInformation/Provision/010_01.json +++ b/doc/files/ContextInformation/Provision/010_01.json @@ -47,23 +47,6 @@ "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-speed-different-datasetid-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", "http_verb": "POST", "endpoint": "entities/{id}/attrs" - }, - { - "name": "010_01_03 Append a LanguageProperty property", - "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_01_03", - "doc": "Check that you can append entity attributes", - "tags": [ - "4_5_18", - "5_6_3", - "ea-append" - ], - "setup": "Create Initial Entity", - "teardown": "Delete Initial Entity", - "template": "Append Attributes Without Params", - "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 Retrieve Entity by Id with Updated Entity set to ${entity}\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}/attrs'\n method set to 'POST'\n Append Entity Attributes and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: fragment_filename set to 'vehicle-new-language-property-fragment.jsonld' and\n Query Parameter: content_type set to 'application/ld+json'\n}", - "http_verb": "POST", - "endpoint": "entities/{id}/attrs" } ], "permutations": [ diff --git a/doc/files/ContextInformation/Provision/010_06.json b/doc/files/ContextInformation/Provision/010_06.json index 5d24eae4..07d09d78 100644 --- a/doc/files/ContextInformation/Provision/010_06.json +++ b/doc/files/ContextInformation/Provision/010_06.json @@ -1,10 +1,14 @@ { "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_06", "test_objective": "Check that you can append a LanguageProperty property to an entity", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 4.5.18", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.5.18, 5.6.3", "config_id": "", "parent_release": "v1.3.1", - "pics_selection": "PICS_4_5_18", + "clauses": [ + "4.5.18", + "5.6.3" + ], + "pics_selection": "", "keywords": [], "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}", diff --git a/doc/files/ContextInformation/Provision/012_04.json b/doc/files/ContextInformation/Provision/012_04.json index 293d383b..651ef509 100644 --- a/doc/files/ContextInformation/Provision/012_04.json +++ b/doc/files/ContextInformation/Provision/012_04.json @@ -1,10 +1,14 @@ { "tp_id": "TP/NGSI-LD/CI/Prov/EA/012_04", "test_objective": "Check that you can perform a partial update on a LanguageProperty property", - "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.6.4", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.5.18, 5.6.4", "config_id": "", "parent_release": "v1.3.1", - "pics_selection": "PICS_5_6_4", + "clauses": [ + "4.5.18", + "5.6.4" + ], + "pics_selection": "", "keywords": [], "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 and an attribute with an id set to ${atrId}\n}", @@ -14,9 +18,10 @@ "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_04_01", "doc": "Check that you can perform a partial update on a LanguageProperty property", "tags": [ - "ea-partial-update", + "4_5_18", "5_6_4", - "4_5_18" + "ea-partial-update", + "since_v1.4.1" ], "setup": "Initiate Test Case", "teardown": "Delete Initial Entities", -- GitLab From 6121245328c807ceceb3c49277de24277cc60206 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Fri, 22 Mar 2024 17:20:03 +0100 Subject: [PATCH 6/7] chore: update generated documentation --- doc/files/ContextInformation/Consumption/018_07.json | 1 + doc/files/ContextInformation/Consumption/020_12.json | 1 + doc/files/ContextInformation/Provision/001_10.json | 7 +++++-- doc/files/ContextInformation/Provision/010_06.json | 6 +++++- doc/files/ContextInformation/Provision/012_04.json | 6 +++++- 5 files changed, 17 insertions(+), 4 deletions(-) diff --git a/doc/files/ContextInformation/Consumption/018_07.json b/doc/files/ContextInformation/Consumption/018_07.json index 8c7675d8..38c1e730 100644 --- a/doc/files/ContextInformation/Consumption/018_07.json +++ b/doc/files/ContextInformation/Consumption/018_07.json @@ -10,6 +10,7 @@ ], "pics_selection": "", "keywords": [ + "Retrieve Entity With Language Filter", "Create Initial Entity", "Delete Created Entity" ], diff --git a/doc/files/ContextInformation/Consumption/020_12.json b/doc/files/ContextInformation/Consumption/020_12.json index aa4aab5b..e861ecca 100644 --- a/doc/files/ContextInformation/Consumption/020_12.json +++ b/doc/files/ContextInformation/Consumption/020_12.json @@ -12,6 +12,7 @@ ], "pics_selection": "", "keywords": [ + "Retrieve Temporal Entity", "Create Temporal Entity", "Delete Initial Temporal Entity" ], diff --git a/doc/files/ContextInformation/Provision/001_10.json b/doc/files/ContextInformation/Provision/001_10.json index 99adc155..ce839fae 100644 --- a/doc/files/ContextInformation/Provision/001_10.json +++ b/doc/files/ContextInformation/Provision/001_10.json @@ -9,7 +9,10 @@ "5.6.1" ], "pics_selection": "", - "keywords": [], + "keywords": [ + "Create Entity Scenarios", + "Delete Initial Entity" + ], "teardown": "None", "initial_condition": "with {\n the SUT containing an initial state\n}", "test_cases": [ @@ -26,7 +29,7 @@ "setup": null, "teardown": "Delete Initial Entity", "template": "Create Entity Scenarios", - "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}'\n}", + "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-language-property-sample.jsonld'\n}", "http_verb": "POST", "endpoint": "entities/" diff --git a/doc/files/ContextInformation/Provision/010_06.json b/doc/files/ContextInformation/Provision/010_06.json index 07d09d78..fde7c1dd 100644 --- a/doc/files/ContextInformation/Provision/010_06.json +++ b/doc/files/ContextInformation/Provision/010_06.json @@ -9,7 +9,11 @@ "5.6.3" ], "pics_selection": "", - "keywords": [], + "keywords": [ + "Append Attributes Without Params", + "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": [ diff --git a/doc/files/ContextInformation/Provision/012_04.json b/doc/files/ContextInformation/Provision/012_04.json index 651ef509..21bd79d6 100644 --- a/doc/files/ContextInformation/Provision/012_04.json +++ b/doc/files/ContextInformation/Provision/012_04.json @@ -9,7 +9,11 @@ "5.6.4" ], "pics_selection": "", - "keywords": [], + "keywords": [ + "Update Attributes", + "Initiate Test Case", + "Delete Initial Entities" + ], "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 and an attribute with an id set to ${atrId}\n}", "test_cases": [ -- GitLab From c2c0a10c1a3d62fa590ada8183abce86dd1f3292 Mon Sep 17 00:00:00 2001 From: Benoit Orihuela Date: Sat, 23 Mar 2024 08:59:09 +0100 Subject: [PATCH 7/7] chore: update generated documentation --- doc/files/ContextInformation/Consumption/018_07.json | 4 ++-- doc/files/ContextInformation/Consumption/020_12.json | 4 ++-- doc/files/ContextInformation/Provision/001_10.json | 4 ++-- doc/files/ContextInformation/Provision/010_06.json | 4 ++-- doc/files/ContextInformation/Provision/012_04.json | 4 ++-- 5 files changed, 10 insertions(+), 10 deletions(-) diff --git a/doc/files/ContextInformation/Consumption/018_07.json b/doc/files/ContextInformation/Consumption/018_07.json index 38c1e730..3d70e8ea 100644 --- a/doc/files/ContextInformation/Consumption/018_07.json +++ b/doc/files/ContextInformation/Consumption/018_07.json @@ -1,9 +1,9 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/E/018_07", "test_objective": "Check that you can retrieve an entity using Language Filter", - "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.15, 5.7.1", + "reference": "ETSI GS CIM 009 V1.4.1 [], clauses 4.15, 5.7.1", "config_id": "", - "parent_release": "v1.3.1", + "parent_release": "v1.4.1", "clauses": [ "4.15", "5.7.1" diff --git a/doc/files/ContextInformation/Consumption/020_12.json b/doc/files/ContextInformation/Consumption/020_12.json index e861ecca..4031111e 100644 --- a/doc/files/ContextInformation/Consumption/020_12.json +++ b/doc/files/ContextInformation/Consumption/020_12.json @@ -1,9 +1,9 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_12", "test_objective": "Check that you can retrieve the temporal evolution of an entity with a LanguageProperty property", - "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.5.18, 4.5.7, 4.5.9, 5.7.3", + "reference": "ETSI GS CIM 009 V1.4.1 [], clauses 4.5.18, 4.5.7, 4.5.9, 5.7.3", "config_id": "", - "parent_release": "v1.3.1", + "parent_release": "v1.4.1", "clauses": [ "4.5.18", "4.5.7", diff --git a/doc/files/ContextInformation/Provision/001_10.json b/doc/files/ContextInformation/Provision/001_10.json index ce839fae..03ad7246 100644 --- a/doc/files/ContextInformation/Provision/001_10.json +++ b/doc/files/ContextInformation/Provision/001_10.json @@ -1,9 +1,9 @@ { "tp_id": "TP/NGSI-LD/CI/Prov/E/001_10", "test_objective": "Check that you can create an entity with a LanguageProperty property", - "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.5.18, 5.6.1", + "reference": "ETSI GS CIM 009 V1.4.1 [], clauses 4.5.18, 5.6.1", "config_id": "", - "parent_release": "v1.3.1", + "parent_release": "v1.4.1", "clauses": [ "4.5.18", "5.6.1" diff --git a/doc/files/ContextInformation/Provision/010_06.json b/doc/files/ContextInformation/Provision/010_06.json index fde7c1dd..f1503514 100644 --- a/doc/files/ContextInformation/Provision/010_06.json +++ b/doc/files/ContextInformation/Provision/010_06.json @@ -1,9 +1,9 @@ { "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_06", "test_objective": "Check that you can append a LanguageProperty property to an entity", - "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.5.18, 5.6.3", + "reference": "ETSI GS CIM 009 V1.4.1 [], clauses 4.5.18, 5.6.3", "config_id": "", - "parent_release": "v1.3.1", + "parent_release": "v1.4.1", "clauses": [ "4.5.18", "5.6.3" diff --git a/doc/files/ContextInformation/Provision/012_04.json b/doc/files/ContextInformation/Provision/012_04.json index 21bd79d6..a0970376 100644 --- a/doc/files/ContextInformation/Provision/012_04.json +++ b/doc/files/ContextInformation/Provision/012_04.json @@ -1,9 +1,9 @@ { "tp_id": "TP/NGSI-LD/CI/Prov/EA/012_04", "test_objective": "Check that you can perform a partial update on a LanguageProperty property", - "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.5.18, 5.6.4", + "reference": "ETSI GS CIM 009 V1.4.1 [], clauses 4.5.18, 5.6.4", "config_id": "", - "parent_release": "v1.3.1", + "parent_release": "v1.4.1", "clauses": [ "4.5.18", "5.6.4" -- GitLab