Commit 590f55a7 authored by Houcem Kacem's avatar Houcem Kacem
Browse files

feat: complete implementation of tps of retrieve temporal evolution of entity

parents 95138a6f c3afa121
Loading
Loading
Loading
Loading
+4 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities

*** Variable ***
${vehicule_id_prefix}=  urn:ngsi-ld:Vehicle:
@@ -21,10 +22,11 @@ Retrieve the temporal evolution of an entity
    Check Response Status Code Set To  200
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}

    #TODO Call Delete Temporal Representation Of Entity

*** Keywords ***
Setup Initial Entities
    ${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 Entities
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+4 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities

*** Variable ***
${vehicule_id_prefix}=  urn:ngsi-ld:Vehicle:
@@ -21,10 +22,11 @@ Retrieve the temporal evolution of an entity using a context
    Check Response Status Code Set To  200
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}

    #TODO Call Delete Temporal Representation Of Entity

*** Keywords ***
Setup Initial Entities
    ${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 Entities
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+4 −2
Original line number Diff line number Diff line
@@ -5,6 +5,7 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities

*** Variable ***
${vehicule_id_prefix}=  urn:ngsi-ld:Vehicle:
@@ -22,10 +23,11 @@ Retrieve the temporal evolution of certain attributes of an entity
    Check Response Status Code Set To  200
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}

    #TODO Call Delete Temporal Representation Of Entity

*** Keywords ***
Setup Initial Entities
    ${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 Entities
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+6 −5
Original line number Diff line number Diff line
@@ -5,32 +5,33 @@ Resource ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Template  Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query

*** Variable ***
${vehicule_id_prefix}=  urn:ngsi-ld:Vehicle:
${vehicle_payload_file}=  vehicule-temporal-representation-sample.jsonld

*** Test Cases ***                        TIMEREL       TIME                      ENDTIME                   VEHICLE_EXPECTATION_FILE
*** Test Cases ***                        TIMEREL       TIMEAT                      ENDTIMEAT                   VEHICLE_EXPECTATION_FILE
After                                     after         2018-08-01T13:03:00Z        ${EMPTY}                vehicle-temporal-representation-020-04-01-expectation.jsonld
Before                                    before        2018-08-01T12:05:00Z        ${EMPTY}                vehicle-temporal-representation-020-04-02-expectation.jsonld
Between                                   between       2018-08-01T12:00:00Z        2018-08-01T13:00:00Z    vehicle-temporal-representation-020-04-03-expectation.jsonld

*** Keywords ***
Retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query
    [Arguments]  ${timerel}     ${time}   ${endTime}    ${vehicle_expectation_file}
    [Arguments]  ${timerel}     ${timeAt}   ${endTimeAt}    ${vehicle_expectation_file}
    [Documentation]  Check that you can retrieve the temporal evolution of an entity matching the given NGSI-LD temporal query
    [Tags]  mandatory

    Retrieve Temporal Representation Of Entity   ${temporal_entity_representation_id}   timerel=${timerel}      time=${time}    endTime=${endTime}  context=${ngsild_test_suite_context}
    Retrieve Temporal Representation Of Entity   ${temporal_entity_representation_id}   timerel=${timerel}      timeAt=${timeAt}    endTimeAt=${endTimeAt}  context=${ngsild_test_suite_context}
    
    Check Response Status Code Set To  200
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}


Setup Initial Entities
    ${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}

#TODO Call Suite Teardown
 No newline at end of file
Delete Initial Entities
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
+36 −0
Original line number Diff line number Diff line
*** Settings ***
Documentation   Check that you can retrieve the temporal evolution of the last N instances of entity attributes
Resource    ${EXECDIR}/resources/ApiUtils.resource
Resource    ${EXECDIR}/resources/AssertionUtils.resource
Resource    ${EXECDIR}/resources/JsonUtils.resource

Suite Setup      Setup Initial Entities
Suite Teardown      Delete Initial Entities
Test Template  Retrieve the temporal evolution of the last N instances of entity attributes

*** Variable ***
${vehicule_id_prefix}=  urn:ngsi-ld:Vehicle:
${vehicle_payload_file}=  vehicule-temporal-representation-multiple-instances-sample.jsonld

*** Test Cases ***          LASTN     VEHICLE_EXPECTATION_FILE
Retrieve Some Instances     ${10}        vehicle-temporal-representation-020-05-01-expectation.jsonld
Retrieve All Instances      ${20}        vehicle-temporal-representation-020-05-02-expectation.jsonld

*** Keywords ***
Retrieve the temporal evolution of the last N instances of entity attributes
    [Arguments]  ${lastN}     ${vehicle_expectation_file}
    [Documentation]  Check that you can retrieve the temporal evolution of the last N instances of entity attributes
    [Tags]  mandatory

    Retrieve Temporal Representation Of Entity   ${temporal_entity_representation_id}   lastN=${lastN}  context=${ngsild_test_suite_context}
    
    Check Response Status Code Set To  200
    Check Response Body Containing EntityTemporal element       ${vehicle_expectation_file}    ${temporal_entity_representation_id}

Setup Initial Entities
    ${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 Entities
    Delete Temporal Representation Of Entity    ${temporal_entity_representation_id}
Loading