diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_16.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_16.robot new file mode 100644 index 0000000000000000000000000000000000000000..690781f3f9a62b76dfb5b0959ccc7c40f7d9acb7 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_16.robot @@ -0,0 +1,47 @@ +*** Settings *** +Documentation Check that one can retrieve the temporal evolution of an entity with a VocabProperty 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 *** +${vehicle_payload_file}= vehicle-vocab-property-temporal-representation.jsonld + + +*** Test Cases *** REPRESENTATION EXPECTATION_FILENAME +020_16_01 Retrieve the normalized temporal representation of an entity with a VocabProperty property + [Tags] te-retrieve 5_7_3 4_5_7 4_5_24 since_v1.7.1 + ${EMPTY} vehicle-vocab-property-temporal-representation.json +020_16_02 Retrieve the simplified temporal representation of an entity with a VocabProperty property + [Tags] te-retrieve 5_7_3 4_5_9 4_5_24 since_v1.7.1 + temporalValues vehicle-vocab-property-simplified-temporal-representation.json + + +*** Keywords *** +Retrieve Temporal Entity + [Documentation] Check that one can retrieve the temporal evolution of an entity with a VocabProperty 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 Vehicle Entity Id + 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_15.robot b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_15.robot new file mode 100644 index 0000000000000000000000000000000000000000..8089e9fde8830427dfafb5710bcc40f2c41134ef --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_15.robot @@ -0,0 +1,44 @@ +*** Settings *** +Documentation Check that you can create an entity with a VocabProperty 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 + + +*** Test Cases *** FILENAME CONTENT_TYPE +001_15_01 EntityWithVocabPropertyAsString + [Tags] e-create 5_6_1 4_5_20 since_v1.7.1 + building-vocab-property-string.jsonld application/ld+json +001_15_02 EntityWithVocabPropertyAsArray + [Tags] e-create 5_6_1 4_5_20 since_v1.7.1 + building-vocab-property-array.jsonld application/ld+json + + +*** Keywords *** +Create Entity Scenarios + [Documentation] Check that you can create an entity with a VocabProperty property + [Arguments] ${filename} ${content_type} + ${entity_id}= Generate Random Building Entity Id + 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_11.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_11.robot new file mode 100644 index 0000000000000000000000000000000000000000..5b3994e46615e4d5054bffbd5ba5aad00a018831 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_11.robot @@ -0,0 +1,49 @@ +*** Settings *** +Documentation Check that you can append a VocabProperty 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 To Entity + + +*** Variables *** +${filename}= vehicle-minimal.jsonld + + +*** Test Cases *** STATUS_CODE FRAGMENT_FILENAME EXPECTATION_FILENAME +010_11_01 Append a VocabProperty property + [Tags] ea-append 5_6_3 4_5_20 since_v1.7.1 + 204 vehicle-new-vocab-property-fragment.jsonld vehicle-vocab-property-appended.jsonld + + +*** Keywords *** +Append Attributes To Entity + [Documentation] Check that you can append a VocabProperty 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 + ... updated_resource=${entity_expectation_payload} + ... response_body=${response1.json()} + +Create Initial Entity + ${entity_id}= Generate Random Vehicle Entity Id + ${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/DeleteEntityAttribute/013_07.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_07.robot new file mode 100644 index 0000000000000000000000000000000000000000..e8e520f688fba21ba184ff241e43f13ddc9f31d1 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_07.robot @@ -0,0 +1,46 @@ +*** Settings *** +Documentation Check that you can delete a VocabProperty property from an entity + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Test Setup Create Initial Entity +Test Teardown Delete Initial Entity + + +*** Variables *** +${filename}= building-vocab-property-string.jsonld +${expectation_filename}= building-minimal.json + + +*** Test Cases *** +013_07_01 Delete a VocabProperty property from an entity + [Documentation] Check that you can delete a VocabProperty property from an entity + [Tags] ea-delete 5_6_5 4_5_20 since_v1.7.1 + ${response}= Delete Entity Attributes + ... ${entity_id} + ... vocabProperty + ... ${EMPTY} + ... false + Check Response Status Code 204 ${response.status_code} + ${entity_expectation_payload}= Load Test Sample entities/expectations/${expectation_filename} ${entity_id} + ${response}= Retrieve Entity by Id + ... ${entity_id} + ... accept=${CONTENT_TYPE_JSON} + Check Updated Resource Set To ${entity_expectation_payload} ${response.json()} + + +*** Keywords *** +Create Initial Entity + ${entity_id}= Generate Random Building Entity Id + 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 Entity + Delete Entity by Id ${entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_09.robot b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_09.robot new file mode 100644 index 0000000000000000000000000000000000000000..cfd0d32674bb1d44e5353e55a05d9f300a831826 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_09.robot @@ -0,0 +1,53 @@ +*** Settings *** +Documentation Check that you can perform a partial update on a VocabProperty 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 *** +${filename}= building-vocab-property-sub-property.jsonld +${status_code}= 204 + + +*** Test Cases *** FRAGMENT_FILENAME ATTRIBUTE_ID EXPECTATION_FILENAME +012_09_01 Check that you can partially update a VocabProperty property + [Tags] ea-partial-update 5_6_4 4_5_20 since_v1.7.1 + building-vocab-property-fragment.jsonld vocabProperty building-vocab-property-update.jsonld + + +*** Keywords *** +Update Attributes + [Documentation] Check that you can perform a partial update on a VocabProperty 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 Vehicle Entity Id + 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-vocab-property-array.jsonld b/data/entities/building-vocab-property-array.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..469438b7a201ac0714f454e546092ddbc0956c96 --- /dev/null +++ b/data/entities/building-vocab-property-array.jsonld @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "vocabProperty": { + "type": "VocabProperty", + "vocab": ["monument", "sightseeing"] + }, + "@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-vocab-property-string.jsonld b/data/entities/building-vocab-property-string.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..452ddccbcaaedca4694410cc491c792fb358d210 --- /dev/null +++ b/data/entities/building-vocab-property-string.jsonld @@ -0,0 +1,11 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "vocabProperty": { + "type": "VocabProperty", + "vocab": "monument" + }, + "@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-vocab-property-sub-property.jsonld b/data/entities/building-vocab-property-sub-property.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..4f57fb582ef00c7e679591ea95adaea75e43e3b4 --- /dev/null +++ b/data/entities/building-vocab-property-sub-property.jsonld @@ -0,0 +1,15 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "vocabProperty": { + "type": "VocabProperty", + "vocab": "monument", + "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-vocab-property-update.jsonld b/data/entities/expectations/building-vocab-property-update.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..013e36639bf764ca7266ea6ad4f1d8e84b306424 --- /dev/null +++ b/data/entities/expectations/building-vocab-property-update.jsonld @@ -0,0 +1,19 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "vocabProperty": { + "type": "VocabProperty", + "vocab": "sightseeing", + "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-vocab-property-appended.jsonld b/data/entities/expectations/vehicle-vocab-property-appended.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..28b09b2c063966365e333312f59d33a946e55714 --- /dev/null +++ b/data/entities/expectations/vehicle-vocab-property-appended.jsonld @@ -0,0 +1,9 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "vocabProperty": { + "type": "VocabProperty", + "vocab": "monument" + }, + "@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-vocab-property-fragment.jsonld b/data/entities/fragmentEntities/building-vocab-property-fragment.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..54953654f595982461fdf4e55e78d0c81a6800c3 --- /dev/null +++ b/data/entities/fragmentEntities/building-vocab-property-fragment.jsonld @@ -0,0 +1,10 @@ +{ + "vocab": "sightseeing", + "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-vocab-property-fragment.jsonld b/data/entities/fragmentEntities/vehicle-new-vocab-property-fragment.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..0c727761767b1fe57c24b968a1cbcab4801e0995 --- /dev/null +++ b/data/entities/fragmentEntities/vehicle-new-vocab-property-fragment.jsonld @@ -0,0 +1,9 @@ +{ + "vocabProperty": { + "type": "VocabProperty", + "vocab": "monument" + }, + "@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/vehicle-minimal.jsonld b/data/entities/vehicle-minimal.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..f3681c139d9789b8aba14776ca7c59b49126a8a5 --- /dev/null +++ b/data/entities/vehicle-minimal.jsonld @@ -0,0 +1,7 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "@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-vocab-property-simplified-temporal-representation.json b/data/temporalEntities/expectations/vehicle-vocab-property-simplified-temporal-representation.json new file mode 100644 index 0000000000000000000000000000000000000000..931dc3b85f8db33e28a68cdad20fd6d944f7ffc6 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-vocab-property-simplified-temporal-representation.json @@ -0,0 +1,30 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "vocabProperty": { + "type": "VocabProperty", + "vocabs": [ + [ + { + "vocab": "monument" + }, + "2020-08-01T12:03:00Z" + ], + [ + { + "vocab": "sightseeing" + }, + "2020-08-01T12:05:00Z" + ], + [ + { + "vocab": [ + "monument", + "sightseeing" + ] + }, + "2020-08-01T12:07:00Z" + ] + ] + } +} \ No newline at end of file diff --git a/data/temporalEntities/expectations/vehicle-vocab-property-temporal-representation.json b/data/temporalEntities/expectations/vehicle-vocab-property-temporal-representation.json new file mode 100644 index 0000000000000000000000000000000000000000..bc871a124f62a3c9cf8f5477be3612022d4eee71 --- /dev/null +++ b/data/temporalEntities/expectations/vehicle-vocab-property-temporal-representation.json @@ -0,0 +1,24 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "vocabProperty": [ + { + "type": "VocabProperty", + "vocab": "monument", + "observedAt": "2020-08-01T12:03:00Z" + }, + { + "type": "VocabProperty", + "vocab": "sightseeing", + "observedAt": "2020-08-01T12:05:00Z" + }, + { + "type": "VocabProperty", + "vocab": [ + "monument", + "sightseeing" + ], + "observedAt": "2020-08-01T12:07:00Z" + } + ] +} \ No newline at end of file diff --git a/data/temporalEntities/vehicle-vocab-property-temporal-representation.jsonld b/data/temporalEntities/vehicle-vocab-property-temporal-representation.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..23f504659da51773a39acc06cbed6a981e4db54e --- /dev/null +++ b/data/temporalEntities/vehicle-vocab-property-temporal-representation.jsonld @@ -0,0 +1,27 @@ +{ + "id": "urn:ngsi-ld:Vehicle:randomUUID", + "type": "Vehicle", + "vocabProperty": [ + { + "type": "VocabProperty", + "vocab": "monument", + "observedAt": "2020-08-01T12:03:00Z" + }, + { + "type": "VocabProperty", + "vocab": "sightseeing", + "observedAt": "2020-08-01T12:05:00Z" + }, + { + "type": "VocabProperty", + "vocab": [ + "monument", + "sightseeing" + ], + "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/files/ContextInformation/Consumption/020_16.json b/doc/files/ContextInformation/Consumption/020_16.json new file mode 100644 index 0000000000000000000000000000000000000000..4a764eb26cec97c38b8596d67a67cd28026fbade --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_16.json @@ -0,0 +1,67 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_16", + "test_objective": "Check that one can retrieve the temporal evolution of an entity with a VocabProperty property", + "reference": "ETSI GS CIM 009 V1.7.1 [], clauses 4.5.24, 4.5.7, 4.5.9, 5.7.3", + "config_id": "", + "parent_release": "v1.7.1", + "clauses": [ + "4.5.24", + "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_16_01 Retrieve the normalized temporal representation of an entity with a VocabProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_16_01", + "doc": "Check that one can retrieve the temporal evolution of an entity with a VocabProperty property", + "tags": [ + "4_5_24", + "4_5_7", + "5_7_3", + "since_v1.7.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-vocab-property-temporal-representation.json'\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_16_02 Retrieve the simplified temporal representation of an entity with a VocabProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_16_02", + "doc": "Check that one can retrieve the temporal evolution of an entity with a VocabProperty property", + "tags": [ + "4_5_24", + "4_5_9", + "5_7_3", + "since_v1.7.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-vocab-property-simplified-temporal-representation.json'\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_16" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/001_15.json b/doc/files/ContextInformation/Provision/001_15.json new file mode 100644 index 0000000000000000000000000000000000000000..3539bc14d3645e8644143d4f2d2972306788afcb --- /dev/null +++ b/doc/files/ContextInformation/Provision/001_15.json @@ -0,0 +1,61 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/E/001_15", + "test_objective": "Check that you can create an entity with a VocabProperty property", + "reference": "ETSI GS CIM 009 V1.7.1 [], clauses 4.5.20, 5.6.1", + "config_id": "", + "parent_release": "v1.7.1", + "clauses": [ + "4.5.20", + "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_15_01 EntityWithVocabPropertyAsString", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_15_01", + "doc": "Check that you can create an entity with a VocabProperty property", + "tags": [ + "4_5_20", + "5_6_1", + "e-create", + "since_v1.7.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-vocab-property-string.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + }, + { + "name": "001_15_02 EntityWithVocabPropertyAsArray", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/E/001_15_02", + "doc": "Check that you can create an entity with a VocabProperty property", + "tags": [ + "4_5_20", + "5_6_1", + "e-create", + "since_v1.7.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-vocab-property-array.jsonld'\n}", + "http_verb": "POST", + "endpoint": "entities/" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Provision/Entities/CreateEntity", + "robotfile": "001_15" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/010_11.json b/doc/files/ContextInformation/Provision/010_11.json new file mode 100644 index 0000000000000000000000000000000000000000..e63b8110bf0262d979a414664496f2d88e93457d --- /dev/null +++ b/doc/files/ContextInformation/Provision/010_11.json @@ -0,0 +1,42 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/010_11", + "test_objective": "Check that you can append a VocabProperty property to an entity", + "reference": "ETSI GS CIM 009 V1.7.1 [], clauses 4.5.20, 5.6.3", + "config_id": "", + "parent_release": "v1.7.1", + "clauses": [ + "4.5.20", + "5.6.3" + ], + "pics_selection": "", + "keywords": [ + "Append Attributes To Entity", + "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_11_01 Append a VocabProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/010_11_01", + "doc": "Check that you can append a VocabProperty property to an entity", + "tags": [ + "4_5_20", + "5_6_3", + "ea-append", + "since_v1.7.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": "Append Attributes To Entity", + "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 Check Updated Entity and\n Query Parameter: 'updated_resource' set to 'entity_expectation_payload' 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/{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-vocab-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_11" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/012_09.json b/doc/files/ContextInformation/Provision/012_09.json new file mode 100644 index 0000000000000000000000000000000000000000..ef492133301cc5870687613618794762ef5972b8 --- /dev/null +++ b/doc/files/ContextInformation/Provision/012_09.json @@ -0,0 +1,42 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/012_09", + "test_objective": "Check that you can perform a partial update on a VocabProperty property", + "reference": "ETSI GS CIM 009 V1.7.1 [], clauses 4.5.20, 5.6.4", + "config_id": "", + "parent_release": "v1.7.1", + "clauses": [ + "4.5.20", + "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_09_01 Check that you can partially update a VocabProperty property", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/012_09_01", + "doc": "Check that you can perform a partial update on a VocabProperty property", + "tags": [ + "4_5_20", + "5_6_4", + "ea-partial-update", + "since_v1.7.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 Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{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 'vocabProperty' and\n Query Parameter: fragment_filename set to 'building-vocab-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_09" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/013_07.json b/doc/files/ContextInformation/Provision/013_07.json new file mode 100644 index 0000000000000000000000000000000000000000..5d38eccf3396031fd682ff75893e183447cf765d --- /dev/null +++ b/doc/files/ContextInformation/Provision/013_07.json @@ -0,0 +1,41 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Prov/EA/013_07", + "test_objective": "Check that you can delete a VocabProperty property from an entity", + "reference": "ETSI GS CIM 009 V1.7.1 [], clauses 4.5.20, 5.6.5", + "config_id": "", + "parent_release": "v1.7.1", + "clauses": [ + "4.5.20", + "5.6.5" + ], + "pics_selection": "", + "keywords": [ + "Create Initial Entity", + "Delete Initial Entity" + ], + "teardown": "None", + "initial_condition": "with {\n the SUT being in the \"initial state\" and\n the SUT containing an initial Entity ${entity} \n with an id set to ${entityId} \n}", + "test_cases": [ + { + "name": "013_07_01 Delete a VocabProperty property from an entity", + "permutation_tp_id": "TP/NGSI-LD/CI/Prov/EA/013_07_01", + "doc": "Check that you can delete a VocabProperty property from an entity", + "tags": [ + "4_5_20", + "5_6_5", + "ea-delete", + "since_v1.7.1" + ], + "setup": "Create Initial Entity", + "teardown": "Delete Initial Entity", + "template": null, + "then": "then {\n the SUT sends a valid Response for the operations:\n Delete Entity Attributes with Response Status Code set to 204 and\n Delete Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json'\n}", + "http_verb": "GET", + "endpoint": "entities/{id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute", + "robotfile": "013_07" +} \ No newline at end of file diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py index 6330b8690a2a52eccf0201d19e064d251338d13b..783fed5e83636c24af18790092976caeb4760f31 100644 --- a/doc/tests/test_ContextInformation_Consumption.py +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -559,6 +559,13 @@ class TestCIConsumptions(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_020_16(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_16.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_16.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_16.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_020_17(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_17.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_17.json' diff --git a/doc/tests/test_ContextInformation_Provision.py b/doc/tests/test_ContextInformation_Provision.py index 4d482b6a8e55961dc56a9230f16f25b9bae31367..7593b488fa9523160c9e8df88e1bd1332a7c2e44 100644 --- a/doc/tests/test_ContextInformation_Provision.py +++ b/doc/tests/test_ContextInformation_Provision.py @@ -329,6 +329,13 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_001_15(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/Entities/CreateEntity/001_15.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/001_15.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_001_15.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' @@ -448,6 +455,13 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_010_11(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/AppendEntityAttributes/010_11.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/010_11.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_010_11.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' @@ -490,6 +504,13 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_013_07(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/DeleteEntityAttribute/013_07.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/013_07.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_013_07.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_012_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/012_01.json' @@ -546,6 +567,13 @@ class TestCIProvision(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_012_09(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Provision/EntityAttributes/PartialAttributeUpdate/012_09.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Provision/012_09.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_012_09.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'