Loading TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +1 −1 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ ${expectation_file}= vehicles-temporal-representation-021-03.json ... 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 Loading TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_15.robot 0 → 100644 +190 −0 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_15.robot: 190 added lines, 0 removed lines. Original line number Diff line number Diff line *** 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-vehicle-temporal-representation.jsonld ${timeBefore}= 2019-01-01T01:01:00Z ${timeAfter}= 2021-01-01T01:01:00Z ${lrt}= least recent timestamp ${mrt}= most recent timestamp *** Test Cases *** 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} ${response}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} ${response}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} 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}= Get Attribute List From Vehicle Body ${body} ${representation} ${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}= Get Attribute List From Vehicle Body ${body} ${representation} ${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} Get Attribute List From Vehicle Body [Arguments] ${body} ${representation}=${EMPTY} IF $representation == 'temporalValues' ${attributeList}= Combine Lists ... ${body}[0][speed][values] ... ${body}[0][fuelLevel][values] ... ${body}[1][speed][values] ... ${body}[1][fuelLevel][values] ELSE ${attributeList}= Combine Lists ... ${body}[0][speed] ... ${body}[0][fuelLevel] ... ${body}[1][speed] ... ${body}[1][fuelLevel] END RETURN ${attributeList} TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_16.robot 0 → 100644 +66 −0 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_16.robot: 66 added lines, 0 removed lines. Original line number Diff line number Diff line *** 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-vehicle-temporal-representation.jsonld *** Test Cases *** PAYLOAD_FILE 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} ${response}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} ${response}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} 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} TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +2 −2 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -19,10 +19,10 @@ ${vehicle_payload_file}= 2020-08-vehicle-temporal-representation-multiple-ins *** 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.jsonld ${4} vehicle-temporal-representation-020-05-01.jsonld 020_05_02 Retrieve All Instances [Tags] te-retrieve 5_7_3 ${20} vehicle-temporal-representation-020-05-02.jsonld ${7} vehicle-temporal-representation-020-05-02.jsonld *** Keywords *** Loading TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_13.robot 0 → 100644 +176 −0 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_13.robot: 176 added lines, 0 removed lines. Original line number Diff line number Diff line *** 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 *** 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} ${response}= Create Temporal Representation Of Entity ... ${vehicle_payload_file} ... ${temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} 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}= Get Attribute List From Vehicle Body ${body} ${representation} ${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}= Get Attribute List From Vehicle Body ${body} ${representation} ${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} Get Attribute List From Vehicle Body [Arguments] ${body} ${representation}=${EMPTY} IF $representation == 'temporalValues' ${attributeList}= Combine Lists ${body}[speed][values] ${body}[fuelLevel][values] ELSE ${attributeList}= Combine Lists ${body}[speed] ${body}[fuelLevel] END RETURN ${attributeList} Loading
TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot +1 −1 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_03.robot: 1 added line, 1 removed line. Original line number Diff line number Diff line Loading @@ -27,7 +27,7 @@ ${expectation_file}= vehicles-temporal-representation-021-03.json ... 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 Loading
TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_15.robot 0 → 100644 +190 −0 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_15.robot: 190 added lines, 0 removed lines. Original line number Diff line number Diff line *** 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-vehicle-temporal-representation.jsonld ${timeBefore}= 2019-01-01T01:01:00Z ${timeAfter}= 2021-01-01T01:01:00Z ${lrt}= least recent timestamp ${mrt}= most recent timestamp *** Test Cases *** 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} ${response}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} ${response}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} 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}= Get Attribute List From Vehicle Body ${body} ${representation} ${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}= Get Attribute List From Vehicle Body ${body} ${representation} ${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} Get Attribute List From Vehicle Body [Arguments] ${body} ${representation}=${EMPTY} IF $representation == 'temporalValues' ${attributeList}= Combine Lists ... ${body}[0][speed][values] ... ${body}[0][fuelLevel][values] ... ${body}[1][speed][values] ... ${body}[1][fuelLevel][values] ELSE ${attributeList}= Combine Lists ... ${body}[0][speed] ... ${body}[0][fuelLevel] ... ${body}[1][speed] ... ${body}[1][fuelLevel] END RETURN ${attributeList}
TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_16.robot 0 → 100644 +66 −0 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_16.robot: 66 added lines, 0 removed lines. Original line number Diff line number Diff line *** 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-vehicle-temporal-representation.jsonld *** Test Cases *** PAYLOAD_FILE 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} ${response}= Create Temporal Representation Of Entity ... ${first_vehicle_payload_file} ... ${first_temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} ${response}= Create Temporal Representation Of Entity ... ${second_vehicle_payload_file} ... ${second_temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} 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}
TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot +2 −2 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_05.robot: 2 added lines, 2 removed lines. Original line number Diff line number Diff line Loading @@ -19,10 +19,10 @@ ${vehicle_payload_file}= 2020-08-vehicle-temporal-representation-multiple-ins *** 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.jsonld ${4} vehicle-temporal-representation-020-05-01.jsonld 020_05_02 Retrieve All Instances [Tags] te-retrieve 5_7_3 ${20} vehicle-temporal-representation-020-05-02.jsonld ${7} vehicle-temporal-representation-020-05-02.jsonld *** Keywords *** Loading
TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_13.robot 0 → 100644 +176 −0 Viewed Changes for TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity/020_13.robot: 176 added lines, 0 removed lines. Original line number Diff line number Diff line *** 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 *** 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} ${response}= Create Temporal Representation Of Entity ... ${vehicle_payload_file} ... ${temporal_entity_representation_id} Check Response Status Code 201 ${response.status_code} 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}= Get Attribute List From Vehicle Body ${body} ${representation} ${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}= Get Attribute List From Vehicle Body ${body} ${representation} ${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} Get Attribute List From Vehicle Body [Arguments] ${body} ${representation}=${EMPTY} IF $representation == 'temporalValues' ${attributeList}= Combine Lists ${body}[speed][values] ${body}[fuelLevel][values] ELSE ${attributeList}= Combine Lists ${body}[speed] ${body}[fuelLevel] END RETURN ${attributeList}