Commit c597a1e5 authored by Benedetta Arena's avatar Benedetta Arena
Browse files

fix: add comments in the code

parent 94132bcc
Loading
Loading
Loading
Loading
+6 −7
Original line number Diff line number Diff line
@@ -22,10 +22,12 @@ ${b2_url}
${b3_url}

*** Test Cases ***
IOP_CNF_01_01 Create Entity In A And Query Entity In All Brokers
    [Documentation]    Check that quering the offparking type returns the entities in B and C and said entities have the same attributes as the ones queried from A.
IOP_CNF_01_01 Query Entities Of Type OffstreetParking Via GET
    [Documentation]    Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking1 and OffStreetParking2 without location and totalSpotsNumber. C contains OffStreetParking2.
    ...                Registrations established: Inclusive in A to B. Exclusive in A to C.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    proxy-exclusive    4_3_6    5_7_2
    
    #Agent queries all entities with type OffstreetParking in A and checks for a successful response that contains the attributes of both entities in B and C.
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${b1_url}
    Check Response Status Code    200    ${response.status_code}
    @{payload}=    Set Variable   ${response.json()}
@@ -34,6 +36,7 @@ IOP_CNF_01_01 Create Entity In A And Query Entity In All Brokers
    Should Contain    ${payload}\[OffstreetParking2]    availableSpotsNumber
    Should Contain    ${payload}\[OffstreetParking2]    location

    #Agent queries all entities with type OffstreetParking in B and C
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${b2_url}
    @{first_expected_payload}=    Set Variable    ${response.json()}
    ${entity_ids}=    Create List    ${entity_id}    ${second_entity_id}
@@ -43,16 +46,13 @@ IOP_CNF_01_01 Create Entity In A And Query Entity In All Brokers
    @{second_expected_payload}=    Set Variable    ${response.json()}
    Check Response Body Containing Entities URIS set to    ${entity_id}    ${response.json()}

    #Agent checks that OffstreetParking1 in A is the same as the one in B and that OffstreetParking2 in A contains the attributes of both OffstreetParking2 in B and C.
    Should Be Equal    ${payload}\[OffstreetParking1]    ${first_expected_payload}\[OffstreetParking1]
    Should Contain    ${payload}\[OffstreetParking2]    ${first_expected_payload}\[OffstreetParking2][totalSpotsNumber]
    Should Contain    ${payload}\[OffstreetParking2]    ${second_expected_payload}\[OffstreetParking2][location]

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data only on leaves. 
    ...                Broker B contains OffStreetParking1 and OffStreetParking2 without location and totalSpotsNumber. 
    ...                Broker C contains OffStreetParking2.
    ...                CSR in A to B and in A to C.
    ${entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id}
    ${second_entity_id}=    Generate Random Parking Entity Id
@@ -98,7 +98,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id3}    broker_url=${b1_url}
+6 −7
Original line number Diff line number Diff line
@@ -23,10 +23,12 @@ ${b2_url}
${b3_url}

*** Test Cases ***
IOP_CNF_01_01 Create Entity In A And Query Entity In All Brokers
    [Documentation]    Check that quering the offparking type returns the entities in B and C and said entities have the same attributes as the ones queried from A.
IOP_CNF_01_01 Query Entities Of Type OffstreetParking Via POST
    [Documentation]    Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking1 and OffStreetParking2 without location and totalSpotsNumber. C contains OffStreetParking2.
    ...                Registrations established: Inclusive in A to B. Exclusive in A to C.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    proxy-exclusive    4_3_6    5_7_2
    
    #Agent queries all entities with type OffstreetParking in A and checks for a successful response that contains the attributes of both entities in B and C.
    @{entities}=    Create List    ${entity_id}    ${second_entity_id}
    ${response}=    Query Entities Via POST   entities=${entities}    broker_url=${b1_url}
    Check Response Status Code    200    ${response.status_code}
@@ -36,6 +38,7 @@ IOP_CNF_01_01 Create Entity In A And Query Entity In All Brokers
    Should Contain    ${payload}\[OffstreetParking2]    availableSpotsNumber
    Should Contain    ${payload}\[OffstreetParking2]    location

    #Agent queries all entities with type OffstreetParking in B and C
    ${response}=    Query Entities Via POST   entities=${entities}    broker_url=${b2_url}
    @{first_expected_payload}=    Set Variable    ${response.json()}
    Check Response Body Containing Entities URIS set to    ${entities}    ${response.json()}
@@ -44,16 +47,13 @@ IOP_CNF_01_01 Create Entity In A And Query Entity In All Brokers
    @{second_expected_payload}=    Set Variable    ${response.json()}
    Check Response Body Containing Entities URIS set to    ${entity_id}    ${response.json()}

    #Agent checks that OffstreetParking1 in A is the same as the one in B and that OffstreetParking2 in A contains the attributes of both OffstreetParking2 in B and C.
    Should Be Equal    ${payload}\[OffstreetParking1]    ${first_expected_payload}\[OffstreetParking1]
    Should Contain    ${payload}\[OffstreetParking2]    ${first_expected_payload}\[OffstreetParking2][totalSpotsNumber]
    Should Contain    ${payload}\[OffstreetParking2]    ${second_expected_payload}\[OffstreetParking2][location]

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data only on leaves. 
    ...                Broker B contains OffStreetParking1 and OffStreetParking2 without location and totalSpotsNumber. 
    ...                Broker C contains OffStreetParking2.
    ...                CSR in A to B and in A to C.
    ${entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id}
    ${second_entity_id}=    Generate Random Parking Entity Id
@@ -99,7 +99,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id3}    broker_url=${b1_url}
+7 −9
Original line number Diff line number Diff line
@@ -26,10 +26,12 @@ ${b3_url}
${b4_url}

*** Test Cases ***
IOP_CNF_02_01 Create Entity In A And Query Entity In All Brokers
    [Documentation]    Check that quering the offparking type returns the entities in B, C and D and said entities have the same attributes as the ones queried from A.
    [Tags]    6_3    I6_3_2_1    inclusive    redirect    interoperability
IOP_CNF_02_01 Query Entities Of Type OffstreetParking Via GET
    [Documentation]    Pre-conditions: no user context. Data on every broker. B contains OffStreetParking1 without location and OffStreetParking2 without location. C contains OffStreetParking1 and OffStreetParking2. D contains OffStreetParking2 with location and name only.
    ...                Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    proxy-redirect    4_3_6    5_7_2
    
    #Agent queries all entities with type OffstreetParking in A and checks for a successful response not containing the name attribute.
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${b1_url}
    Check Response Status Code    200    ${response.status_code}
    @{entities_b1}=    Set Variable   ${response.json()}
@@ -38,6 +40,7 @@ IOP_CNF_02_01 Create Entity In A And Query Entity In All Brokers
    Should Not Contain    ${first_payload}   name
    Should Not Contain    ${second_payload}    name

    #Agent queries all entities with type OffstreetParking in B, C and D
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${b2_url}
    @{entities_b2}=    Set Variable    ${response.json()}
    ${first_b2_payload}=    Get From List   ${entities_b2}    0
@@ -51,6 +54,7 @@ IOP_CNF_02_01 Create Entity In A And Query Entity In All Brokers
    @{entities_b4}=    Set Variable    ${response.json()}
    ${b4_payload}=    Get From List   ${entities_b4}    0
    
    #Agent checks that OffstreetParking1 in A has the same availableSpotsNumber and totalSpotsNumber as the one in B and the same location attribute found in C. The OffstreetParking2 entity in A contains the attributes of both OffstreetParking2 availableSpotsNumber and totalSpotsNumber in C and the same location found in D.
    Should Be Equal    ${first_payload}[availableSpotsNumber]    ${first_b2_payload}[availableSpotsNumber]
    Should Be Equal    ${first_payload}[totalSpotsNumber]    ${first_b2_payload}[totalSpotsNumber]
    Should Be Equal    ${first_payload}[location]    ${b3_payload}[location]
@@ -61,11 +65,6 @@ IOP_CNF_02_01 Create Entity In A And Query Entity In All Brokers

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data on every broker. 
    ...                Broker B contains OffStreetParking1 without location and OffStreetParking2 without location.
    ...                Broker C contains OffStreetParking1 and OffStreetParking2.
    ...                Broker D contains OffStreetParking2 with location and name only.
    ...                CSR in A to B, in A to C and in A to D.
    ${entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id}
    ${second_entity_id}=    Generate Random Parking Entity Id
@@ -137,7 +136,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id3}    broker_url=${b1_url}
+7 −9
Original line number Diff line number Diff line
@@ -29,10 +29,12 @@ ${b3_url}
${b4_url}

*** Test Cases ***
IOP_CNF_02_02 Create Entity In A And Query Entity In All Brokers
    [Documentation]    Verify that the entities found in B, C and D can be queried via HTTP GET and said entities have the same attributes as the ones queried from A.
IOP_CNF_02_02 Query Properties Of Entities Of Type OffstreetParking And Vehicle
    [Documentation]    Pre-conditions: no user context. Data only on leaves. B contains OffStreetParking1 and Vehicle1. C contains OffStreetParking1 with location and name only and OffStreetParking2. D contains OffStreetParking2 with location and name only and Vehicle2.
    ...                Registrations established: Inclusive in A to B. Redirect in A to C. Redirect in A to D.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    proxy-redirect    4_3_6    5_7_2

    #Client queries all entities with type OffstreetParking and Vehicle in A and checks for a successful response that contains the location attribute for all entities.
    ${response}=    Query Entities    entity_types=OffstreetParking,Vehicle    attrs=location    broker_url=${b1_url}
    Check Response Status Code    200    ${response.status_code}
    &{payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
@@ -45,6 +47,7 @@ IOP_CNF_02_02 Create Entity In A And Query Entity In All Brokers
    Should Contain    ${vehicle1_payload}    location
    Should Contain    ${vehicle2_payload}    location

    #Client queries all entities with type OffstreetParking and Vehicle in B, C and D. 
    ${response}=    Query Entities    entity_types=OffstreetParking,Vehicle    attrs=location    broker_url=${b2_url}
    &{first_expected_payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${response}=    Query Entities    entity_types=OffstreetParking,Vehicle    attrs=location    broker_url=${b3_url}
@@ -52,6 +55,7 @@ IOP_CNF_02_02 Create Entity In A And Query Entity In All Brokers
    ${response}=    Query Entities    entity_types=OffstreetParking,Vehicle    attrs=location    broker_url=${b4_url}
    &{third_expected_payload}=    Evaluate    {i['id']: i for i in ${response.json()}}

    #Client checks that the attributes of the entities in A are the same as the ones in B, C and D.
    ${expected_vehicle1}=    Get From Dictionary    ${first_expected_payload}    ${first_vehicle_entity_id}
    ${expected_parking1}=    Get From Dictionary    ${second_expected_payload}    ${first_parking_entity_id}
    ${expected_vehicle2}=    Get From Dictionary    ${third_expected_payload}    ${second_vehicle_entity_id}
@@ -63,11 +67,6 @@ IOP_CNF_02_02 Create Entity In A And Query Entity In All Brokers

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data only on leaves. 
    ...                Broker B contains OffStreetParking1 and Vehicle1.
    ...                Broker C contains OffStreetParking1 with location and name only and OffStreetParking2
    ...                Broker D contains OffStreetParking2 with location and name only and Vehicle2.
    ...                CSR in A to B, in A to C and in A to D.
    ${first_parking_entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${first_parking_entity_id}
    ${second_parking_entity_id}=    Generate Random Parking Entity Id
@@ -143,7 +142,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id3}    broker_url=${b1_url}
+6 −8
Original line number Diff line number Diff line
@@ -24,10 +24,12 @@ ${b3_url}
${b4_url}

*** Test Cases ***
IOP_CNF_03_01 Create Entity In A And Query Entity In All Brokers
    [Documentation]    Verify that the entity found in B, C and D can be queried via HTTP GET and said entities have the same attributes as the ones queried from A.
IOP_CNF_03_01 Query Entities Of Type OffstreetParking Via GET
    [Documentation]    Pre-conditions: No user context. Data only on leaves. B contains OffStreetParking2 without location. C contains OffStreetParking1. D contains OffStreetParking1 without location.
    ...                Registration established: Auxiliary in A to B. Inclusive in A to C. Inclusive in A to D.
    [Tags]    since_v1.6.1    iop    4_3_3    cf_06    additive-inclusive    additive-auxiliary    4_3_6    5_7_2

    #Client queries all entities with type OffstreetParking in A and checks for a successful response. 
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${b1_url}
    Check Response Status Code    200    ${response.status_code}

@@ -35,6 +37,7 @@ IOP_CNF_03_01 Create Entity In A And Query Entity In All Brokers
    ${first_parking_payload}=    Get From Dictionary    ${payload}    OffstreetParking:1
    ${second_parking_payload}=    Get From Dictionary    ${payload}    OffstreetParking:2

    #Client queries all entities with type OffstreetParking in B, C and D.
    ${response}=    Query Entities    entity_types=OffstreetParking    broker_url=${b2_url}
    ${payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${expected_parking1}=    Get From Dictionary    ${payload}    OffstreetParking:2
@@ -47,6 +50,7 @@ IOP_CNF_03_01 Create Entity In A And Query Entity In All Brokers
    ${payload}=    Evaluate    {i['id']: i for i in ${response.json()}}
    ${expected_parking3}=    Get From Dictionary    ${payload}    OffstreetParking:1

    #Client checks that the attributes of the entities in A are the same as the ones in B, C and D.
    Should Be Equal    ${first_parking_payload}[name]    ${expected_parking2}[name]
    Should Be Equal    ${first_parking_payload}[location]    ${expected_parking2}[location]
    Should Be Equal    ${first_parking_payload}[availableSpotsNumber]    ${expected_parking3}[availableSpotsNumber]
@@ -55,11 +59,6 @@ IOP_CNF_03_01 Create Entity In A And Query Entity In All Brokers

*** Keywords ***
Setup Initial Context Source Registrations
    [Documentation]    Pre-conditions: no user context. Data only on leaves. 
    ...                Broker B contains OffStreetParking2 without location. 
    ...                Broker C contains OffStreetParking1.
    ...                Broker D contains OffStreetParking1 without location.
    ...                CSR in A to B, in A to C and in A to D.
    ${entity_id}=    Generate Random Parking Entity Id
    Set Suite Variable    ${entity_id}

@@ -103,7 +102,6 @@ Setup Initial Context Source Registrations
    Check Response Status Code    201    ${response.status_code}

Delete Entities And Delete Registrations
    [Documentation]    Post-conditions: no user context. no data in any broker. no registrations in any broker.
    Delete Context Source Registration    ${registration_id1}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id2}    broker_url=${b1_url}
    Delete Context Source Registration    ${registration_id3}    broker_url=${b1_url}
Loading