diff --git a/README.md b/README.md index e471a85673d3a8b7ec45ab3da263ee8267d1edf7..5dcee1db78904ffc2dd1f1bb28dd4ebb38ed19b7 100644 --- a/README.md +++ b/README.md @@ -148,8 +148,18 @@ test launch command followed by the file name. > > .venv\scripts\deactivate.bat > ``` -### Specific test requirements -- Mqtt tests (058) launch a mosquitto container with docker, thus it requires docker to be installed and running +### Specific test requirements +- Mqtt tests (058) : + - Mqtt tests launch a mosquitto container with docker thus it requires docker to be installed and running + + +- Temporal pagination (020_13, 020_14, 021_15 & 021_16) : + - The pagination tests assumes that it will be triggered by 1 or 2 entities with 2 attributes with 20 instances each + (40 instances) + - Non pagination tests assumes that it will **not** be triggered by 2 entities with 2 attributes with 5 instances each + (20 instances) + - You should configure your broker accordingly + ## Test Suite Management (tsm) @@ -248,7 +258,13 @@ to maintain and run the selected Test Cases from the pickle file. The list of co * Switch OFF Test Collections tsm collections off [collections] - +### Specific test requirements +- Temporal pagination : + - The pagination tests assumes that it will be triggered by 1 or 2 entities with 2 attributes with 20 instances each + (40 instances) + - Non pagination tests assumes that it will **not** be triggered by 2 entities with 2 attributes with 5 instances each + (20 instances) + - You should configure your broker accordingly ## Contribute to the Test Suite In order to contribute to the ETSI NGSI-LD Test Suite, it is recommended to install an IDE with the corresponding @@ -355,7 +371,7 @@ In these cases, it is needed to provide the corresponding information in the Pyt in `self.description` to reference the method that pretty print the operation, and add the method that pretty prints the operation) - When a new permutation is added in an existing Test Case, run the documentation generation script - (`python doc/analysis/generateDocumentationData.py {tc_id}`) for the Test Case and copy the generated JSON file in the + (`python doc/generateDocumentationData.py {tc_id}`) for the Test Case and copy the generated JSON file in the folder containing all files for the given group and subgroup (`cp doc/results/{tc_id}.json doc/files/{group}/{subgroup}`) - When a new directory containing Test Cases is created, it has to be declared in `doc/generaterobotdata.py` along with its acronym diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot index 4d8e3885a25fd14647755194ef00def873dd83c4..eb3e0a5fef244f90ee6e31ab9ed8494707000479 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot @@ -26,7 +26,7 @@ ${expectation_file}= vehicles-temporal-representation-021-03-expe ... entity_types=${entity_types_to_be_retrieved} ... timerel=after ... timeAt=2020-07-01T12:05:00Z - ... lastN=${14} + ... lastN=${4} ... context=${ngsild_test_suite_context} @{temporal_entities_representation_ids}= Create List ... ${first_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_15.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_15.robot new file mode 100644 index 0000000000000000000000000000000000000000..59b3aa5e203be29421ac4bf1c5c94b9f703d2f8a --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_15.robot @@ -0,0 +1,176 @@ +*** Settings *** +Documentation Check temporal pagination is applied when querying the temporal evolution of entities + +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Temporal Entities + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= pagination/2020-01-vehicule-temporal-representation-twenty-instances.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld +${timeBefore}= 2019-01-01T01:01:00Z +${timeAfter}= 2021-01-01T01:01:00Z +${lrt}= least recent timestamp +${mrt}= most recent timestamp + + +*** Test Cases *** REPRESENTATION EXPECTATION_FILENAME +021_15_01 retrieve the entity with lastN and timerel before + [Tags] te-retrieve 5_7_4 6_3_10 since_v1.5.1 + lastN=${20} expectedSize=20 timerel=before timeAt=${timeAfter} expectedRangeStart=${timeAfter} expectedRangeEnd=${lrt} +021_15_02 retrieve the entity with lastN and timerel between + [Tags] te-retrieve 5_7_4 6_3_10 since_v1.5.1 + lastN=${20} timerel=between timeAt=${timeBefore} endTimeAt=${timeAfter} expectedRangeStart=${timeAfter} expectedRangeEnd=${lrt} +021_15_03 retrieve the entity with lastN and timerel after + [Tags] te-retrieve 5_7_4 6_3_10 since_v1.5.1 + lastN=${20} expectedSize=20 timerel=after timeAt=${timeBefore} expectedRangeStart=${mrt} expectedRangeEnd=${lrt} +021_15_04 retrieve the entity with timerel before + [Tags] te-retrieve 5_7_4 6_3_10 since_v1.5.1 + timerel=before expectedSize=* timeAt=${timeAfter} expectedRangeEnd=${mrt} +021_15_05 retrieve the entity with timerel between + [Tags] te-retrieve 5_7_4 6_3_10 since_v1.5.1 + timerel=between timeAt=${timeBefore} endTimeAt=${timeAfter} expectedRangeStart=${timeBefore} expectedRangeEnd=${mrt} +021_15_06 retrieve the entity with timerel after + [Tags] te-retrieve 5_7_4 6_3_10 since_v1.5.1 + timerel=after timeAt=${timeBefore} expectedRangeStart=${timeBefore} expectedRangeEnd=${mrt} +021_15_07 retrieve the entity with temporalValues and timerel after + [Tags] te-retrieve 5_7_4 6_3_10 since_v1.5.1 + representation=temporalValues timerel=after timeAt=${timeBefore} expectedRangeStart=${timeBefore} expectedRangeEnd=${mrt} +021_15_08 retrieve the entity with temporalValues, lastN and timerel between + [Tags] te-retrieve 5_7_4 6_3_10 since_v1.5.1 + representation=temporalValues lastN=${20} timerel=between timeAt=${timeBefore} endTimeAt=${timeAfter} expectedRangeStart=${timeAfter} expectedRangeEnd=${lrt} + + +*** Keywords *** +Retrieve Temporal Entities + [Documentation] Check temporal pagination behavior on multiple entity endpoint + [Arguments] + ... ${representation}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${endTimeAt}=${EMPTY} + ... ${lastN}=${EMPTY} + ... ${expectedRangeStart}=${EMPTY} + ... ${expectedRangeEnd}=${EMPTY} + ... ${expectedSize}=${EMPTY} + ${entity_types_to_be_retrieved}= Catenate SEPARATOR=, Vehicle + + ${response}= Query Temporal Representation Of Entities + ... entity_types=${entity_types_to_be_retrieved} + ... options=${representation} + ... context=${ngsild_test_suite_context} + ... timerel=${timerel} + ... timeAt=${timeAt} + ... endTimeAt=${endTimeAt} + ... lastN=${lastN} + Check Response Status Code 206 ${response.status_code} + + ${contentRange}= Get Regexp Matches + ... ${response.headers}[Content-Range] + ... ([a-zA-Z\-]+) (.*-.*-.*)-(.*-.*-.*)\/(.*) + ... 1 + ... 2 + ... 3 + ... 4 + ${unit}= Set Variable ${contentRange}[0][0] + ${rangeStart}= Convert Date ${contentRange}[0][1] + ${rangeEnd}= Convert Date ${contentRange}[0][2] + ${size}= Set Variable ${contentRange}[0][3] + + Check Content Range Part Equal ${unit} date-time + + IF $expectedRangeStart != '' + IF $expectedRangeStart == $lrt + ${expectedRangeStart}= Get Least Recent Timestamp From Vehicles ${response.json()} + ELSE IF $expectedRangeStart == $mrt + ${expectedRangeStart}= Get Most Recent Timestamp From Vehicles ${response.json()} + ELSE + ${expectedRangeStart}= Convert Date ${expectedRangeStart} + END + Check Content Range Part Equal ${expectedRangeStart} ${rangeStart} + END + + IF $expectedRangeEnd != '' + IF $expectedRangeEnd == $lrt + ${expectedRangeEnd}= Get Least Recent Timestamp From Vehicles + ... ${response.json()} + ... ${representation} + ELSE IF $expectedRangeEnd == $mrt + ${expectedRangeEnd}= Get Most Recent Timestamp From Vehicles + ... ${response.json()} + ... ${representation} + ELSE + ${expectedRangeEnd}= Convert Date ${expectedRangeEnd} + END + Check Content Range Part Equal ${expectedRangeEnd} ${rangeEnd} + END + + IF $expectedSize != '' + Check Content Range Part Equal ${expectedSize} ${size} + END + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} + +Get Least Recent Timestamp From Vehicles + [Arguments] ${body} ${representation}=${EMPTY} + + ${attributeList}= Combine Lists + ... ${body}[0][speed] + ... ${body}[0][fuelLevel] + ... ${body}[1][speed] + ... ${body}[1][fuelLevel] + ${leastRecentTimestamp}= Convert Date ${timeAfter} + FOR ${attribute} IN @{attributeList} + IF $representation == 'temporalValues' + ${attributeTime}= Convert Date ${attribute}[1] + ELSE + ${attributeTime}= Convert Date ${attribute}[observedAt] + END + + IF $leastRecentTimestamp >= $attributeTime + ${leastRecentTimestamp}= Set Variable ${attributeTime} + END + END + RETURN ${leastRecentTimestamp} + +Get Most Recent Timestamp From Vehicles + [Arguments] ${body} ${representation}=${EMPTY} + ${attributeList}= Combine Lists + ... ${body}[0][speed] + ... ${body}[0][fuelLevel] + ... ${body}[1][speed] + ... ${body}[1][fuelLevel] + + ${mostRecentTimestamp}= Convert Date ${timeBefore} + FOR ${attribute} IN @{attributeList} + IF $representation == 'temporalValues' + ${attributeTime}= Convert Date ${attribute}[1] + ELSE + ${attributeTime}= Convert Date ${attribute}[observedAt] + END + IF $mostRecentTimestamp <= $attributeTime + ${mostRecentTimestamp}= Set Variable ${attributeTime} + END + END + RETURN ${mostRecentTimestamp} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_16.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_16.robot new file mode 100644 index 0000000000000000000000000000000000000000..826ae62b18523c7db236a7e29aa25a79c0b39257 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_16.robot @@ -0,0 +1,62 @@ +*** Settings *** +Documentation Check temporal pagination is applied when querying the temporal evolution of entities via POST + +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationConsumption.resource +Resource ${EXECDIR}/resources/ApiUtils/TemporalContextInformationProvision.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Initial Entities +Test Template Retrieve Temporal Entities Via Post + + +*** Variables *** +${vehicule_id_prefix}= urn:ngsi-ld:Vehicle: +${first_vehicle_payload_file}= pagination/2020-01-vehicule-temporal-representation-twenty-instances.jsonld +${second_vehicle_payload_file}= 2020-09-vehicule-temporal-representation-sample.jsonld + + +*** Test Cases *** REPRESENTATION EXPECTATION_FILENAME +021_16_01 retrieve the entities via post + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + entity-operations-before-query.jsonld + + +*** Keywords *** +Retrieve Temporal Entities Via Post + [Documentation] Check that temporal pagination is triggered on the post temporal query + [Arguments] ${payload_file} + + ${response}= Query Temporal Representation Of Entities Via Post + ... query_file_name=${payload_file} + ... context=${ngsild_test_suite_context} + + Check Response Status Code 206 ${response.status_code} + + ${contentRange}= Get Regexp Matches + ... ${response.headers}[Content-Range] + ... ([a-zA-Z\-]+) (.*-.*-.*)-(.*-.*-.*)\/(.*) + ... 1 + ... 2 + ... 3 + ... 4 + ${unit}= Set Variable ${contentRange}[0][0] + + Check Content Range Part Equal ${unit} date-time + +Setup Initial Entities + ${first_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + ${second_temporal_entity_representation_id}= Generate Random Entity Id ${vehicule_id_prefix} + Create Temporal Representation Of Entity + ... ${first_vehicle_payload_file} + ... ${first_temporal_entity_representation_id} + Create Temporal Representation Of Entity + ... ${second_vehicle_payload_file} + ... ${second_temporal_entity_representation_id} + Set Suite Variable ${first_temporal_entity_representation_id} + Set Suite Variable ${second_temporal_entity_representation_id} + +Delete Initial Entities + Delete Temporal Representation Of Entity ${first_temporal_entity_representation_id} + Delete Temporal Representation Of Entity ${second_temporal_entity_representation_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot index 9375ae08aad5a73d5dd63d3615b9a88bc4817eb0..086647d7dcb406b2b6fd07b7c2a41f2f51c1c588 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot @@ -19,10 +19,10 @@ ${vehicle_payload_file}= 2020-08-vehicule-temporal-representation-multiple-in *** Test Cases *** LASTN VEHICLE_EXPECTATION_FILE 020_05_01 Retrieve Some Instances [Tags] te-retrieve 5_7_3 - ${10} vehicle-temporal-representation-020-05-01-expectation.jsonld + ${4} vehicle-temporal-representation-020-05-01-expectation.jsonld 020_05_02 Retrieve All Instances [Tags] te-retrieve 5_7_3 - ${20} vehicle-temporal-representation-020-05-02-expectation.jsonld + ${7} vehicle-temporal-representation-020-05-02-expectation.jsonld *** Keywords *** diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_13.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_13.robot new file mode 100644 index 0000000000000000000000000000000000000000..ac8a51e59170b9aa393ce5f5718535f5e5992850 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_13.robot @@ -0,0 +1,162 @@ +*** Settings *** +Documentation Check temporal pagination is applied when retrieving the temporal evolution of an entity + +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}= pagination/2020-01-vehicule-temporal-representation-twenty-instances.jsonld +${timeBefore}= 2019-01-01T01:01:00Z +${timeAfter}= 2021-01-01T01:01:00Z +${lrt}= least recent timestamp +${mrt}= most recent timestamp + + +*** Test Cases *** REPRESENTATION EXPECTATION_FILENAME +020_13_01 retrieve an entity with 20 instances on two attributes + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + ${EMPTY} expectedSize=* expectedRangeStart=${lrt} expectedRangeEnd=${mrt} +020_13_02 retrieve the entity with lastN + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + lastN=${20} expectedSize=20 expectedRangeStart=${mrt} expectedRangeEnd=${lrt} +020_13_03 retrieve the entity with lastN and timerel before + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + lastN=${20} expectedSize=20 timerel=before timeAt=${timeAfter} expectedRangeStart=${timeAfter} expectedRangeEnd=${lrt} +020_13_04 retrieve the entity with lastN and timerel between + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + lastN=${20} timerel=between timeAt=${timeBefore} endTimeAt=${timeAfter} expectedRangeStart=${timeAfter} expectedRangeEnd=${lrt} +020_13_05 retrieve the entity with lastN and timerel after + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + lastN=${20} expectedSize=20 timerel=after timeAt=${timeBefore} expectedRangeStart=${mrt} expectedRangeEnd=${lrt} +020_13_06 retrieve the entity with timerel before + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + timerel=before expectedSize=* timeAt=${timeAfter} expectedRangeEnd=${mrt} +020_13_07 retrieve the entity with timerel between + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + timerel=between timeAt=${timeBefore} endTimeAt=${timeAfter} expectedRangeStart=${timeBefore} expectedRangeEnd=${mrt} +020_13_08 retrieve the entity with timerel after + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + timerel=after timeAt=${timeBefore} expectedRangeStart=${timeBefore} expectedRangeEnd=${mrt} +020_13_09 retrieve the entity with temporalValues and timerel after + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + representation=temporalValues timerel=after timeAt=${timeBefore} expectedRangeStart=${timeBefore} expectedRangeEnd=${mrt} +020_13_10 retrieve the entity with temporalValues, lastN and timerel between + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + representation=temporalValues lastN=${20} timerel=between timeAt=${timeBefore} endTimeAt=${timeAfter} expectedRangeStart=${timeAfter} expectedRangeEnd=${lrt} + + +*** Keywords *** +Retrieve Temporal Entity + [Documentation] Check temporal pagination behavior + [Arguments] + ... ${representation}=${EMPTY} + ... ${timerel}=${EMPTY} + ... ${timeAt}=${EMPTY} + ... ${endTimeAt}=${EMPTY} + ... ${lastN}=${EMPTY} + ... ${expectedRangeStart}=${EMPTY} + ... ${expectedRangeEnd}=${EMPTY} + ... ${expectedSize}=${EMPTY} + ${response}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... options=${representation} + ... context=${ngsild_test_suite_context} + ... timerel=${timerel} + ... timeAt=${timeAt} + ... endTimeAt=${endTimeAt} + ... lastN=${lastN} + Check Response Status Code 206 ${response.status_code} + + ${contentRange}= Get Regexp Matches + ... ${response.headers}[Content-Range] + ... ([a-zA-Z\-]+) (.*-.*-.*)-(.*-.*-.*)\/(.*) + ... 1 + ... 2 + ... 3 + ... 4 + ${unit}= Set Variable ${contentRange}[0][0] + ${rangeStart}= Convert Date ${contentRange}[0][1] + ${rangeEnd}= Convert Date ${contentRange}[0][2] + ${size}= Set Variable ${contentRange}[0][3] + + Check Content Range Part Equal ${unit} date-time + + IF $expectedRangeStart != '' + IF $expectedRangeStart == $lrt + ${expectedRangeStart}= Get Least Recent Timestamp From Vehicle Body ${response.json()} + ELSE IF $expectedRangeStart == $mrt + ${expectedRangeStart}= Get Most Recent Timestamp From Vehicle Body ${response.json()} + ELSE + ${expectedRangeStart}= Convert Date ${expectedRangeStart} + END + Check Content Range Part Equal ${expectedRangeStart} ${rangeStart} + END + + IF $expectedRangeEnd != '' + IF $expectedRangeEnd == $lrt + ${expectedRangeEnd}= Get Least Recent Timestamp From Vehicle Body + ... ${response.json()} + ... ${representation} + ELSE IF $expectedRangeEnd == $mrt + ${expectedRangeEnd}= Get Most Recent Timestamp From Vehicle Body + ... ${response.json()} + ... ${representation} + ELSE + ${expectedRangeEnd}= Convert Date ${expectedRangeEnd} + END + Check Content Range Part Equal ${expectedRangeEnd} ${rangeEnd} + END + + IF $expectedSize != '' + Check Content Range Part Equal ${expectedSize} ${size} + END + +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} + +Get Least Recent Timestamp From Vehicle Body + [Arguments] ${body} ${representation}=${EMPTY} + ${attributeList}= Combine Lists ${body}[speed] ${body}[fuelLevel] + ${leastRecentTimestamp}= Convert Date ${timeAfter} + FOR ${attribute} IN @{attributeList} + IF $representation == 'temporalValues' + ${attributeTime}= Convert Date ${attribute}[1] + ELSE + ${attributeTime}= Convert Date ${attribute}[observedAt] + END + + IF $leastRecentTimestamp >= $attributeTime + ${leastRecentTimestamp}= Set Variable ${attributeTime} + END + END + RETURN ${leastRecentTimestamp} + +Get Most Recent Timestamp From Vehicle Body + [Arguments] ${body} ${representation}=${EMPTY} + ${attributeList}= Combine Lists ${body}[speed] ${body}[fuelLevel] + + ${mostRecentTimestamp}= Convert Date ${timeBefore} + FOR ${attribute} IN @{attributeList} + IF $representation == 'temporalValues' + ${attributeTime}= Convert Date ${attribute}[1] + ELSE + ${attributeTime}= Convert Date ${attribute}[observedAt] + END + IF $mostRecentTimestamp <= $attributeTime + ${mostRecentTimestamp}= Set Variable ${attributeTime} + END + END + RETURN ${mostRecentTimestamp} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_14.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_14.robot new file mode 100644 index 0000000000000000000000000000000000000000..6e2d32e0618137a2dd8847062335d89e2c9b3952 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_14.robot @@ -0,0 +1,52 @@ +*** Settings *** +Documentation Check that the time range cut before the second attribute to avoid missing data in content-range + +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}= pagination/2020-01-vehicule-temporal-representation-sixty-instances.jsonld +${timeBefore}= 2019-01-01T01:01:00Z +${timeAfter}= 2021-01-01T01:01:00Z + + +*** Test Cases *** REPRESENTATION EXPECTATION_FILENAME +020_14_01 retrieve an entity with 60 instances of unsynchronized attributes + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + timerel=after timeAt=${timeBefore} emptyAttr=fuelLevel +020_14_02 retrieve the entity with lastN + [Tags] te-retrieve 5_7_3 6_3_10 since_v1.5.1 + lastN=${100} timerel=before timeAt=${timeAfter} emptyAttr=speed + + +*** Keywords *** +Retrieve Temporal Entity + [Documentation] Check that the time range cut before the second attribute + [Arguments] + ... ${timerel} + ... ${timeAt} + ... ${emptyAttr} + ... ${lastN}=${EMPTY} + ${response}= Retrieve Temporal Representation Of Entity + ... temporal_entity_representation_id=${temporal_entity_representation_id} + ... context=${ngsild_test_suite_context} + ... timerel=${timerel} + ... timeAt=${timeAt} + ... lastN=${lastN} + Check Data Is Empty ${response.json()}[${emptyAttr}] + +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/data/entities/fragmentEntities/type-building-fragment.json b/data/entities/fragmentEntities/type-building-fragment.json index aa8f90d1d303414c984875e3a1089c0a2e4cb131..40c43a1631d0c01648fc209fc6a99b799bb5613a 100644 --- a/data/entities/fragmentEntities/type-building-fragment.json +++ b/data/entities/fragmentEntities/type-building-fragment.json @@ -1,6 +1,6 @@ { "type": "Building", "@context": [ - "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + "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/type-vehicle-building-fragment.json b/data/entities/fragmentEntities/type-vehicle-building-fragment.json index 6665997beaf5e84159f2e35f9aa9987b286c469f..6522bbc1fc4be506bcb135c7f9df97317c262994 100644 --- a/data/entities/fragmentEntities/type-vehicle-building-fragment.json +++ b/data/entities/fragmentEntities/type-vehicle-building-fragment.json @@ -1,6 +1,6 @@ { "type": ["Building", "Vehicle"], "@context": [ - "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + "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/type-vehicle-fragment.json b/data/entities/fragmentEntities/type-vehicle-fragment.json index e405afcc50cd5fba781bbfccf3cfec19a913fc5b..040dd88ab2bf73a721f3926667ef71802fc00719 100644 --- a/data/entities/fragmentEntities/type-vehicle-fragment.json +++ b/data/entities/fragmentEntities/type-vehicle-fragment.json @@ -1,6 +1,6 @@ { "type": "Vehicle", "@context": [ - "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + "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/types-vehicle-car-fragment.json b/data/entities/fragmentEntities/types-vehicle-car-fragment.json index fde75e0f690ec04e38274133498868b6a0655f34..6623d2fbc0f34d259f198edf113030b1b8d6afd6 100644 --- a/data/entities/fragmentEntities/types-vehicle-car-fragment.json +++ b/data/entities/fragmentEntities/types-vehicle-car-fragment.json @@ -1,6 +1,6 @@ { "type": ["Vehicle", "Car"], "@context": [ - "https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld" + "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/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld index b25b175deaa34a8b8ea5622758f99fc2f7c006a9..93a5a0fc614fe4ad851bfd84bf8649f0ee5f0561 100644 --- a/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld +++ b/data/temporalEntities/2020-08-vehicule-temporal-representation-multiple-instances-sample.jsonld @@ -2,61 +2,6 @@ "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:07:00Z" - }, - { - "type":"Property", - "value":110, - "observedAt":"2020-08-01T12:09:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:11:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:13:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T12:15:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T12:17:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T12:19:00Z" - }, - { - "type":"Property", - "value":60, - "observedAt":"2020-08-01T12:21:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:23:00Z" - }, { "type":"Property", "value":85, @@ -84,66 +29,6 @@ } ], "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-08-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T14:07:00Z" - }, - { - "type":"Property", - "value":35, - "observedAt":"2020-08-01T14:20:00Z" - }, - { - "type":"Property", - "value":30, - "observedAt":"2020-08-01T15:05:00Z" - }, - { - "type":"Property", - "value":85, - "observedAt":"2020-08-01T15:07:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T15:20:00Z" - }, - { - "type":"Property", - "value":76, - "observedAt":"2020-08-01T16:05:00Z" - }, - { - "type":"Property", - "value":70, - "observedAt":"2020-08-01T17:07:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T18:03:00Z" - }, - { - "type":"Property", - "value":48, - "observedAt":"2020-08-01T19:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T19:07:00Z" - }, { "type":"Property", "value":35, diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld index 0c5cf14aadb6a79cae228a5d41d58460b18ee34f..e00fcbf619f810c88ddf7b937eebbce7056c0b36 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-01-expectation.jsonld @@ -2,36 +2,6 @@ "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", "fuelLevel":[ - { - "type":"Property", - "value":76, - "observedAt":"2020-08-01T16:05:00Z" - }, - { - "type":"Property", - "value":70, - "observedAt":"2020-08-01T17:07:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T18:03:00Z" - }, - { - "type":"Property", - "value":48, - "observedAt":"2020-08-01T19:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T19:07:00Z" - }, - { - "type":"Property", - "value":35, - "observedAt":"2020-08-01T20:05:00Z" - }, { "type":"Property", "value":31, @@ -54,36 +24,6 @@ } ], "speed":[ - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T12:15:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T12:17:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T12:19:00Z" - }, - { - "type":"Property", - "value":60, - "observedAt":"2020-08-01T12:21:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:23:00Z" - }, - { - "type":"Property", - "value":85, - "observedAt":"2020-08-01T12:25:00Z" - }, { "type":"Property", "value":105, diff --git a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld index 421a6ae70ca00895124365b45152875f7e8c2016..cf5c87e57c480768929b6f9e33bc8ecedd67063f 100644 --- a/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicle-temporal-representation-020-05-02-expectation.jsonld @@ -2,66 +2,6 @@ "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", "fuelLevel":[ - { - "type":"Property", - "value":67, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":53, - "observedAt":"2020-08-01T13:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T14:07:00Z" - }, - { - "type":"Property", - "value":35, - "observedAt":"2020-08-01T14:20:00Z" - }, - { - "type":"Property", - "value":30, - "observedAt":"2020-08-01T15:05:00Z" - }, - { - "type":"Property", - "value":85, - "observedAt":"2020-08-01T15:07:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T15:20:00Z" - }, - { - "type":"Property", - "value":76, - "observedAt":"2020-08-01T16:05:00Z" - }, - { - "type":"Property", - "value":70, - "observedAt":"2020-08-01T17:07:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T18:03:00Z" - }, - { - "type":"Property", - "value":48, - "observedAt":"2020-08-01T19:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T19:07:00Z" - }, { "type":"Property", "value":35, @@ -89,61 +29,6 @@ } ], "speed":[ - { - "type":"Property", - "value":120, - "observedAt":"2020-08-01T12:03:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:05:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:07:00Z" - }, - { - "type":"Property", - "value":110, - "observedAt":"2020-08-01T12:09:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:11:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:13:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T12:15:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T12:17:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T12:19:00Z" - }, - { - "type":"Property", - "value":60, - "observedAt":"2020-08-01T12:21:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:23:00Z" - }, { "type":"Property", "value":85, diff --git a/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld index a864acbf128702e331e505e4e1eb4b196b97aa93..d7af771b5534f18babc4b2c57e8b637bd834de94 100644 --- a/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld +++ b/data/temporalEntities/expectations/vehicles-temporal-representation-021-03-expectation.jsonld @@ -3,56 +3,6 @@ "id":"urn:ngsi-ld:Vehicle:randomUUID", "type":"Vehicle", "speed":[ - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:07:00Z" - }, - { - "type":"Property", - "value":110, - "observedAt":"2020-08-01T12:09:00Z" - }, - { - "type":"Property", - "value":100, - "observedAt":"2020-08-01T12:11:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:13:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T12:15:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T12:17:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T12:19:00Z" - }, - { - "type":"Property", - "value":60, - "observedAt":"2020-08-01T12:21:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T12:23:00Z" - }, - { - "type":"Property", - "value":85, - "observedAt":"2020-08-01T12:25:00Z" - }, { "type":"Property", "value":105, @@ -75,56 +25,6 @@ } ], "fuelLevel":[ - { - "type":"Property", - "value":35, - "observedAt":"2020-08-01T14:20:00Z" - }, - { - "type":"Property", - "value":30, - "observedAt":"2020-08-01T15:05:00Z" - }, - { - "type":"Property", - "value":85, - "observedAt":"2020-08-01T15:07:00Z" - }, - { - "type":"Property", - "value":80, - "observedAt":"2020-08-01T15:20:00Z" - }, - { - "type":"Property", - "value":76, - "observedAt":"2020-08-01T16:05:00Z" - }, - { - "type":"Property", - "value":70, - "observedAt":"2020-08-01T17:07:00Z" - }, - { - "type":"Property", - "value":50, - "observedAt":"2020-08-01T18:03:00Z" - }, - { - "type":"Property", - "value":48, - "observedAt":"2020-08-01T19:05:00Z" - }, - { - "type":"Property", - "value":40, - "observedAt":"2020-08-01T19:07:00Z" - }, - { - "type":"Property", - "value":35, - "observedAt":"2020-08-01T20:05:00Z" - }, { "type":"Property", "value":31, diff --git a/data/temporalEntities/pagination/2020-01-vehicule-temporal-representation-sixty-instances.jsonld b/data/temporalEntities/pagination/2020-01-vehicule-temporal-representation-sixty-instances.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..caa82a185460b9e18b670284c05f40f53169f453 --- /dev/null +++ b/data/temporalEntities/pagination/2020-01-vehicule-temporal-representation-sixty-instances.jsonld @@ -0,0 +1,601 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "speed":[ + { + "type":"Property", + "value":1, + "observedAt":"2020-01-01T01:01:00Z" + }, + { + "type":"Property", + "value":2, + "observedAt":"2020-01-01T01:02:00Z" + }, + { + "type":"Property", + "value":3, + "observedAt":"2020-01-01T01:03:00Z" + }, + { + "type":"Property", + "value":4, + "observedAt":"2020-01-01T01:04:00Z" + }, + { + "type":"Property", + "value":5, + "observedAt":"2020-01-01T01:05:00Z" + }, + { + "type":"Property", + "value":6, + "observedAt":"2020-01-01T01:06:00Z" + }, + { + "type":"Property", + "value":7, + "observedAt":"2020-01-01T01:07:00Z" + }, + { + "type":"Property", + "value":8, + "observedAt":"2020-01-01T01:08:00Z" + }, + { + "type":"Property", + "value":9, + "observedAt":"2020-01-01T01:09:00Z" + }, + { + "type":"Property", + "value":10, + "observedAt":"2020-01-01T01:10:00Z" + }, + { + "type":"Property", + "value":11, + "observedAt":"2020-01-01T01:11:00Z" + }, + { + "type":"Property", + "value":12, + "observedAt":"2020-01-01T01:12:00Z" + }, + { + "type":"Property", + "value":13, + "observedAt":"2020-01-01T01:13:00Z" + }, + { + "type":"Property", + "value":14, + "observedAt":"2020-01-01T01:14:00Z" + }, + { + "type":"Property", + "value":15, + "observedAt":"2020-01-01T01:15:00Z" + }, + { + "type":"Property", + "value":16, + "observedAt":"2020-01-01T01:16:00Z" + }, + { + "type":"Property", + "value":17, + "observedAt":"2020-01-01T01:17:00Z" + }, + { + "type":"Property", + "value":18, + "observedAt":"2020-01-01T01:18:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2020-01-01T01:19:00Z" + }, + { + "type":"Property", + "value":20, + "observedAt":"2020-01-01T01:20:00Z" + }, + { + "type":"Property", + "value":21, + "observedAt":"2020-01-01T01:21:00Z" + }, + { + "type":"Property", + "value":22, + "observedAt":"2020-01-01T01:22:00Z" + }, + { + "type":"Property", + "value":23, + "observedAt":"2020-01-01T01:23:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2020-01-01T01:24:00Z" + }, + { + "type":"Property", + "value":25, + "observedAt":"2020-01-01T01:25:00Z" + }, + { + "type":"Property", + "value":26, + "observedAt":"2020-01-01T01:26:00Z" + }, + { + "type":"Property", + "value":27, + "observedAt":"2020-01-01T01:27:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2020-01-01T01:28:00Z" + }, + { + "type":"Property", + "value":29, + "observedAt":"2020-01-01T01:29:00Z" + }, + { + "type":"Property", + "value":30, + "observedAt":"2020-01-01T01:30:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2020-01-01T01:31:00Z" + }, + { + "type":"Property", + "value":32, + "observedAt":"2020-01-01T01:32:00Z" + }, + { + "type":"Property", + "value":33, + "observedAt":"2020-01-01T01:33:00Z" + }, + { + "type":"Property", + "value":34, + "observedAt":"2020-01-01T01:34:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2020-01-01T01:35:00Z" + }, + { + "type":"Property", + "value":36, + "observedAt":"2020-01-01T01:36:00Z" + }, + { + "type":"Property", + "value":37, + "observedAt":"2020-01-01T01:37:00Z" + }, + { + "type":"Property", + "value":38, + "observedAt":"2020-01-01T01:38:00Z" + }, + { + "type":"Property", + "value":39, + "observedAt":"2020-01-01T01:39:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-01-01T01:40:00Z" + }, + { + "type":"Property", + "value":41, + "observedAt":"2020-01-01T01:41:00Z" + }, + { + "type":"Property", + "value":42, + "observedAt":"2020-01-01T01:42:00Z" + }, + { + "type":"Property", + "value":43, + "observedAt":"2020-01-01T01:43:00Z" + }, + { + "type":"Property", + "value":44, + "observedAt":"2020-01-01T01:44:00Z" + }, + { + "type":"Property", + "value":45, + "observedAt":"2020-01-01T01:45:00Z" + }, + { + "type":"Property", + "value":46, + "observedAt":"2020-01-01T01:46:00Z" + }, + { + "type":"Property", + "value":47, + "observedAt":"2020-01-01T01:47:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2020-01-01T01:48:00Z" + }, + { + "type":"Property", + "value":49, + "observedAt":"2020-01-01T01:49:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2020-01-01T01:50:00Z" + }, + { + "type":"Property", + "value":51, + "observedAt":"2020-01-01T01:51:00Z" + }, + { + "type":"Property", + "value":52, + "observedAt":"2020-01-01T01:52:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-01-01T01:53:00Z" + }, + { + "type":"Property", + "value":54, + "observedAt":"2020-01-01T01:54:00Z" + }, + { + "type":"Property", + "value":55, + "observedAt":"2020-01-01T01:55:00Z" + }, + { + "type":"Property", + "value":56, + "observedAt":"2020-01-01T01:56:00Z" + }, + { + "type":"Property", + "value":57, + "observedAt":"2020-01-01T01:57:00Z" + }, + { + "type":"Property", + "value":58, + "observedAt":"2020-01-01T01:58:00Z" + }, + { + "type":"Property", + "value":59, + "observedAt":"2020-01-01T01:59:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":1, + "observedAt":"2020-01-02T01:01:00Z" + }, + { + "type":"Property", + "value":2, + "observedAt":"2020-01-02T01:02:00Z" + }, + { + "type":"Property", + "value":3, + "observedAt":"2020-01-02T01:03:00Z" + }, + { + "type":"Property", + "value":4, + "observedAt":"2020-01-02T01:04:00Z" + }, + { + "type":"Property", + "value":5, + "observedAt":"2020-01-02T01:05:00Z" + }, + { + "type":"Property", + "value":6, + "observedAt":"2020-01-02T01:06:00Z" + }, + { + "type":"Property", + "value":7, + "observedAt":"2020-01-02T01:07:00Z" + }, + { + "type":"Property", + "value":8, + "observedAt":"2020-01-02T01:08:00Z" + }, + { + "type":"Property", + "value":9, + "observedAt":"2020-01-02T01:09:00Z" + }, + { + "type":"Property", + "value":10, + "observedAt":"2020-01-02T01:10:00Z" + }, + { + "type":"Property", + "value":11, + "observedAt":"2020-01-02T01:11:00Z" + }, + { + "type":"Property", + "value":12, + "observedAt":"2020-01-02T01:12:00Z" + }, + { + "type":"Property", + "value":13, + "observedAt":"2020-01-02T01:13:00Z" + }, + { + "type":"Property", + "value":14, + "observedAt":"2020-01-02T01:14:00Z" + }, + { + "type":"Property", + "value":15, + "observedAt":"2020-01-02T01:15:00Z" + }, + { + "type":"Property", + "value":16, + "observedAt":"2020-01-02T01:16:00Z" + }, + { + "type":"Property", + "value":17, + "observedAt":"2020-01-02T01:17:00Z" + }, + { + "type":"Property", + "value":18, + "observedAt":"2020-01-02T01:18:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2020-01-02T01:19:00Z" + }, + { + "type":"Property", + "value":20, + "observedAt":"2020-01-02T01:20:00Z" + }, + { + "type":"Property", + "value":21, + "observedAt":"2020-01-02T01:21:00Z" + }, + { + "type":"Property", + "value":22, + "observedAt":"2020-01-02T01:22:00Z" + }, + { + "type":"Property", + "value":23, + "observedAt":"2020-01-02T01:23:00Z" + }, + { + "type":"Property", + "value":24, + "observedAt":"2020-01-02T01:24:00Z" + }, + { + "type":"Property", + "value":25, + "observedAt":"2020-01-02T01:25:00Z" + }, + { + "type":"Property", + "value":26, + "observedAt":"2020-01-02T01:26:00Z" + }, + { + "type":"Property", + "value":27, + "observedAt":"2020-01-02T01:27:00Z" + }, + { + "type":"Property", + "value":28, + "observedAt":"2020-01-02T01:28:00Z" + }, + { + "type":"Property", + "value":29, + "observedAt":"2020-01-02T01:29:00Z" + }, + { + "type":"Property", + "value":30, + "observedAt":"2020-01-02T01:30:00Z" + }, + { + "type":"Property", + "value":31, + "observedAt":"2020-01-02T01:31:00Z" + }, + { + "type":"Property", + "value":32, + "observedAt":"2020-01-02T01:32:00Z" + }, + { + "type":"Property", + "value":33, + "observedAt":"2020-01-02T01:33:00Z" + }, + { + "type":"Property", + "value":34, + "observedAt":"2020-01-02T01:34:00Z" + }, + { + "type":"Property", + "value":35, + "observedAt":"2020-01-02T01:35:00Z" + }, + { + "type":"Property", + "value":36, + "observedAt":"2020-01-02T01:36:00Z" + }, + { + "type":"Property", + "value":37, + "observedAt":"2020-01-02T01:37:00Z" + }, + { + "type":"Property", + "value":38, + "observedAt":"2020-01-02T01:38:00Z" + }, + { + "type":"Property", + "value":39, + "observedAt":"2020-01-02T01:39:00Z" + }, + { + "type":"Property", + "value":40, + "observedAt":"2020-01-02T01:40:00Z" + }, + { + "type":"Property", + "value":41, + "observedAt":"2020-01-02T01:41:00Z" + }, + { + "type":"Property", + "value":42, + "observedAt":"2020-01-02T01:42:00Z" + }, + { + "type":"Property", + "value":43, + "observedAt":"2020-01-02T01:43:00Z" + }, + { + "type":"Property", + "value":44, + "observedAt":"2020-01-02T01:44:00Z" + }, + { + "type":"Property", + "value":45, + "observedAt":"2020-01-02T01:45:00Z" + }, + { + "type":"Property", + "value":46, + "observedAt":"2020-01-02T01:46:00Z" + }, + { + "type":"Property", + "value":47, + "observedAt":"2020-01-02T01:47:00Z" + }, + { + "type":"Property", + "value":48, + "observedAt":"2020-01-02T01:48:00Z" + }, + { + "type":"Property", + "value":49, + "observedAt":"2020-01-02T01:49:00Z" + }, + { + "type":"Property", + "value":50, + "observedAt":"2020-01-02T01:50:00Z" + }, + { + "type":"Property", + "value":51, + "observedAt":"2020-01-02T01:51:00Z" + }, + { + "type":"Property", + "value":52, + "observedAt":"2020-01-02T01:52:00Z" + }, + { + "type":"Property", + "value":53, + "observedAt":"2020-01-02T01:53:00Z" + }, + { + "type":"Property", + "value":54, + "observedAt":"2020-01-02T01:54:00Z" + }, + { + "type":"Property", + "value":55, + "observedAt":"2020-01-02T01:55:00Z" + }, + { + "type":"Property", + "value":56, + "observedAt":"2020-01-02T01:56:00Z" + }, + { + "type":"Property", + "value":57, + "observedAt":"2020-01-02T01:57:00Z" + }, + { + "type":"Property", + "value":58, + "observedAt":"2020-01-02T01:58:00Z" + }, + { + "type":"Property", + "value":59, + "observedAt":"2020-01-02T01:59: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/data/temporalEntities/pagination/2020-01-vehicule-temporal-representation-twenty-instances.jsonld b/data/temporalEntities/pagination/2020-01-vehicule-temporal-representation-twenty-instances.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..05e9ba095374909a707e9c44bde2dc1f14ebc65a --- /dev/null +++ b/data/temporalEntities/pagination/2020-01-vehicule-temporal-representation-twenty-instances.jsonld @@ -0,0 +1,211 @@ +{ + "id":"urn:ngsi-ld:Vehicle:randomUUID", + "type":"Vehicle", + "speed":[ + { + "type":"Property", + "value":1, + "observedAt":"2020-01-01T01:01:00Z" + }, + { + "type":"Property", + "value":2, + "observedAt":"2020-01-01T01:02:00Z" + }, + { + "type":"Property", + "value":3, + "observedAt":"2020-01-01T01:03:00Z" + }, + { + "type":"Property", + "value":4, + "observedAt":"2020-01-01T01:04:00Z" + }, + { + "type":"Property", + "value":5, + "observedAt":"2020-01-01T01:05:00Z" + }, + { + "type":"Property", + "value":6, + "observedAt":"2020-01-01T01:06:00Z" + }, + { + "type":"Property", + "value":7, + "observedAt":"2020-01-01T01:07:00Z" + }, + { + "type":"Property", + "value":8, + "observedAt":"2020-01-01T01:08:00Z" + }, + { + "type":"Property", + "value":9, + "observedAt":"2020-01-01T01:09:00Z" + }, + { + "type":"Property", + "value":10, + "observedAt":"2020-01-01T01:10:00Z" + }, + { + "type":"Property", + "value":11, + "observedAt":"2020-01-01T01:11:00Z" + }, + { + "type":"Property", + "value":12, + "observedAt":"2020-01-01T01:12:00Z" + }, + { + "type":"Property", + "value":13, + "observedAt":"2020-01-01T01:13:00Z" + }, + { + "type":"Property", + "value":14, + "observedAt":"2020-01-01T01:14:00Z" + }, + { + "type":"Property", + "value":15, + "observedAt":"2020-01-01T01:15:00Z" + }, + { + "type":"Property", + "value":16, + "observedAt":"2020-01-01T01:16:00Z" + }, + { + "type":"Property", + "value":17, + "observedAt":"2020-01-01T01:17:00Z" + }, + { + "type":"Property", + "value":18, + "observedAt":"2020-01-01T01:18:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2020-01-01T01:19:00Z" + }, + { + "type":"Property", + "value":20, + "observedAt":"2020-01-01T01:20:00Z" + } + ], + "fuelLevel":[ + { + "type":"Property", + "value":1, + "observedAt":"2020-01-01T01:03:00Z" + }, + { + "type":"Property", + "value":2, + "observedAt":"2020-01-01T01:04:00Z" + }, + { + "type":"Property", + "value":3, + "observedAt":"2020-01-01T01:05:00Z" + }, + { + "type":"Property", + "value":4, + "observedAt":"2020-01-01T01:06:00Z" + }, + { + "type":"Property", + "value":5, + "observedAt":"2020-01-01T01:07:00Z" + }, + { + "type":"Property", + "value":6, + "observedAt":"2020-01-01T01:08:00Z" + }, + { + "type":"Property", + "value":7, + "observedAt":"2020-01-01T01:09:00Z" + }, + { + "type":"Property", + "value":8, + "observedAt":"2020-01-01T01:10:00Z" + }, + { + "type":"Property", + "value":9, + "observedAt":"2020-01-01T01:11:00Z" + }, + { + "type":"Property", + "value":10, + "observedAt":"2020-01-01T01:12:00Z" + }, + { + "type":"Property", + "value":11, + "observedAt":"2020-01-01T01:13:00Z" + }, + { + "type":"Property", + "value":12, + "observedAt":"2020-01-01T01:14:00Z" + }, + { + "type":"Property", + "value":13, + "observedAt":"2020-01-01T01:15:00Z" + }, + { + "type":"Property", + "value":14, + "observedAt":"2020-01-01T01:16:00Z" + }, + { + "type":"Property", + "value":15, + "observedAt":"2020-01-01T01:17:00Z" + }, + { + "type":"Property", + "value":16, + "observedAt":"2020-01-01T01:18:00Z" + }, + { + "type":"Property", + "value":17, + "observedAt":"2020-01-01T01:19:00Z" + }, + { + "type":"Property", + "value":18, + "observedAt":"2020-01-01T01:20:00Z" + }, + { + "type":"Property", + "value":19, + "observedAt":"2020-01-01T01:21:00Z" + }, + { + "type":"Property", + "value":20, + "observedAt":"2020-01-01T01:22: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/checks.py b/doc/analysis/checks.py index d0b4f7ce4e96dead300c995f3027e74ec316a7e2..cda630ac152c2d51818b706b9bfc6c1a9ec7adad 100644 --- a/doc/analysis/checks.py +++ b/doc/analysis/checks.py @@ -143,8 +143,12 @@ class Checks: 'Check Message Contain Key': Checks.check_message_contain_key, 'Check Message Field Equal': - Checks.check_message_field_equal - } + Checks.check_message_field_equal, + 'Check Content Range Part Equal': + Checks.check_content_range_part_equal, + 'Check Data Is Empty': + Checks.check_data_is_empty + } self.args = { 'Check Response Status Code': { @@ -417,7 +421,15 @@ class Checks: 'Check Message Field Equal': { 'params': ['expected_field', 'field'], 'position': [0,1] - } + }, + 'Check Content Range Part Equal': { + 'params': ['expected_part' , 'part'], + 'position': [0, 1] + }, + 'Check Data Is Empty':{ + 'params': ['data'], + 'position': [0] + }, } @staticmethod @@ -1150,6 +1162,25 @@ class Checks: else: raise Exception(f"ERROR, Expected the field to be equal 'expected_field' but received: '{kwargs}'") + @staticmethod + def check_content_range_part_equal(kwargs: list) -> str: + if 'expected_part' in kwargs and 'part' in kwargs: + expected_part = kwargs['expected_part'] + part = kwargs['part'] + return f'Content range part {part} equals {expected_part}' + else: + raise Exception(f"ERROR, Expected 'expected_part' but received: '{kwargs}'") + + @staticmethod + def check_data_is_empty(kwargs: list) -> str: + if 'data' in kwargs : + data = kwargs['data'] + return f'data is empty : {data}' + else: + raise Exception(f"ERROR, Expected empty data but received: '{kwargs}'") + + + def get_checks(self, **kwargs) -> str: checking = None diff --git a/doc/analysis/requests.py b/doc/analysis/requests.py index 1e93fb0bda271d458c46e106643d9ea1d0d4bda3..d76c4308c492c2a1f99e62e1f7e1d37610d4ff2f 100644 --- a/doc/analysis/requests.py +++ b/doc/analysis/requests.py @@ -61,7 +61,7 @@ class Requests: 'positions': [], 'params': ['context', 'entity_types', 'entity_ids', 'entity_id_pattern', 'ngsild_query', 'csf', 'georel', 'geometry', - 'coordinates', 'geoproperty', 'timerel', 'timeAt', + 'coordinates', 'geoproperty', 'timerel', 'timeAt', 'endTimeAt', 'attrs', 'limit', 'lastN', 'accept', 'options'] }, 'Query Temporal Representation Of Entities Via Post': { @@ -1088,7 +1088,7 @@ class Requests: # in the same position, so we make a different analysis to extract the values expected_parameters = ['context', 'entity_types', 'entity_ids', 'entity_id_pattern', 'ngsild_query', 'csf', 'georel', 'geometry', - 'coordinates', 'geoproperty', 'timerel', 'timeAt', + 'coordinates', 'geoproperty', 'timerel', 'timeAt','endTimeAt', 'attrs', 'limit', 'lastN', 'accept', 'options'] result = [x for x in kwargs if x not in expected_parameters] @@ -1119,12 +1119,15 @@ class Requests: response = f"{response} and\n Query Parameter: timerel set to '{value}'" case 'timeAt': response = f"{response} and\n Query Parameter: timeAt set to '{value}'" + case 'endTimeAt': + response = f"{response} and\n Query Parameter: endTimeAt set to '{value}'" case 'attrs': response = f"{response} and\n Query Parameter: attrs set to '{value}'" case 'limit': response = f"{response} and\n Query Parameter: limit set to '{value}'" case 'lastN': - value = re.search(pattern=r'\d+', string=value).group() + if re.search(pattern=r'\d+', string=value): + value = re.search(pattern=r'\d+', string=value).group() response = f"{response} and\n Query Parameter: lastN set to '{value}'" case 'accept': response = f"{response} and\n Query Parameter: accept set to '{value}'" @@ -1162,7 +1165,8 @@ class Requests: case 'endTimeAt': response = f"{response} and\n Query Parameter: endTimeAt set to '{value}'" case 'lastN': - value = re.search(pattern=r'\d+', string=value).group() + if re.search(pattern=r'\d+', string=value): + value = re.search(pattern=r'\d+', string=value).group() response = f"{response} and\n Query Parameter: lastN set to '{value}'" case 'accept': response = f"{response} and\n Query Parameter: accept set to '{value}'" diff --git a/doc/files/ContextInformation/Consumption/020_05.json b/doc/files/ContextInformation/Consumption/020_05.json index b47b46515ffa48e0b8417c11e9a2eaf3c4543cc6..09ad03930e575833bdc3aad24b8a32858bb1c8ec 100644 --- a/doc/files/ContextInformation/Consumption/020_05.json +++ b/doc/files/ContextInformation/Consumption/020_05.json @@ -1,6 +1,6 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_05", - "test_objective": "Check that you can retrieve the temporal evolution of the last N instances of entity attributes", + "test_objective": "Check that one can retrieve the temporal evolution of the last N instances of entity attributes", "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.3", "config_id": "", "parent_release": "v1.3.1", @@ -19,7 +19,7 @@ { "name": "020_05_01 Retrieve Some Instances", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_05_01", - "doc": "Check that you can retrieve the temporal evolution of the last N instances of entity attributes", + "doc": "Check that one can retrieve the temporal evolution of the last N instances of entity attributes", "tags": [ "5_7_3", "te-retrieve" @@ -28,14 +28,14 @@ "teardown": "Delete Initial Temporal Entity", "template": "Retrieve the temporal evolution of the last N instances of entity attributes", "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-temporal-representation-020-05-01-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: lastN set to '10' 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}", + "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: lastN set to '4' 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_05_02 Retrieve All Instances", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_05_02", - "doc": "Check that you can retrieve the temporal evolution of the last N instances of entity attributes", + "doc": "Check that one can retrieve the temporal evolution of the last N instances of entity attributes", "tags": [ "5_7_3", "te-retrieve" @@ -44,7 +44,7 @@ "teardown": "Delete Initial Temporal Entity", "template": "Retrieve the temporal evolution of the last N instances of entity attributes", "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-temporal-representation-020-05-02-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: lastN set to '20' 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}", + "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: lastN set to '7' 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}" } diff --git a/doc/files/ContextInformation/Consumption/020_13.json b/doc/files/ContextInformation/Consumption/020_13.json new file mode 100644 index 0000000000000000000000000000000000000000..29365ed6d8c172781210ae50c5fd27a3bfd07294 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_13.json @@ -0,0 +1,208 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13", + "test_objective": "Check temporal pagination is applied when retrieving the temporal evolution of an entity", + "reference": "ETSI GS CIM 009 V1.5.1 [], clauses 5.7.3, 6.3.10", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.7.3", + "6.3.10" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Temporal Entity", + "Create Temporal Entity", + "Delete Initial Temporal Entity", + "Get Least Recent Timestamp From Vehicle Body", + "Get Most Recent Timestamp From Vehicle Body" + ], + "teardown": "Delete Initial Temporal Entity", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "020_13_01 retrieve an entity with 20 instances on two attributes", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_01", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_02 retrieve the entity with lastN", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_02", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'lastN=${20}' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_03 retrieve the entity with lastN and timerel before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_03", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'lastN=${20}' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_04 retrieve the entity with lastN and timerel between", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_04", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'lastN=${20}' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_05 retrieve the entity with lastN and timerel after", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_05", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'lastN=${20}' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_06 retrieve the entity with timerel before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_06", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'timerel=before' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_07 retrieve the entity with timerel between", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_07", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'timerel=between' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_08 retrieve the entity with timerel after", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_08", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'timerel=after' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_09 retrieve the entity with temporalValues and timerel after", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_09", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'representation=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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_13_10 retrieve the entity with temporalValues, lastN and timerel between", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_13_10", + "doc": "Check temporal pagination behavior", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.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 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\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 'representation=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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_13" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/020_14.json b/doc/files/ContextInformation/Consumption/020_14.json new file mode 100644 index 0000000000000000000000000000000000000000..c70fa98c8f653d3b3f58297ab8a8c6aa370d12f4 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/020_14.json @@ -0,0 +1,60 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/020_14", + "test_objective": "Check that the time range cut before the second attribute to avoid missing data in content-range", + "reference": "ETSI GS CIM 009 V1.5.1 [], clauses 5.7.3, 6.3.10", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.7.3", + "6.3.10" + ], + "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_14_01 retrieve an entity with 60 instances of unsynchronized attributes", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_14_01", + "doc": "Check that the time range cut before the second attribute", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Temporal Representation Of Entity with data is empty : ${response.json()}[${emptyAttr}]\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: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + }, + { + "name": "020_14_02 retrieve the entity with lastN", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_14_02", + "doc": "Check that the time range cut before the second attribute", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entity", + "then": "then {\n the SUT sends a valid Response for the operation:\n Retrieve Temporal Representation Of Entity with data is empty : ${response.json()}[${emptyAttr}]\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: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities/{temporal_entity_representation_id}" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity", + "robotfile": "020_14" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_03.json b/doc/files/ContextInformation/Consumption/021_03.json index 21060d4e6e19763a214b2490be9e38d652e84ea3..a59efe3cdb056c64c0d2f561136277ce387425dc 100644 --- a/doc/files/ContextInformation/Consumption/021_03.json +++ b/doc/files/ContextInformation/Consumption/021_03.json @@ -1,6 +1,6 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_03", - "test_objective": "Check that you can query the temporal evolution of the last N instances of entities attributes", + "test_objective": "Check that one can query the temporal evolution of the last N instances of entities attributes", "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", "config_id": "", "parent_release": "v1.3.1", @@ -18,7 +18,7 @@ { "name": "021_03_01 Query the temporal evolution of the last N instances of entities attributes", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_03_01", - "doc": "Check that you can query the temporal evolution of the last N instances of entities attributes", + "doc": "Check that one can query the temporal evolution of the last N instances of entities attributes", "tags": [ "5_7_4", "te-query" @@ -27,7 +27,7 @@ "teardown": null, "template": null, "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-03-expectation.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: lastN set to '14' 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}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: lastN set to '4' 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" } diff --git a/doc/files/ContextInformation/Consumption/021_15.json b/doc/files/ContextInformation/Consumption/021_15.json new file mode 100644 index 0000000000000000000000000000000000000000..b926c08c02beef0d950b7ab6dfba63dbfa1dc4c5 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_15.json @@ -0,0 +1,172 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15", + "test_objective": "Check temporal pagination is applied when querying the temporal evolution of entities", + "reference": "ETSI GS CIM 009 V1.5.1 [], clauses 5.7.4, 6.3.10", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.7.4", + "6.3.10" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Temporal Entities", + "Setup Initial Entities", + "Delete Initial Entities", + "Get Least Recent Timestamp From Vehicles", + "Get Most Recent Timestamp From Vehicles" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_15_01 retrieve the entity with lastN and timerel before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15_01", + "doc": "Check temporal pagination behavior on multiple entity endpoint", + "tags": [ + "5_7_4", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'lastN=${20}' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_15_02 retrieve the entity with lastN and timerel between", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15_02", + "doc": "Check temporal pagination behavior on multiple entity endpoint", + "tags": [ + "5_7_4", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'lastN=${20}' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_15_03 retrieve the entity with lastN and timerel after", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15_03", + "doc": "Check temporal pagination behavior on multiple entity endpoint", + "tags": [ + "5_7_4", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'lastN=${20}' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_15_04 retrieve the entity with timerel before", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15_04", + "doc": "Check temporal pagination behavior on multiple entity endpoint", + "tags": [ + "5_7_4", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'timerel=before' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_15_05 retrieve the entity with timerel between", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15_05", + "doc": "Check temporal pagination behavior on multiple entity endpoint", + "tags": [ + "5_7_4", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'timerel=between' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_15_06 retrieve the entity with timerel after", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15_06", + "doc": "Check temporal pagination behavior on multiple entity endpoint", + "tags": [ + "5_7_4", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'timerel=after' 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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_15_07 retrieve the entity with temporalValues and timerel after", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15_07", + "doc": "Check temporal pagination behavior on multiple entity endpoint", + "tags": [ + "5_7_4", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'representation=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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + }, + { + "name": "021_15_08 retrieve the entity with temporalValues, lastN and timerel between", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_15_08", + "doc": "Check temporal pagination behavior on multiple entity endpoint", + "tags": [ + "5_7_4", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit} and\n Notification with Content range part ${rangeStart} equals ${expectedRangeStart} and\n Notification with Content range part ${rangeEnd} equals ${expectedRangeEnd} and\n Notification with Content range part ${size} equals ${expectedSize}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: options set to 'representation=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' and\n Query Parameter: timerel set to '${timerel}' and\n Query Parameter: timeAt set to '${timeAt}' and\n Query Parameter: endTimeAt set to '${endTimeAt}' and\n Query Parameter: lastN set to '${lastN}'\n}", + "http_verb": "GET", + "endpoint": "temporal/entities" + } + ], + "permutations": [ + "when" + ], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_15" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_16.json b/doc/files/ContextInformation/Consumption/021_16.json new file mode 100644 index 0000000000000000000000000000000000000000..dc5c26aa640f7d16c1a19f848b33a0cba1afa847 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/021_16.json @@ -0,0 +1,42 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_16", + "test_objective": "Check temporal pagination is applied when querying the temporal evolution of entities via POST", + "reference": "ETSI GS CIM 009 V1.5.1 [], clauses 5.7.3, 6.3.10", + "config_id": "", + "parent_release": "v1.5.1", + "clauses": [ + "5.7.3", + "6.3.10" + ], + "pics_selection": "", + "keywords": [ + "Retrieve Temporal Entities Via Post", + "Setup Initial Entities", + "Delete Initial Entities" + ], + "teardown": "Delete Initial Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "021_16_01 retrieve the entities via post", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_16_01", + "doc": "Check that temporal pagination is triggered on the post temporal query", + "tags": [ + "5_7_3", + "6_3_10", + "since_v1.5.1", + "te-retrieve" + ], + "setup": null, + "teardown": null, + "template": "Retrieve Temporal Entities Via Post", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities Via Post with Response Status Code set to 206 and\n Notification with Content range part date-time equals ${unit}\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entityOperations/query'\n method set to 'POST'\n Query Temporal Representation of Entities Via POST Request: and\n Query Parameter: query_file_name set to '${payload_file}' 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: content_type set to 'application/json'\n}", + "http_verb": "POST", + "endpoint": "temporal/entityOperations/query" + } + ], + "permutations": [], + "robotpath": "ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities", + "robotfile": "021_16" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Provision/011_06.json b/doc/files/ContextInformation/Provision/011_06.json index b31fbadf69dbcf72f2528e6863d79759bd0819c2..9a88573585dd279679fa34e348b7c2df4975af4b 100644 --- a/doc/files/ContextInformation/Provision/011_06.json +++ b/doc/files/ContextInformation/Provision/011_06.json @@ -30,7 +30,7 @@ "teardown": "Delete Initial Entity", "template": null, "then": "then {\n the SUT sends a valid Response for the operations:\n Update Entity Attributes with Response Status Code set to 204 and\n Update Entity Attributes with Check Updated Entity and\n Query Parameter: 'ignored_keys' set to '${None}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: context set to 'https://easy-global-market.github.io/ngsild-api-data-models/ngsildTestSuite/ngsildTestSuiteV1.8-compound.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/'\n method set to 'GET'\n Request Retrieve Entity by Id and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/json' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "GET", "endpoint": "" } diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py index a4c28356b361e0e83d558e94184725ad715d4b48..ec9b25b4cb2acfa432f78328f11943d283f66b8b 100644 --- a/doc/tests/test_ContextInformation_Consumption.py +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -411,6 +411,19 @@ class TestCIConsumptions(TestCase): expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_14.json' difference_file = f'{self.folder_test_suites}/doc/results/out_021_14.json' + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_021_15(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_15.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_15.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_15.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_021_16(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_16.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/021_16.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_021_16.json' + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) def test_020_01(self): @@ -496,3 +509,17 @@ class TestCIConsumptions(TestCase): 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) + + def test_020_13(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_13.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_13.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_13.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_020_14(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_14.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/020_14.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_020_14.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) diff --git a/resources/ApiUtils/TemporalContextInformationConsumption.resource b/resources/ApiUtils/TemporalContextInformationConsumption.resource index 4da46170575810a5c9bc53b93008dd65978fb637..cb32d18a8d6a12320c3f7b72c5ce552c9b934560 100755 --- a/resources/ApiUtils/TemporalContextInformationConsumption.resource +++ b/resources/ApiUtils/TemporalContextInformationConsumption.resource @@ -33,6 +33,7 @@ Query Temporal Representation Of Entities ... ${geoproperty}=${EMPTY} ... ${timerel}=${EMPTY} ... ${timeAt}=${EMPTY} + ... ${endTimeAt}=${EMPTY} ... ${attrs}=${EMPTY} ... ${limit}=${EMPTY} ... ${lastN}=${EMPTY} @@ -59,6 +60,9 @@ Query Temporal Representation Of Entities Set To Dictionary ${params} timerel=${timerel} END IF '${timeAt}'!='' Set To Dictionary ${params} timeAt=${timeAt} + IF '${endTimeAt}'!='' + Set To Dictionary ${params} endTimeAt=${endTimeAt} + END IF ${attrs_length}>0 Set To Dictionary ${params} attrs=${attrs} IF '${lastN}'!='' Set To Dictionary ${params} lastN=${lastN} IF '${entity_id_pattern}'!='' diff --git a/resources/AssertionUtils.resource b/resources/AssertionUtils.resource index 63181b6d7c2c79815c96d62db3f3c5407ee43e73..6bac6741c33066c97e0246de9ce4ac979b2fb03d 100755 --- a/resources/AssertionUtils.resource +++ b/resources/AssertionUtils.resource @@ -760,6 +760,14 @@ Check Context Response Body Containing a JSONObject with details of a Implicitly # Check that there is no other keys Check Context Detailed Information Keys ${response}[0] +Check Content Range Part Equal + [Arguments] ${expectedPart} ${part} + Should Be Equal As Strings ${expectedPart} ${part} + +Check Data Is Empty + [Arguments] ${data} + Should Be Empty ${data} + Check Messages Contain One Instance [Arguments] ${messages} Length Should Be ${messages} 1