Commit d21a355c authored by Andrea Il Grande's avatar Andrea Il Grande
Browse files

Changed 'Suite Setup' and 'Suite Teardown' into 'Test Setup' and 'Test...

Changed 'Suite Setup' and 'Suite Teardown' into 'Test Setup' and 'Test Teardown' and added new Setup keywords in 'initial_setup.py'
parent bd4ee7ad
Loading
Loading
Loading
Loading
+4 −4
Original line number Original line Diff line number Diff line
@@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Setup         Setup Entity On Remote And Registration
Test Setup         Setup Entity Id And Registration
Suite Teardown      Delete Created Entity And Registration
Test Teardown      Delete Created Entities And Registration




*** Variables ***
*** Variables ***
@@ -34,7 +34,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi




*** Keywords ***
*** Keywords ***
Setup Entity On Remote And Registration
Setup Entity Id And Registration
    ${entity_id}=    Generate Random Entity Id    ${entity_id_prefix}
    ${entity_id}=    Generate Random Entity Id    ${entity_id_prefix}
    Set Suite Variable    ${entity_id}
    Set Suite Variable    ${entity_id}


@@ -47,7 +47,7 @@ Setup Entity On Remote And Registration
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    Check Response Status Code    201    ${response1.status_code}
    Check Response Status Code    201    ${response1.status_code}


Delete Created Entity And Registration
Delete Created Entities And Registration
    Delete Context Source Registration    ${registration_id}
    Delete Context Source Registration    ${registration_id}
    Delete Entity By Id    ${entity_id}
    Delete Entity By Id    ${entity_id}
    Delete Entity By Id    ${entity_id}    base_url=${remote_url}
    Delete Entity By Id    ${entity_id}    base_url=${remote_url}
+4 −4
Original line number Original line Diff line number Diff line
@@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Setup         Setup Entity On Remote And Registration
Test Setup         Setup Entity On Local And Registration
Suite Teardown      Delete Created Entity And Registration
Test Teardown      Delete Created Entities And Registration




*** Variables ***
*** Variables ***
@@ -33,7 +33,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi




*** Keywords ***
*** Keywords ***
Setup Entity On Remote And Registration
Setup Entity On Local And Registration
    ${entity_id}=    Generate Random Entity Id    ${entity_id_prefix}
    ${entity_id}=    Generate Random Entity Id    ${entity_id_prefix}
    Set Suite Variable    ${entity_id}
    Set Suite Variable    ${entity_id}
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}
@@ -48,7 +48,7 @@ Setup Entity On Remote And Registration
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    Check Response Status Code    201    ${response1.status_code}
    Check Response Status Code    201    ${response1.status_code}


Delete Created Entity And Registration
Delete Created Entities And Registration
    Delete Context Source Registration    ${registration_id}
    Delete Context Source Registration    ${registration_id}
    Delete Entity By Id    ${entity_id}
    Delete Entity By Id    ${entity_id}
    Delete Entity By Id    ${entity_id}    base_url=${remote_url}
    Delete Entity By Id    ${entity_id}    base_url=${remote_url}
+4 −4
Original line number Original line Diff line number Diff line
@@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Setup         Setup Entity On Remote And Registration
Test Setup         Setup Entities And Registration
Suite Teardown      Delete Created Entity And Registration
Test Teardown      Delete Created Entities And Registration




*** Variables ***
*** Variables ***
@@ -30,7 +30,7 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi
    Should Be Empty    ${response.json()['success']}
    Should Be Empty    ${response.json()['success']}


*** Keywords ***
*** Keywords ***
Setup Entity On Remote And Registration
Setup Entities And Registration
    ${entity_id}=    Generate Random Entity Id    ${entity_id_prefix}
    ${entity_id}=    Generate Random Entity Id    ${entity_id_prefix}
    Set Suite Variable    ${entity_id}
    Set Suite Variable    ${entity_id}
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}
    ${response}=    Create Entity    ${entity_payload_filename}    ${entity_id}
@@ -48,7 +48,7 @@ Setup Entity On Remote And Registration
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    Check Response Status Code    201    ${response1.status_code}
    Check Response Status Code    201    ${response1.status_code}


Delete Created Entity And Registration
Delete Created Entities And Registration
    Delete Context Source Registration    ${registration_id}
    Delete Context Source Registration    ${registration_id}
    Delete Entity By Id    ${entity_id}
    Delete Entity By Id    ${entity_id}
    Delete Entity By Id    ${entity_id}    base_url=${remote_url}
    Delete Entity By Id    ${entity_id}    base_url=${remote_url}
+3 −3
Original line number Original line Diff line number Diff line
@@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Setup         Setup Entity On Remote And Registration
Test Setup         Setup Entity On Remote And Registration
Suite Teardown      Delete Created Entity And Registration
Test Teardown      Delete Created Entities And Registration




*** Variables ***
*** Variables ***
@@ -48,7 +48,7 @@ Setup Entity On Remote And Registration
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    Check Response Status Code    201    ${response1.status_code}
    Check Response Status Code    201    ${response1.status_code}


Delete Created Entity And Registration
Delete Created Entities And Registration
    Delete Context Source Registration    ${registration_id}
    Delete Context Source Registration    ${registration_id}
    Delete Entity By Id    ${entity_id}
    Delete Entity By Id    ${entity_id}
    Delete Entity By Id    ${entity_id}    base_url=${remote_url}
    Delete Entity By Id    ${entity_id}    base_url=${remote_url}
+13 −13
Original line number Original line Diff line number Diff line
@@ -8,8 +8,8 @@ Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/AssertionUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource
Resource            ${EXECDIR}/resources/JsonUtils.resource


Suite Setup         Setup Entity On Remote And Registration
Test Setup         Setup Initial Context Source Registration
Suite Teardown      Delete Created Registration
Test Teardown      Delete Created Registration




*** Variables ***
*** Variables ***
@@ -17,7 +17,7 @@ ${entity_id} InvalidUriExample
${entity_id_prefix}                                     urn:ngsi-ld:Vehicle:
${entity_id_prefix}                                     urn:ngsi-ld:Vehicle:
${entity_payload_filename}                              vehicle-simple-attributes.jsonld
${entity_payload_filename}                              vehicle-simple-attributes.jsonld
${registration_id_prefix}                               urn:ngsi-ld:Registration:
${registration_id_prefix}                               urn:ngsi-ld:Registration:
${registration_payload_file_path}       csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld
${context_source_registration_payload_file_path}        csourceRegistrations/context-source-registration-vehicle-redirection-ops.jsonld


*** Test Cases ***
*** Test Cases ***
057_02_01 Request to create an entity with a malformed id on both Context Broker and Context Source
057_02_01 Request to create an entity with a malformed id on both Context Broker and Context Source
@@ -35,16 +35,16 @@ ${registration_payload_file_path} csourceRegistrations/context-source-regi




*** Keywords ***
*** Keywords ***
Setup Entity On Remote And Registration
Setup Initial Context Source Registration
    ${registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    ${context_source_registration_id}=    Generate Random Entity Id    ${registration_id_prefix}
    Set Suite Variable    ${registration_id}
    Set Suite Variable    ${context_source_registration_id}
    ${registration_payload}=    Prepare Context Source Registration From File   
    ${registration_payload}=    Prepare Context Source Registration From File   
    ...    ${registration_id}
    ...    ${context_source_registration_id}
    ...    ${registration_payload_file_path}
    ...    ${context_source_registration_payload_file_path}
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    ${response1}=    Create Context Source Registration With Return    ${registration_payload}
    Check Response Status Code    201    ${response1.status_code}
    Check Response Status Code    201    ${response1.status_code}


Delete Created Registration
Delete Created Registration
    Delete Context Source Registration    ${registration_id}
    Delete Context Source Registration    ${context_source_registration_id}


    
    
 No newline at end of file
Loading