diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_10.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_10.robot new file mode 100644 index 0000000000000000000000000000000000000000..ab9e76b8a154f6f8e2df3faf13a3ec4ca3eb71f2 --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_10.robot @@ -0,0 +1,97 @@ +*** Settings *** +Documentation Check that one can query several entities based on complex geoqueries with Point target geometries + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Entities +Test Template Query several entities based on complex geoqueries + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** GEOREL GEOMETRY COORDINATES EXPECTED_COUNT +019_10_01 QueryOnEqualsPoint + [Documentation] Check that one can query with an exact point + [Tags] e-query 5_7_2 4_10 + equals Point [13.3986, 52.5547] 1 +019_10_02 QueryOnMaxDistancePoint + [Documentation] Check that one can query with a max distance + [Tags] e-query 5_7_2 4_10 + near;maxDistance==15000 Point [13.388930, 52.534473] 2 +019_10_03 QueryOnMinDistancePoint + [Documentation] Check that one can query with a min distance + [Tags] e-query 5_7_2 4_10 + near;minDistance==15000 Point [13.388930, 52.534473] 1 +019_10_04 QueryOnWithinPolygon + [Documentation] Check that one can query within a polygon + [Tags] e-query 5_7_2 4_10 + within Polygon [[[13.1616211,52.5438124],[13.597641,52.4840224],[13.5948944,52.3402782],[13.142395,52.386428],[13.1616211,52.5438124]]] 2 +019_10_05 QueryOnDisjointPolygon + [Documentation] Check that one can query with a disjoint polygon + [Tags] e-query 5_7_2 4_10 + disjoint Polygon [[[13.1616211,52.5438124],[13.597641,52.4840224],[13.5948944,52.3402782],[13.142395,52.386428],[13.1616211,52.5438124]]] 1 +019_10_06 QueryOnDisjointPoint + [Documentation] Check that one can query with a disjoint point + [Tags] e-query 5_7_2 4_10 + disjoint Point [13.3986, 52.5547] 2 +019_10_07 QueryOnContainsPoint + [Documentation] Check that one can query with a contains point + [Tags] e-query 5_7_2 4_10 + contains Point [13.3986, 52.5547] 1 +019_10_08 QueryOnIntersectsPoint + [Documentation] Check that one can query with an intersects point + [Tags] e-query 5_7_2 4_10 + intersects Point [13.3986, 52.5547] 1 + + +*** Keywords *** +Query several entities based on complex geoqueries + [Documentation] Query with a complex geoquery and check the number of results + [Arguments] ${georel} ${geometry} ${coordinates} ${expected_count} + + ${response}= Query Entities + ... entity_types=Building + ... context=${ngsild_test_suite_context} + ... georel=${georel} + ... geometry=${geometry} + ... coordinates=${coordinates} + ... count=${true} + + Check Response Status Code 200 ${response.status_code} + Check Response Headers Containing NGSILD-Results-Count Equals To ${expected_count} ${response.headers} + +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} + ${create_response1}= Create Entity Selecting Content Type + ... building-location-attribute.jsonld + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response1.status_code} + + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} + ${create_response2}= Create Entity Selecting Content Type + ... building-location-attribute-second.jsonld + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} + + ${third_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${third_entity_id} + ${create_response3}= Create Entity Selecting Content Type + ... building-location-attribute-third.jsonld + ... ${third_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response3.status_code} + +Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} + Delete Entity by Id ${third_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_11.robot b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_11.robot new file mode 100644 index 0000000000000000000000000000000000000000..eb122fe70a66183bfa2cb8947ba1f0d2dce6ee7f --- /dev/null +++ b/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_11.robot @@ -0,0 +1,88 @@ +*** Settings *** +Documentation Check that one can query several entities based on complex geoqueries with Polygon target geometries + +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationProvision.resource +Resource ${EXECDIR}/resources/ApiUtils/ContextInformationConsumption.resource +Resource ${EXECDIR}/resources/AssertionUtils.resource +Resource ${EXECDIR}/resources/JsonUtils.resource + +Suite Setup Setup Initial Entities +Suite Teardown Delete Entities +Test Template Query several entities based on complex geoqueries + + +*** Variables *** +${building_id_prefix}= urn:ngsi-ld:Building: + + +*** Test Cases *** GEOREL GEOMETRY COORDINATES EXPECTED_COUNT +019_11_01 QueryOnEqualsPolygon + [Documentation] Check that one can query with an exact polygon + [Tags] e-query 5_7_2 4_10 + equals Polygon [[[13.2865906,52.5648645],[13.2879639,52.5648645],[13.2797241,52.4988679],[13.477478,52.4712703],[13.5049438,52.5373084],[13.2865906,52.5648645]]] 1 +019_11_02 QueryOnIntersectsPolygon + [Documentation] Check that one can query with an intersects polygon + [Tags] e-query 5_7_2 4_10 + intersects Polygon [[[13.3456421,52.4794848],[13.3641815,52.4428773],[13.4177399,52.4730023],[13.3459854,52.479903],[13.3456421,52.4794848]]] 1 +019_11_03 QueryOnContainsPolygonMatching + [Documentation] Check that one can query with a contains polygon + [Tags] e-query 5_7_2 4_10 + contains Polygon [[[13.3844376,52.5356966],[13.3844376,52.5356966],[13.381691,52.5123012],[13.4235764,52.5100027],[13.4331894,52.5273425],[13.3844376,52.5356966]]] 1 +019_11_04 QueryOnContainsPolygonNotMatching + [Documentation] Check that one can query with a contains polygon without matching geometries + [Tags] e-query 5_7_2 4_10 + contains Polygon [[[13.1369019,52.5198225],[13.1365585,52.5200314],[13.131752,52.4980907],[13.1832504,52.5026887],[13.1369019,52.5198225]]] 0 +019_11_05 QueryOnDisjointPolygon + [Documentation] Check that one can query with a disjoint polygon + [Tags] e-query 5_7_2 4_10 + disjoint Polygon [[[13.1369019,52.5198225],[13.1365585,52.5200314],[13.131752,52.4980907],[13.1832504,52.5026887],[13.1369019,52.5198225]]] 2 +019_11_06 QueryOnWithinPolygon + [Documentation] Check that one can query with a within polygon + [Tags] e-query 5_7_2 4_10 + within Polygon [[[13.3023834,52.4903066],[13.3027267,52.4905156],[13.2745743,52.465632],[13.3343124,52.4185447],[13.4311295,52.47107],[13.3023834,52.4903066]]] 1 +019_11_07 QueryOnOverlapsPolygon + [Documentation] Check that one can query with an overlaps polygon + [Tags] e-query 5_7_2 4_10 + overlaps Polygon [[[13.3456421,52.4794848],[13.3641815,52.4428773],[13.4177399,52.4730023],[13.3459854,52.479903],[13.3456421,52.4794848]]] 1 +019_11_08 QueryOnContainsPoint + [Documentation] Check that one can query with a contains point + [Tags] e-query 5_7_2 4_10 + contains Point [13.3442688,52.4650045] 1 + + +*** Keywords *** +Query several entities based on complex geoqueries + [Documentation] Query with a complex geoquery and check the number of results + [Arguments] ${georel} ${geometry} ${coordinates} ${expected_count} + + ${response}= Query Entities + ... entity_types=Building + ... context=${ngsild_test_suite_context} + ... georel=${georel} + ... geometry=${geometry} + ... coordinates=${coordinates} + ... count=${true} + + Check Response Status Code 200 ${response.status_code} + Check Response Headers Containing NGSILD-Results-Count Equals To ${expected_count} ${response.headers} + +Setup Initial Entities + ${first_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${first_entity_id} + ${create_response1}= Create Entity Selecting Content Type + ... building-location-polygon.jsonld + ... ${first_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response1.status_code} + + ${second_entity_id}= Generate Random Entity Id ${building_id_prefix} + Set Suite Variable ${second_entity_id} + ${create_response2}= Create Entity Selecting Content Type + ... building-location-polygon-second.jsonld + ... ${second_entity_id} + ... ${CONTENT_TYPE_LD_JSON} + Check Response Status Code 201 ${create_response2.status_code} + +Delete Entities + Delete Entity by Id ${first_entity_id} + Delete Entity by Id ${second_entity_id} diff --git a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot index c7e50bb77a44be02c7a6c51411dede57c51424ad..a5faad6f58abf8ae4d87740f827ecc642ece5a55 100644 --- a/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot +++ b/TP/NGSI-LD/ContextInformation/Consumption/TemporalEntity/QueryTemporalEvolutionOfEntities/021_09.robot @@ -24,7 +24,7 @@ ${expectation_file}= vehicles-temporal-representation-021-09.json near;maxDistance==2000 Point [-8.503,41.202] ${EMPTY} vehicles-temporal-representation-021-09-01.jsonld 021_09_02 Within Polygon [Tags] te-query 5_7_4 - contains Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]] location vehicles-temporal-representation-021-09-02.jsonld + within Polygon [[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]] location vehicles-temporal-representation-021-09-02.jsonld *** Keywords *** diff --git a/data/entities/building-location-attribute-second.jsonld b/data/entities/building-location-attribute-second.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..2a1093a65a641aac41067e6940c86f7a05690fa9 --- /dev/null +++ b/data/entities/building-location-attribute-second.jsonld @@ -0,0 +1,18 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Berlin Brandenburg International Airport" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [13.509818, 52.363457] + } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-location-attribute-third.jsonld b/data/entities/building-location-attribute-third.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..7e35142347c6caffcb562dbb64e7a1a9cdb4786f --- /dev/null +++ b/data/entities/building-location-attribute-third.jsonld @@ -0,0 +1,18 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Grunewald" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Point", + "coordinates": [13.215983, 52.470441] + } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-location-polygon-second.jsonld b/data/entities/building-location-polygon-second.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..ff9d00f02b11459c15d93eb982641fd69e8dc66c --- /dev/null +++ b/data/entities/building-location-polygon-second.jsonld @@ -0,0 +1,37 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Polygon", + "coordinates": [ + [ + [ + 13.315773, + 52.4757209 + ], + [ + 13.339119, + 52.4443421 + ], + [ + 13.3892441, + 52.4669371 + ], + [ + 13.315773, + 52.4757209 + ] + ] + ] + } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/data/entities/building-location-polygon.jsonld b/data/entities/building-location-polygon.jsonld new file mode 100644 index 0000000000000000000000000000000000000000..0a836550952cb0101d8be2658acf47e4c03517cf --- /dev/null +++ b/data/entities/building-location-polygon.jsonld @@ -0,0 +1,45 @@ +{ + "id": "urn:ngsi-ld:Building:randomUUID", + "type": "Building", + "name": { + "type": "Property", + "value": "Eiffel Tower" + }, + "location": { + "type": "GeoProperty", + "value": { + "type": "Polygon", + "coordinates": [ + [ + [ + 13.2865906, + 52.5648645 + ], + [ + 13.2879639, + 52.5648645 + ], + [ + 13.2797241, + 52.4988679 + ], + [ + 13.477478, + 52.4712703 + ], + [ + 13.5049438, + 52.5373084 + ], + [ + 13.2865906, + 52.5648645 + ] + ] + ] + } + }, + "@context": [ + "https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld" + ] +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_10.json b/doc/files/ContextInformation/Consumption/019_10.json new file mode 100644 index 0000000000000000000000000000000000000000..76acac43515c14b4ef94f017be7d777cca9c95df --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_10.json @@ -0,0 +1,163 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_10", + "test_objective": "Check that one can query several entities based on complex geoqueries with Point target geometries", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.10, 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.10", + "5.7.2" + ], + "pics_selection": "", + "keywords": [ + "Query several entities based on complex geoqueries", + "Setup Initial Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_10_01 QueryOnEqualsPoint", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_10_01", + "doc": "Check that one can query with an exact point", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'equals' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.3986, 52.5547]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_10_02 QueryOnMaxDistancePoint", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_10_02", + "doc": "Check that one can query with a max distance", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 2\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'near;maxDistance==15000' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.388930, 52.534473]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_10_03 QueryOnMinDistancePoint", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_10_03", + "doc": "Check that one can query with a min distance", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'near;minDistance==15000' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.388930, 52.534473]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_10_04 QueryOnWithinPolygon", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_10_04", + "doc": "Check that one can query within a polygon", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 2\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'within' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.1616211,52.5438124],[13.597641,52.4840224],[13.5948944,52.3402782],[13.142395,52.386428],[13.1616211,52.5438124]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_10_05 QueryOnDisjointPolygon", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_10_05", + "doc": "Check that one can query with a disjoint polygon", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'disjoint' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.1616211,52.5438124],[13.597641,52.4840224],[13.5948944,52.3402782],[13.142395,52.386428],[13.1616211,52.5438124]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_10_06 QueryOnDisjointPoint", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_10_06", + "doc": "Check that one can query with a disjoint point", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 2\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'disjoint' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.3986, 52.5547]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_10_07 QueryOnContainsPoint", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_10_07", + "doc": "Check that one can query with a contains point", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'contains' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.3986, 52.5547]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_10_08 QueryOnIntersectsPoint", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_10_08", + "doc": "Check that one can query with an intersects point", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'intersects' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.3986, 52.5547]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_10" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/019_11.json b/doc/files/ContextInformation/Consumption/019_11.json new file mode 100644 index 0000000000000000000000000000000000000000..1759b2ac6714932461466743f0d60e0df7b7fa89 --- /dev/null +++ b/doc/files/ContextInformation/Consumption/019_11.json @@ -0,0 +1,163 @@ +{ + "tp_id": "TP/NGSI-LD/CI/Cons/E/019_11", + "test_objective": "Check that one can query several entities based on complex geoqueries with Polygon target geometries", + "reference": "ETSI GS CIM 009 V1.3.1 [], clauses 4.10, 5.7.2", + "config_id": "", + "parent_release": "v1.3.1", + "clauses": [ + "4.10", + "5.7.2" + ], + "pics_selection": "", + "keywords": [ + "Query several entities based on complex geoqueries", + "Setup Initial Entities", + "Delete Entities" + ], + "teardown": "Delete Entities", + "initial_condition": "with {\n the SUT containing an initial state\n}", + "test_cases": [ + { + "name": "019_11_01 QueryOnEqualsPolygon", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_11_01", + "doc": "Check that one can query with an exact polygon", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'equals' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.2865906,52.5648645],[13.2879639,52.5648645],[13.2797241,52.4988679],[13.477478,52.4712703],[13.5049438,52.5373084],[13.2865906,52.5648645]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_11_02 QueryOnIntersectsPolygon", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_11_02", + "doc": "Check that one can query with an intersects polygon", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'intersects' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.3456421,52.4794848],[13.3641815,52.4428773],[13.4177399,52.4730023],[13.3459854,52.479903],[13.3456421,52.4794848]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_11_03 QueryOnContainsPolygonMatching", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_11_03", + "doc": "Check that one can query with a contains polygon", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'contains' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.3844376,52.5356966],[13.3844376,52.5356966],[13.381691,52.5123012],[13.4235764,52.5100027],[13.4331894,52.5273425],[13.3844376,52.5356966]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_11_04 QueryOnContainsPolygonNotMatching", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_11_04", + "doc": "Check that one can query with a contains polygon without matching geometries", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 0\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'contains' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.1369019,52.5198225],[13.1365585,52.5200314],[13.131752,52.4980907],[13.1832504,52.5026887],[13.1369019,52.5198225]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_11_05 QueryOnDisjointPolygon", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_11_05", + "doc": "Check that one can query with a disjoint polygon", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 2\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'disjoint' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.1369019,52.5198225],[13.1365585,52.5200314],[13.131752,52.4980907],[13.1832504,52.5026887],[13.1369019,52.5198225]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_11_06 QueryOnWithinPolygon", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_11_06", + "doc": "Check that one can query with a within polygon", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'within' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.3023834,52.4903066],[13.3027267,52.4905156],[13.2745743,52.465632],[13.3343124,52.4185447],[13.4311295,52.47107],[13.3023834,52.4903066]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_11_07 QueryOnOverlapsPolygon", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_11_07", + "doc": "Check that one can query with an overlaps polygon", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'overlaps' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[13.3456421,52.4794848],[13.3641815,52.4428773],[13.4177399,52.4730023],[13.3459854,52.479903],[13.3456421,52.4794848]]]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + }, + { + "name": "019_11_08 QueryOnContainsPoint", + "permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_11_08", + "doc": "Check that one can query with a contains point", + "tags": [ + "4_10", + "5_7_2", + "e-query" + ], + "setup": null, + "teardown": null, + "template": "Query several entities based on complex geoqueries", + "then": "then {\n the SUT sends a valid Response for the operations:\n Query Entities with Response Status Code set to 200 and\n Query Entities with Response Header: NGSILD-Results-Count equals to 1\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/'\n method set to 'GET'\n Get Entities Request: and\n Query Parameter: entity_types set to 'Building' and\n Query Parameter: Link set to '<$https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld>; rel=\"http://www.w3.org/ns/json-ld#context\";type=\"application/ld+json\"' and\n Query Parameter: georel set to 'contains' and\n Query Parameter: geometry set to 'Point' and\n Query Parameter: coordinates set to '[13.3442688,52.4650045]' and\n Query Parameter: count set to '${true}'\n}", + "http_verb": "GET", + "endpoint": "entities/" + } + ], + "permutations": [ + "then", + "when" + ], + "robotpath": "ContextInformation/Consumption/Entity/QueryEntities", + "robotfile": "019_11" +} \ No newline at end of file diff --git a/doc/files/ContextInformation/Consumption/021_09.json b/doc/files/ContextInformation/Consumption/021_09.json index baa9bb4a173bfc03c588c2896bb8624d39ae48cc..846a6b2f2ddd8bdfc0f448329e490db892f28351 100644 --- a/doc/files/ContextInformation/Consumption/021_09.json +++ b/doc/files/ContextInformation/Consumption/021_09.json @@ -1,6 +1,6 @@ { "tp_id": "TP/NGSI-LD/CI/Cons/TE/021_09", - "test_objective": "Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query", + "test_objective": "Check that one can query the temporal evolution of entities matching the given NGSI-LD geo-query", "reference": "ETSI GS CIM 009 V1.3.1 [], clause 5.7.4", "config_id": "", "parent_release": "v1.3.1", @@ -19,7 +19,7 @@ { "name": "021_09_01 Near Point", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_09_01", - "doc": "Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query", + "doc": "Check that one can query the temporal evolution of entities matching the given NGSI-LD geo-query", "tags": [ "5_7_4", "te-query" @@ -35,7 +35,7 @@ { "name": "021_09_02 Within Polygon", "permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/021_09_02", - "doc": "Check that you can query the temporal evolution of entities matching the given NGSI-LD geo-query", + "doc": "Check that one can query the temporal evolution of entities matching the given NGSI-LD geo-query", "tags": [ "5_7_4", "te-query" @@ -44,7 +44,7 @@ "teardown": "Delete Initial Temporal Entities", "template": "Query the temporal evolution of entities matching the given NGSI-LD geo-query", "then": "then {\n the SUT sends a valid Response for the operations:\n Query Temporal Representation Of Entities with Response Status Code set to 200 and\n Query Temporal Representation Of Entities with Request response body containing a list that contains Entity Temporal Elements\n compared with file 'vehicles-temporal-representation-021-09.jsonld'\n and using the list of entity ids define in '${temporal_entities_representation_ids}'\n}", - "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: georel set to 'contains' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]]' and\n Query Parameter: geoproperty set to 'location' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", + "when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities'\n method set to 'GET'\n Query Temporal Representation of Entities and\n Query Parameter: entity_types set to '${entity_types_to_be_retrieved}' and\n Query Parameter: georel set to 'within' and\n Query Parameter: geometry set to 'Polygon' and\n Query Parameter: coordinates set to '[[[-13.503,47.202],[6.541, 52.961],[20.37,44.653],[9.46,32.57],[-13.503,32.57],[-13.503,47.202]]]' and\n Query Parameter: geoproperty set to 'location' and\n Query Parameter: timerel set to 'after' and\n Query Parameter: timeAt set to '2020-07-01T12:05:00Z' and\n Query Parameter: context set to 'https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld'\n}", "http_verb": "GET", "endpoint": "temporal/entities" } diff --git a/doc/tests/test_ContextInformation_Consumption.py b/doc/tests/test_ContextInformation_Consumption.py index a29daf3e761691457c8ff904499990ce32b76914..0b6c649370137a0d804ab657b772263d6cd4ad74 100644 --- a/doc/tests/test_ContextInformation_Consumption.py +++ b/doc/tests/test_ContextInformation_Consumption.py @@ -259,6 +259,20 @@ class TestCIConsumptions(TestCase): self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_019_10(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_10.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_10.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_10.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + + def test_019_11(self): + robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/QueryEntities/019_11.robot' + expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/019_11.json' + difference_file = f'{self.folder_test_suites}/doc/results/out_019_11.json' + + self.common_function(robot_file=robot_file, expected_value=expected_value, difference_file=difference_file) + def test_018_01_01(self): robot_file = f'{self.folder_test_suites}/TP/NGSI-LD/ContextInformation/Consumption/Entity/RetrieveEntity/018_01_01.robot' expected_value = f'{self.folder_test_suites}/doc/files/ContextInformation/Consumption/018_01_01.json'