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 0000000000000000000000000000000000000000..1b7834dca66c1e5cce83180ef00c96b6420f397e --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_07.robot @@ -0,0 +1,67 @@ +*** 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 + [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 + [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 0000000000000000000000000000000000000000..61bdf8df42b3efba346851ca76668aa413a860ae --- /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 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 since_v1.4.1 + 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_10.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_10.robot new file mode 100644 index 0000000000000000000000000000000000000000..f038a369ddd887eed1fbf4f9f8d3f8fc56a82eb3 --- /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 c419292697d3747029ada8cb4b6bc78373c013eb..4cab8706ae3fcab67fbf439eac212c52bbba433d 100644 --- a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_01.robot @@ -18,15 +18,16 @@ ${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 *** 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} 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 0000000000000000000000000000000000000000..0a2628d01452d5e673801e91f0bf90e1e83cff69 --- /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 new file mode 100644 index 0000000000000000000000000000000000000000..5a4c7f9eb22c11521e8f78460fe66e7aecb9a6ef --- /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 + [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 + [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 0000000000000000000000000000000000000000..86f2fcb2bc16970fe028a015f4ba27759f4bd215 --- /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 0000000000000000000000000000000000000000..a790f482a8d961aaa9c9f6a41fa0fae5d01a35d9 --- /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 0000000000000000000000000000000000000000..b5449922b03d4f09f572a9afc72ac81a6ec3ecfb --- /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 0000000000000000000000000000000000000000..86f2fcb2bc16970fe028a015f4ba27759f4bd215 --- /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 0000000000000000000000000000000000000000..cb34cdcbf48cb127ac66991b58a2188e895a73ef --- /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 0000000000000000000000000000000000000000..0857281efe5b91908409ceba8fbb12984403f33b --- /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 0000000000000000000000000000000000000000..5e9e9bde4ce70f6ae9386ca7986994786be1d3cc --- /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 0000000000000000000000000000000000000000..f8e79f9ebbbe58f73b697d32d25c26958572decb --- /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 0000000000000000000000000000000000000000..fabcc51ece74180f4786899856a67e24cd1dd7b1 --- /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 0000000000000000000000000000000000000000..5c18ad06c14fe599f7f18fdacc6fe6bb815d1519 --- /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 0000000000000000000000000000000000000000..de53dbde74228c5895494d967af8ec8b1c94ea1d --- /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 0000000000000000000000000000000000000000..2cdd3d78ea03739e14cfd7b9641a441080ca62c2 --- /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 0000000000000000000000000000000000000000..f436ecc3d3579aeef82b72a1aec154a3beab6104 --- /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 612d9a58e1a30c380b87bd3054a680934db8afe5..798f0bb91b1b37f0b51579eb6c4f4ce1d1d7d6f9 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/files/ContextInformation/Consumption/018_07.json b/doc/files/ContextInformation/Consumption/018_07.json new file mode 100644 index 0000000000000000000000000000000000000000..3d70e8eafe4de5505e30965b40c56d590fc5cbbd --- /dev/null +++ b/doc/files/ContextInformation/Consumption/018_07.json @@ -0,0 +1,135 @@ +{ + "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.4.1 [], clauses 4.15, 5.7.1", + "config_id": "", + "parent_release": "v1.4.1", + "clauses": [ + "4.15", + "5.7.1" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Entity With Language Filter", + "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": [ + "4_15", + "5_7_1", + "e-retrieve", + "since_v1.4.1" + ], + "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": [ + "4_15", + "5_7_1", + "e-retrieve", + "since_v1.4.1" + ], + "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": [ + "4_15", + "5_7_1", + "e-retrieve", + "since_v1.4.1" + ], + "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": [ + "4_15", + "5_7_1", + "e-retrieve", + "since_v1.4.1" + ], + "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": [ + "4_15", + "5_7_1", + "e-retrieve", + "since_v1.4.1" + ], + "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": [ + "4_15", + "5_7_1", + "e-retrieve", + "since_v1.4.1" + ], + "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 0000000000000000000000000000000000000000..4031111e5cf6e653f986e145b6af4f65334e01c6 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_12.json @@ -0,0 +1,67 @@ +{ + "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.4.1 [], clauses 4.5.18, 4.5.7, 4.5.9, 5.7.3", + "config_id": "", + "parent_release": "v1.4.1", + "clauses": [ + "4.5.18", + "4.5.7", + "4.5.9", + "5.7.3" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Temporal Entity", + "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", + "since_v1.4.1", + "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", + "since_v1.4.1", + "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_10.json b/doc/files/ContextInformation/Provision/001_10.json new file mode 100644 index 0000000000000000000000000000000000000000..03ad7246aef224827d196b8f7607cb60a007c699 --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_10.json @@ -0,0 +1,41 @@ +{ + "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.4.1 [], clauses 4.5.18, 5.6.1", + "config_id": "", + "parent_release": "v1.4.1", + "clauses": [ + "4.5.18", + "5.6.1" + ], + "pics_selection": "", + "keywords": [ + "Create Entity Scenarios", + "Delete Initial Entity" + ], + "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}' 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/" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_10" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_01.json b/doc/files/ContextInformation/Provision/010_01.json index dea3aca0a5123649148c7ebf3eff2f0ceef1427b..ec4d27d20f5a6e1a80662d2bea732422398082d9 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", diff --git a/doc/files/ContextInformation/Provision/010_06.json b/doc/files/ContextInformation/Provision/010_06.json new file mode 100644 index 0000000000000000000000000000000000000000..f1503514af5d4885384ce385be4ee9a2e3bf80b8 --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_06.json @@ -0,0 +1,42 @@ +{ + "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.4.1 [], clauses 4.5.18, 5.6.3", + "config_id": "", + "parent_release": "v1.4.1", + "clauses": [ + "4.5.18", + "5.6.3" + ], + "pics_selection": "", + "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": [ + { + "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/files/ContextInformation/Provision/012_04.json b/doc/files/ContextInformation/Provision/012_04.json new file mode 100644 index 0000000000000000000000000000000000000000..a097037681b0da4e03b891679b14a5e7f69a82ce --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_04.json @@ -0,0 +1,42 @@ +{ + "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.4.1 [], clauses 4.5.18, 5.6.4", + "config_id": "", + "parent_release": "v1.4.1", + "clauses": [ + "4.5.18", + "5.6.4" + ], + "pics_selection": "", + "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": [ + { + "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": [ + "4_5_18", + "5_6_4", + "ea-partial-update", + "since_v1.4.1" + ], + "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 diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py index fc7bc65dabd370479120970ff3423a2123326a37..533026a11af5f062d5e5d5aa1e2e2aa5103a5e45 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 9159720b86a16e2c908be428fd186ebb319482a1..8464f4c9e9fc53348d91090775585cb8638682f4 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' @@ -357,6 +371,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 6f3d9d02437f1bba87c0efffc3107a4f0f453bd8..423fa366b35a35036752e13734b97c088d7814fd 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}