Loading TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot +3 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ ${expectation_file_path}= csourceRegistrations/exp near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} 037_07_02 Within Polygon [Tags] csr-query 5_10_2 within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} # RFC 7946: Polygon coordinates are an array of linear RINGS (one more # nesting level), and a ring is closed — first position == last position. within Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37],[-13.503,47.202]]] location ${expectation_file_path} *** Keywords *** Loading TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot +6 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,12 @@ ${third_context_source_registration_payload_file_path}= csourceRegistrations *** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS 037_10_01 With List Of Entity Ids [Tags] csr-query 5_10_2 id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01.json ${first_context_source_registration_id},${third_context_source_registration_id} # 'id' filters by ENTITY ids ("List of entity ids to be retrieved") — not # by registration ids. The two Building ids below can be provided by the # second and third registrations (type Building, no id constraint) but NOT # by the first one, whose EntityInfos pin Vehicle:A456 and OffStreetParking # id patterns (testsuite-doubts.md #98). id urn:ngsi-ld:Building:building001,urn:ngsi-ld:Building:building002 csourceRegistrations/expectations/context-source-registrations-037-10-01.json ${second_context_source_registration_id} ${third_context_source_registration_id} 037_10_02 With NGSI-LD Query [Tags] csr-query 5_10_2 q csourceProperty1=="aValue" csourceRegistrations/expectations/context-source-registrations-037-10-02.json ${third_context_source_registration_id} Loading TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot +14 −4 Original line number Diff line number Diff line Loading @@ -13,7 +13,10 @@ Test Template Query Context Source Registration With Limit And Offset Para *** Variables *** ${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration.jsonld # All three registrations must match type=Building — the pagination rows # below assume three pages. The generic context-source-registration.jsonld # registers Vehicle/OffStreetParking only (testsuite-doubts.md #98). ${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-csourceProperty.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location.jsonld ${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information.jsonld Loading @@ -21,30 +24,37 @@ ${third_context_source_registration_payload_file_path}= csourceRegistrations *** Test Cases *** LIMIT OFFSET EXPECTED_NUMBER PREV_LINK NEXT_LINK 037_11_01 Query Second Subscription [Tags] csr-query 5_10_2 ${1} ${2} ${1} </ngsi-ld/v1/csourceRegistrations?type=Building&limit=1&offset=1>;rel="prev";type="application/ld+json" </ngsi-ld/v1/csourceSubscriptions?type=Building&limit=1&offset=3>;rel="next";type="application/ld+json" # offset=2 with limit=1 over three matches is the LAST page — no next link # (clause 5.5.9; the previous expectation also pointed the next link at # /csourceSubscriptions, a copy-paste slip). ${1} ${2} ${1} </ngsi-ld/v1/csourceRegistrations?type=Building&limit=1&offset=1>;rel="prev";type="application/ld+json" ${EMPTY} 037_11_02 Query Last Subscription [Tags] csr-query 5_10_2 ${2} ${2} ${1} </ngsi-ld/v1/csourceRegistrations?type=Building&limit=2&offset=0>;rel="prev";type="application/ld+json" ${EMPTY} 037_11_03 Query All Subscriptions [Tags] csr-query 5_10_2 ${15} ${0} ${2} ${EMPTY} ${EMPTY} ${15} ${0} ${3} ${EMPTY} ${EMPTY} *** Keywords *** Query Context Source Registration With Limit And Offset Parameters [Documentation] Check that one can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. [Arguments] ${limit} ${offset} ${expected_number} ${prev_link} ${next_link} # accept=ld+json: the pagination keyword compares the WHOLE Link header, # and the application/json form carries the @context Link alongside the # pagination one. ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... limit=${limit} ... offset=${offset} ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities ... ContextSourceRegistration ... ${expected_number} ... ${response.json()} Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.json()} Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.headers} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random CSR Id Loading data/csourceRegistrations/expectations/context-source-registrations-037-10-01.json +8 −11 Original line number Diff line number Diff line Loading @@ -8,6 +8,13 @@ { "type": "Building" } ], "propertyNames": [ "name", "subCategory" ], "relationshipNames": [ "locatedAt" ] } ], Loading @@ -25,18 +32,8 @@ ] } ], "location": { "type": "Point", "coordinates": [ -8.521, 41.2 ] }, "endpoint": "http://my.csource.org:1026", "csourceProperty1": "aValue", "csourceProperty2": "anotherValue", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] "csourceProperty2": "anotherValue" } ] No newline at end of file data/csourceRegistrations/expectations/context-source-registrations-037-10-02.json +1 −11 Original line number Diff line number Diff line Loading @@ -11,18 +11,8 @@ ] } ], "location": { "type": "Point", "coordinates": [ -8.521, 41.2 ] }, "endpoint": "http://my.csource.org:1026", "csourceProperty1": "aValue", "csourceProperty2": "anotherValue", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] "csourceProperty2": "anotherValue" } ] No newline at end of file Loading
TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_07.robot +3 −1 Original line number Diff line number Diff line Loading @@ -23,7 +23,9 @@ ${expectation_file_path}= csourceRegistrations/exp near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} ${expectation_file_path} 037_07_02 Within Polygon [Tags] csr-query 5_10_2 within Polygon [[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37]] location ${expectation_file_path} # RFC 7946: Polygon coordinates are an array of linear RINGS (one more # nesting level), and a ring is closed — first position == last position. within Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-15.23,21.37],[-13.503,47.202]]] location ${expectation_file_path} *** Keywords *** Loading
TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_10.robot +6 −1 Original line number Diff line number Diff line Loading @@ -21,7 +21,12 @@ ${third_context_source_registration_payload_file_path}= csourceRegistrations *** Test Cases *** QUERY_PARAM_NAME QUERY_PARAM_VALUE EXPECTATION_FILE_PATH EXPECTED_CONTEXT_SOURCE_REGISTRATION_IDS 037_10_01 With List Of Entity Ids [Tags] csr-query 5_10_2 id ${first_context_source_registration_id},${third_context_source_registration_id} csourceRegistrations/expectations/context-source-registrations-037-10-01.json ${first_context_source_registration_id},${third_context_source_registration_id} # 'id' filters by ENTITY ids ("List of entity ids to be retrieved") — not # by registration ids. The two Building ids below can be provided by the # second and third registrations (type Building, no id constraint) but NOT # by the first one, whose EntityInfos pin Vehicle:A456 and OffStreetParking # id patterns (testsuite-doubts.md #98). id urn:ngsi-ld:Building:building001,urn:ngsi-ld:Building:building002 csourceRegistrations/expectations/context-source-registrations-037-10-01.json ${second_context_source_registration_id} ${third_context_source_registration_id} 037_10_02 With NGSI-LD Query [Tags] csr-query 5_10_2 q csourceProperty1=="aValue" csourceRegistrations/expectations/context-source-registrations-037-10-02.json ${third_context_source_registration_id} Loading
TP/NGSI-LD/ContextSource/Discovery/QueryContextSourceRegistrations/037_11.robot +14 −4 Original line number Diff line number Diff line Loading @@ -13,7 +13,10 @@ Test Template Query Context Source Registration With Limit And Offset Para *** Variables *** ${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration.jsonld # All three registrations must match type=Building — the pagination rows # below assume three pages. The generic context-source-registration.jsonld # registers Vehicle/OffStreetParking only (testsuite-doubts.md #98). ${first_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-csourceProperty.jsonld ${second_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-location.jsonld ${third_context_source_registration_payload_file_path}= csourceRegistrations/context-source-registration-detailed-information.jsonld Loading @@ -21,30 +24,37 @@ ${third_context_source_registration_payload_file_path}= csourceRegistrations *** Test Cases *** LIMIT OFFSET EXPECTED_NUMBER PREV_LINK NEXT_LINK 037_11_01 Query Second Subscription [Tags] csr-query 5_10_2 ${1} ${2} ${1} </ngsi-ld/v1/csourceRegistrations?type=Building&limit=1&offset=1>;rel="prev";type="application/ld+json" </ngsi-ld/v1/csourceSubscriptions?type=Building&limit=1&offset=3>;rel="next";type="application/ld+json" # offset=2 with limit=1 over three matches is the LAST page — no next link # (clause 5.5.9; the previous expectation also pointed the next link at # /csourceSubscriptions, a copy-paste slip). ${1} ${2} ${1} </ngsi-ld/v1/csourceRegistrations?type=Building&limit=1&offset=1>;rel="prev";type="application/ld+json" ${EMPTY} 037_11_02 Query Last Subscription [Tags] csr-query 5_10_2 ${2} ${2} ${1} </ngsi-ld/v1/csourceRegistrations?type=Building&limit=2&offset=0>;rel="prev";type="application/ld+json" ${EMPTY} 037_11_03 Query All Subscriptions [Tags] csr-query 5_10_2 ${15} ${0} ${2} ${EMPTY} ${EMPTY} ${15} ${0} ${3} ${EMPTY} ${EMPTY} *** Keywords *** Query Context Source Registration With Limit And Offset Parameters [Documentation] Check that one can query context source registrations with providing page and limit parameters, pagination logic shall be in place as mandated by clause 5.5.9. [Arguments] ${limit} ${offset} ${expected_number} ${prev_link} ${next_link} # accept=ld+json: the pagination keyword compares the WHOLE Link header, # and the application/json form carries the @context Link alongside the # pagination one. ${response}= Query Context Source Registrations ... context=${ngsild_test_suite_context} ... type=Building ... limit=${limit} ... offset=${offset} ... accept=${CONTENT_TYPE_LD_JSON} Check Response Status Code 200 ${response.status_code} Check Response Body Containing Number Of Entities ... ContextSourceRegistration ... ${expected_number} ... ${response.json()} Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.json()} Check Pagination Prev And Next Headers ${prev_link} ${next_link} ${response.headers} Setup Initial Context Source Registrations ${first_context_source_registration_id}= Generate Random CSR Id Loading
data/csourceRegistrations/expectations/context-source-registrations-037-10-01.json +8 −11 Original line number Diff line number Diff line Loading @@ -8,6 +8,13 @@ { "type": "Building" } ], "propertyNames": [ "name", "subCategory" ], "relationshipNames": [ "locatedAt" ] } ], Loading @@ -25,18 +32,8 @@ ] } ], "location": { "type": "Point", "coordinates": [ -8.521, 41.2 ] }, "endpoint": "http://my.csource.org:1026", "csourceProperty1": "aValue", "csourceProperty2": "anotherValue", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] "csourceProperty2": "anotherValue" } ] No newline at end of file
data/csourceRegistrations/expectations/context-source-registrations-037-10-02.json +1 −11 Original line number Diff line number Diff line Loading @@ -11,18 +11,8 @@ ] } ], "location": { "type": "Point", "coordinates": [ -8.521, 41.2 ] }, "endpoint": "http://my.csource.org:1026", "csourceProperty1": "aValue", "csourceProperty2": "anotherValue", "@context": [ "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" ] "csourceProperty2": "anotherValue" } ] No newline at end of file