Skip to content
{
"languageMap": {
"fr": "Grand Place",
"es": "Gran Lugar"
},
"providedBy": {
"type": "Relationship",
"object": "urn:ngsi-ld:Person:JohnDoe"
},
"@context": [
"https://forge.etsi.org/rep/cim/ngsi-ld-test-suite/-/raw/develop/resources/jsonld-contexts/ngsi-ld-test-suite-compound.jsonld"
]
}
{
"scope": "/CompanyA/OrganizationB/UnitC"
}
\ No newline at end of file
{
"street": {
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt"
}
},
"@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
{
"id":"urn:ngsi-ld:Subscription:randomUUID",
"type":"Subscription",
"entities":[
{
"type":"(Building|Tower)"
}
],
"notificationTrigger": ["entityCreated"],
"notification":{
"endpoint":{
"uri":"http://my.endpoint.org/notify"
}
},
"@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
{
"id":"urn:ngsi-ld:Vehicle:randomUUID",
"type":"Vehicle",
"street":[
{
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt"
},
"observedAt":"2020-08-01T12:03:00Z"
},
{
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt",
"es": "Gran Mercado"
},
"observedAt":"2020-08-01T12:05:00Z"
},
{
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Marché",
"nl": "Grote Markt",
"es": "Gran Lugar",
"it": "Grande Mercato"
},
"observedAt":"2020-08-01T12:07:00Z"
}
]
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Vehicle:randomUUID",
"type": "Vehicle",
"street": {
"type": "LanguageProperty",
"languageMaps": [
[
{
"languageMap": {
"fr": "Grand Place", "nl": "Grote Markt"
}
},
"2020-08-01T12:03:00Z"
],
[
{
"languageMap": {
"fr": "Grand Place", "nl": "Grote Markt", "es": "Gran Mercado" }
},
"2020-08-01T12:05:00Z"
],
[
{
"languageMap": {
"fr": "Grand Marché", "nl": "Grote Markt", "es": "Gran Lugar", "it": "Grande Mercato"
}
},
"2020-08-01T12:07:00Z"
]
]
}
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Vehicle:4656271219750725",
"type": "Vehicle",
"speed": {
"type": "Property",
"avg": [
[
100.0,
"2020-08-01T12:03:00Z",
"2020-08-01T13:03:00Z"
]
]
},
"fuelLevel": {
"type": "Property",
"avg": [
[
67.0,
"2020-08-01T12:03:00Z",
"2020-08-01T13:03:00Z"
],
[
53.0,
"2020-08-01T13:03:00Z",
"2020-08-01T14:03:00Z"
],
[
40.0,
"2020-08-01T14:03:00Z",
"2020-08-01T15:03:00Z"
]
]
}
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Vehicle:4656271219750725",
"type": "Vehicle",
"fuelLevel": {
"type": "Property",
"avg": [
[
67.0,
"2020-08-01T12:03:00Z",
"2020-08-01T13:03:00Z"
],
[
53.0,
"2020-08-01T13:03:00Z",
"2020-08-01T14:03:00Z"
],
[
40.0,
"2020-08-01T14:03:00Z",
"2020-08-01T15:03:00Z"
]
]
}
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Vehicle:4656271219750725",
"type": "Vehicle",
"speed": {
"type": "Property",
"avg": [
[
100.0,
"2020-08-01T12:03:00Z",
"2020-08-01T13:03:00Z"
]
],
"max": [
[
120.0,
"2020-08-01T12:03:00Z",
"2020-08-01T13:03:00Z"
]
]
},
"fuelLevel": {
"type": "Property",
"avg": [
[
67.0,
"2020-08-01T12:03:00Z",
"2020-08-01T13:03:00Z"
],
[
53.0,
"2020-08-01T13:03:00Z",
"2020-08-01T14:03:00Z"
],
[
40.0,
"2020-08-01T14:03:00Z",
"2020-08-01T15:03:00Z"
]
],
"max": [
[
67.0,
"2020-08-01T12:03:00Z",
"2020-08-01T13:03:00Z"
],
[
53.0,
"2020-08-01T13:03:00Z",
"2020-08-01T14:03:00Z"
],
[
40.0,
"2020-08-01T14:03:00Z",
"2020-08-01T15:03:00Z"
]
]
}
}
\ No newline at end of file
{
"id": "urn:ngsi-ld:Vehicle:7599642734962554",
"type": "Vehicle",
"speed": {
"type": "Property",
"min": [
[
80.0,
"2020-08-01T12:03:00Z",
"2020-08-02T12:03:00Z"
]
],
"max": [
[
120.0,
"2020-08-01T12:03:00Z",
"2020-08-02T12:03:00Z"
]
]
},
"fuelLevel": {
"type": "Property",
"min": [
[
40.0,
"2020-08-01T12:03:00Z",
"2020-08-02T12:03:00Z"
]
],
"max": [
[
67.0,
"2020-08-01T12:03:00Z",
"2020-08-02T12:03:00Z"
]
]
}
}
\ No newline at end of file
{
"id":"urn:ngsi-ld:Vehicle:randomUUID",
"type":"Vehicle",
"street":[
{
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt"
},
"observedAt":"2020-08-01T12:03:00Z"
},
{
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Place",
"nl": "Grote Markt",
"es": "Gran Mercado"
},
"observedAt":"2020-08-01T12:05:00Z"
},
{
"type": "LanguageProperty",
"languageMap": {
"fr": "Grand Marché",
"nl": "Grote Markt",
"es": "Gran Lugar",
"it": "Grande Mercato"
},
"observedAt":"2020-08-01T12:07:00Z"
}
],
"@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
......@@ -8,6 +8,8 @@ class Checks:
Checks.check_response_status_code,
'Check Response Body Containing Array Of URIs set to':
Checks.check_response_body_containing_array_of_uris_set_to,
'Check Response Body Containing Entities URIS set to' :
Checks.check_response_body_containing_entities_uris_set_to,
'Check Created Resources Set To':
Checks.check_created_resources_set_to,
'Check Response Headers Containing Content-Type set to':
......@@ -129,6 +131,10 @@ class Checks:
'params': ['expected_entities_ids', 'response_body'],
'position': [0, 1]
},
'Check Response Body Containing Entities URIS set to': {
'params': ['expected_entities_ids', 'response_body'],
'position': [0, 1]
},
'Check Response Body Containing ProblemDetails Element Containing Type Element set to': {
'params': ['type'],
'position': [1]
......@@ -439,6 +445,10 @@ class Checks:
def check_response_body_containing_array_of_uris_set_to(kwargs: list) -> str:
return 'Response Body set to an array of created entities ids'
@staticmethod
def check_response_body_containing_entities_uris_set_to(kwargs: list) -> str:
return 'Response Body contains entities ids'
@staticmethod
def check_created_resources_set_to(kwargs: list) -> str:
return 'Created resources set to ${entities}'
......@@ -967,6 +977,7 @@ if __name__ == "__main__":
print(data.get_checks(checks='Check Response Status Code',
status_code=201))
print(data.get_checks(checks='Check Response Body Containing Array Of URIs set to'))
print(data.get_checks(checks='Check Response Body Containing Entities URIS set to'))
print(data.get_checks(checks='Check Created Resources Set To'))
print(data.get_checks(checks='Check Response Headers Containing Content-Type set to',
content_type='application/json'))
......
from os.path import dirname
from robot.api import TestSuiteBuilder
from doc.analysis.parserobotfile import ParseRobotFile
from doc.analysis.parseapiutilsfile import ParseApiUtilsFile
from doc.analysis.parsevariablesfile import ParseVariablesFile
from doc.analysis.initial_setup import InitialSetup
from analysis.parserobotfile import ParseRobotFile
from analysis.parseapiutilsfile import ParseApiUtilsFile
from analysis.parsevariablesfile import ParseVariablesFile
from analysis.initial_setup import InitialSetup
from re import match, findall, finditer, sub, MULTILINE
......@@ -121,6 +121,38 @@ class GenerateRobotData:
# Generate the initial_condition of the test suite
self.test_suite['initial_condition'] = self.generate_initial_condition()
# Generate the parent release and correct the reference in case that the tags include information since_v1.x.y
self.get_version()
def get_version(self):
data = [x['tags'] for x in self.test_suite['test_cases']]
aux = [item for sublist in data for item in sublist if item.startswith('since')]
if len(aux) == 0:
has_since = False
else:
has_since = True
are_all_same = all(item == aux[0] for item in aux)
if are_all_same and has_since:
aux = aux[0]
aux = aux.split('since_')[1]
else:
if has_since:
print('Error not all the tags have the same version. Select default v1.3.1')
aux = 'v1.3.1'
if 'clauses' in self.test_suite['reference']:
self.test_suite['reference'] = \
f"ETSI GS CIM 009 V{aux.split('v')[1]} [], clauses {self.test_suite['reference'].split('clauses ')[1]}"
else:
self.test_suite['reference'] = \
f"ETSI GS CIM 009 V{aux.split('v')[1]} [], clause {self.test_suite['reference'].split('clause ')[1]}"
self.test_suite['parent_release'] = aux
def generate_initial_condition(self) -> str:
aux = [x['setup'] for x in self.test_cases]
if all(element == aux[0] for element in aux[1:]):
......
import re
import os
from doc.analysis.checks import Checks
from doc.analysis.requests import Requests
from analysis.checks import Checks
from analysis.requests import Requests
class ParseRobotFile:
......
......@@ -30,7 +30,7 @@ class Requests:
},
'Query Entity': {
'positions': [],
'params': ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options']
'params': ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options', 'lang']
},
'Retrieve Subscription': {
'positions': [],
......@@ -85,7 +85,7 @@ class Requests:
'params': ['entity_ids', 'entity_types', 'accept',
'attrs', 'context', 'geoproperty',
'options', 'limit', 'entity_id_pattern',
'georel', 'coordinates', 'geometry', 'count', 'q']
'scopeq', 'georel', 'coordinates', 'geometry', 'count', 'q']
},
'Query Entities Via POST': {
'positions': [],
......@@ -95,8 +95,8 @@ class Requests:
'Retrieve Temporal Representation Of Entity': {
'positions': [],
'params': ['temporal_entity_representation_id', 'attrs', 'options',
'context', 'timerel', 'timeAt',
'endTimeAt', 'lastN', 'accept']
'context', 'timerel', 'timeAt', 'endTimeAt', 'lastN', 'accept',
'aggrMethods', 'aggrPeriodDuration']
},
'Delete Entity by Id': {
'positions': [0],
......@@ -675,7 +675,7 @@ class Requests:
@staticmethod
def query_entity(kwargs) -> str:
expected_parameters = ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options']
expected_parameters = ['id', 'accept', 'attrs', 'context', 'geoproperty', 'options', 'lang']
result = [x for x in kwargs if x not in expected_parameters]
response = "Get Entity Request:"
......@@ -694,6 +694,8 @@ class Requests:
response = f"{response} and\n Query Parameter: geoproperty set to '{value}'"
case 'options':
response = f"{response} and\n Query Parameter: options set to '{value}'"
case 'lang':
response = f"{response} and\n Query Parameter: lang set to '{value}'"
case _:
raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are "
f"'{expected_parameters}', but received: {kwargs}")
......@@ -1077,8 +1079,8 @@ class Requests:
@staticmethod
def retrieve_temporal_representation_of_entity(kwargs) -> str:
expected_parameters = ['temporal_entity_representation_id', 'attrs', 'options',
'context', 'timerel', 'timeAt',
'endTimeAt', 'lastN', 'accept']
'context', 'timerel', 'timeAt', 'endTimeAt', 'lastN', 'accept',
'aggrMethods', 'aggrPeriodDuration']
result = [x for x in kwargs if x not in expected_parameters]
response = "Retrieve Temporal Representation of Entity"
for key, value in kwargs.items():
......@@ -1102,6 +1104,10 @@ class Requests:
response = f"{response} and\n Query Parameter: lastN set to '{value}'"
case 'accept':
response = f"{response} and\n Query Parameter: accept set to '{value}'"
case 'aggrMethods':
response = f"{response} and\n Query Parameter: aggrMethods set to '{value}'"
case 'aggrPeriodDuration':
response = f"{response} and\n Query Parameter: aggrPeriodDuration set to '{value}'"
# If an exact match is not confirmed, this last case will be used if provided
case _:
raise Exception(f"ERROR, unexpected attribute '{result}', the attributes expected are "
......@@ -1133,7 +1139,7 @@ class Requests:
expected_parameters = ['entity_ids', 'entity_types', 'accept',
'attrs', 'context', 'geoproperty',
'options', 'limit', 'entity_id_pattern',
'georel', 'coordinates', 'geometry', 'count' , 'q']
'scopeq', 'georel', 'coordinates', 'geometry', 'count' , 'q']
result = [x for x in kwargs if x not in expected_parameters]
response = "Get Entities Request:"
......@@ -1158,6 +1164,8 @@ class Requests:
response = f"{response} and\n Query Parameter: limit set to '{value}'"
case 'entity_id_pattern':
response = f"{response} and\n Query Parameter: entity_id_pattern set to '{value}'"
case 'scopeq':
response = f"{response} and\n Query Parameter: scopeq set to '{value}'"
case 'georel':
response = f"{response} and\n Query Parameter: georel set to '{value}'"
case 'coordinates':
......
{
"tp_id": "TP/NGSI-LD/CI/Cons/E/018_07",
"test_objective": "Check that you can retrieve an entity using Language Filter",
"reference": "ETSI GS CIM 009 V1.4.1 [], clauses 4.15, 5.7.1",
"config_id": "",
"parent_release": "v1.4.1",
"clauses": [
"4.15",
"5.7.1"
],
"pics_selection": "",
"keywords": [
"Retrieve Entity With Language Filter",
"Create Initial Entity",
"Delete Created Entity"
],
"teardown": "Delete Created Entity",
"initial_condition": "with {\n the SUT containing an initial state\n}",
"test_cases": [
{
"name": "018_07_01 Retrieve an entity using a specific natural language",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_01",
"doc": "Check that you can retrieve an entity using Language Filter",
"tags": [
"4_15",
"5_7_1",
"e-retrieve",
"since_v1.4.1"
],
"setup": null,
"teardown": null,
"template": "Retrieve Entity With Language Filter",
"then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-language-property-fr-filter.jsonld'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' 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: options set to '${EMPTY}' and\n Query Parameter: lang set to 'fr'\n}",
"http_verb": "GET",
"endpoint": "entities/{id}"
},
{
"name": "018_07_02 Retrieve an entity using multiple natural languages with no ranked preference",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_02",
"doc": "Check that you can retrieve an entity using Language Filter",
"tags": [
"4_15",
"5_7_1",
"e-retrieve",
"since_v1.4.1"
],
"setup": null,
"teardown": null,
"template": "Retrieve Entity With Language Filter",
"then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-language-property-fr-filter.jsonld'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' 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: options set to '${EMPTY}' and\n Query Parameter: lang set to 'fr-CH,fr'\n}",
"http_verb": "GET",
"endpoint": "entities/{id}"
},
{
"name": "018_07_03 Retrieve an entity with any supported language",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_03",
"doc": "Check that you can retrieve an entity using Language Filter",
"tags": [
"4_15",
"5_7_1",
"e-retrieve",
"since_v1.4.1"
],
"setup": null,
"teardown": null,
"template": "Retrieve Entity With Language Filter",
"then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-language-property-any-language-filter.jsonld'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' 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: options set to '${EMPTY}' and\n Query Parameter: lang set to '*'\n}",
"http_verb": "GET",
"endpoint": "entities/{id}"
},
{
"name": "018_07_04 Retrieve an entity using multiple natural languages with ranked preferences",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_04",
"doc": "Check that you can retrieve an entity using Language Filter",
"tags": [
"4_15",
"5_7_1",
"e-retrieve",
"since_v1.4.1"
],
"setup": null,
"teardown": null,
"template": "Retrieve Entity With Language Filter",
"then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-language-property-fr-filter.jsonld'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' 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: options set to '${EMPTY}' and\n Query Parameter: lang set to 'fr-CH,fr;q=0.9,en;q=0.8,*;q=0.5'\n}",
"http_verb": "GET",
"endpoint": "entities/{id}"
},
{
"name": "018_07_05 Retrieve an entity using a specific natural language with simplified representation",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_05",
"doc": "Check that you can retrieve an entity using Language Filter",
"tags": [
"4_15",
"5_7_1",
"e-retrieve",
"since_v1.4.1"
],
"setup": null,
"teardown": null,
"template": "Retrieve Entity With Language Filter",
"then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-language-property-fr-filter-simplified.jsonld'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' 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: options set to 'keyValues' and\n Query Parameter: lang set to 'fr'\n}",
"http_verb": "GET",
"endpoint": "entities/{id}"
},
{
"name": "018_07_06 Retrieve an entity with any supported language with simplified representation",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/018_07_06",
"doc": "Check that you can retrieve an entity using Language Filter",
"tags": [
"4_15",
"5_7_1",
"e-retrieve",
"since_v1.4.1"
],
"setup": null,
"teardown": null,
"template": "Retrieve Entity With Language Filter",
"then": "then {\n the SUT sends a valid Response for the operations:\n Query Entity with Response Status Code set to 200 and\n Query Entity with Response Body containing en entity element with id set to '${entity_id}' and body content set to 'building-language-property-any-language-filter-simplified.jsonld'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/entities/{id}'\n method set to 'GET'\n Get Entity Request: and\n Query Parameter: id set to '${entity_id}' and\n Query Parameter: accept set to 'application/ld+json' 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: options set to 'keyValues' and\n Query Parameter: lang set to '*'\n}",
"http_verb": "GET",
"endpoint": "entities/{id}"
}
],
"permutations": [
"then",
"when"
],
"robotpath": "ContextInformation/Consumption/Entity/RetrieveEntity",
"robotfile": "018_07"
}
\ No newline at end of file
{
"tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_06",
"test_objective": "Check that you can query several entities based on scopes",
"reference": "ETSI GS CIM 009 V1.5.1 [], clause 4.19",
"config_id": "",
"parent_release": "v1.5.1",
"clauses": [
"4.19"
],
"pics_selection": "",
"keywords": [
"Query several entities based on scopes",
"Setup Initial Entities",
"Delete Entities"
],
"teardown": "Delete Entities",
"initial_condition": "with {\n the SUT containing an initial state\n}",
"test_cases": [
{
"name": "019_01_06 QueryWithFullScope",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_06",
"doc": "Check that you can query several entities based on scopes",
"tags": [
"4_19",
"e-query",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query several entities based on scopes",
"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 Body containing a list of entities equal to '${2}' of type 'https://ngsi-ld-test-suite/context#Building' with response set to '${response.json()}'\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: scopeq set to '/Madrid/Gardens/ParqueNorte' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_01_06 QueryWithPlusMatching",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_06",
"doc": "Check that you can query several entities based on scopes",
"tags": [
"4_19",
"e-query",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query several entities based on scopes",
"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 Body containing a list of entities equal to '${2}' of type 'https://ngsi-ld-test-suite/context#Building' with response set to '${response.json()}'\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: scopeq set to '/Madrid/+/ParqueNorte' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_01_06 QueryWithHashMatching",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_06",
"doc": "Check that you can query several entities based on scopes",
"tags": [
"4_19",
"e-query",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query several entities based on scopes",
"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 Body containing a list of entities equal to '${1}' of type 'https://ngsi-ld-test-suite/context#Building' with response set to '${response.json()}'\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: scopeq set to '/CompanyA/#' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_01_06 QueryNonEmptyScope",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_06",
"doc": "Check that you can query several entities based on scopes",
"tags": [
"4_19",
"e-query",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query several entities based on scopes",
"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 Body containing a list of entities equal to '${2}' of type 'https://ngsi-ld-test-suite/context#Building' with response set to '${response.json()}'\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: scopeq set to '/#' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_01_06 QueryWithAndScope",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_06",
"doc": "Check that you can query several entities based on scopes",
"tags": [
"4_19",
"e-query",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query several entities based on scopes",
"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 Body containing a list of entities equal to '${1}' of type 'https://ngsi-ld-test-suite/context#Building' with response set to '${response.json()}'\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: scopeq set to '/Madrid/Gardens/ParqueNorte;/CompanyA/OrganizationB/UnitC' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_01_06 QueryWithOrScope",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_01_06",
"doc": "Check that you can query several entities based on scopes",
"tags": [
"4_19",
"e-query",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query several entities based on scopes",
"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 Body containing a list of entities equal to '${2}' of type 'https://ngsi-ld-test-suite/context#Building' with response set to '${response.json()}'\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: scopeq set to '/Madrid/Gardens/ParqueNorte,/CompanyA/OrganizationB/UnitC' and\n Query Parameter: entity_types set to 'https://ngsi-ld-test-suite/context#Building'\n}",
"http_verb": "GET",
"endpoint": "entities/"
}
],
"permutations": [
"then",
"when"
],
"robotpath": "ContextInformation/Consumption/Entity/QueryEntities",
"robotfile": "019_01_06"
}
\ No newline at end of file
{
"tp_id": "TP/NGSI-LD/CI/Cons/E/019_08",
"test_objective": "Query entities with Entity Type Selection Language.",
"reference": "ETSI GS CIM 009 V1.5.1 [], clauses 4.17, 5.7.2",
"config_id": "",
"parent_release": "v1.5.1",
"clauses": [
"4.17",
"5.7.2"
],
"pics_selection": "",
"keywords": [
"Query entities using Entity Type Selection Language",
"Setup Initial Entities",
"Delete Initial Entities"
],
"teardown": "Delete Initial Entities",
"initial_condition": "with {\n the SUT containing an initial state\n}",
"test_cases": [
{
"name": "019_08_01 query with one type",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_08_01",
"doc": "Query entities with Entity Type Selection Language.",
"tags": [
"e-query",
"4_17",
"5_7_2",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query entities using Entity Type Selection Language",
"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 Body contains entities ids\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 '${entity_types_selection}' 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\"'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_08_02 query with the AND operator",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_08_02",
"doc": "Query entities with Entity Type Selection Language.",
"tags": [
"e-query",
"4_17",
"5_7_2",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query entities using Entity Type Selection Language",
"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 Body contains entities ids\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 '${entity_types_selection}' 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\"'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_08_03 query with the OR operator",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_08_03",
"doc": "Query entities with Entity Type Selection Language.",
"tags": [
"e-query",
"4_17",
"5_7_2",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query entities using Entity Type Selection Language",
"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 Body contains entities ids\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 '${entity_types_selection}' 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\"'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_08_04 different query with the OR operator",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_08_04",
"doc": "Query entities with Entity Type Selection Language.",
"tags": [
"e-query",
"4_17",
"5_7_2",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query entities using Entity Type Selection Language",
"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 Body contains entities ids\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 '${entity_types_selection}' 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\"'\n}",
"http_verb": "GET",
"endpoint": "entities/"
},
{
"name": "019_08_05 query with two operators",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/E/019_08_05",
"doc": "Query entities with Entity Type Selection Language.",
"tags": [
"e-query",
"4_17",
"5_7_2",
"since_v1.5.1"
],
"setup": null,
"teardown": null,
"template": "Query entities using Entity Type Selection Language",
"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 Body contains entities ids\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 '${entity_types_selection}' 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\"'\n}",
"http_verb": "GET",
"endpoint": "entities/"
}
],
"permutations": [],
"robotpath": "ContextInformation/Consumption/Entity/QueryEntities",
"robotfile": "019_08"
}
\ No newline at end of file
{
"tp_id": "TP/NGSI-LD/CI/Cons/TE/020_11",
"test_objective": "Check that you can retrieve the temporal evolution of an entity with the aggregated temporal representation",
"reference": "ETSI GS CIM 009 V1.4.1 [], clauses 4.5.19, 5.7.3",
"config_id": "",
"parent_release": "v1.4.1",
"clauses": [
"4.5.19",
"5.7.3"
],
"pics_selection": "",
"keywords": [
"Retrieve the temporal evolution of an entity with the aggregated temporal representation",
"Create Temporal Entity",
"Delete Initial Temporal Entity"
],
"teardown": "Delete Initial Temporal Entity",
"initial_condition": "with {\n the SUT containing an initial state\n}",
"test_cases": [
{
"name": "020_11_01 One aggregate method aggregated by one hour duration",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_11_01",
"doc": "Check that you can retrieve the temporal evolution of an entity with the aggregated temporal representation",
"tags": [
"4_5_19",
"5_7_3",
"since_v1.4.1",
"te-retrieve"
],
"setup": null,
"teardown": null,
"template": "Retrieve the temporal evolution of an entity with the aggregated temporal representation",
"then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-11-01-expectation.json'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: attrs set to '${EMPTY}' and\n Query Parameter: options set to '${options}' and\n Query Parameter: aggrMethods set to 'avg' and\n Query Parameter: aggrPeriodDuration set to 'PT1H' 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/{temporal_entity_representation_id}"
},
{
"name": "020_11_02 One aggregate method aggregated by one hour duration asking for one attribute",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_11_02",
"doc": "Check that you can retrieve the temporal evolution of an entity with the aggregated temporal representation",
"tags": [
"4_5_19",
"5_7_3",
"since_v1.4.1",
"te-retrieve"
],
"setup": null,
"teardown": null,
"template": "Retrieve the temporal evolution of an entity with the aggregated temporal representation",
"then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-11-02-expectation.json'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: attrs set to 'fuelLevel' and\n Query Parameter: options set to '${options}' and\n Query Parameter: aggrMethods set to 'avg' and\n Query Parameter: aggrPeriodDuration set to 'PT1H' 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/{temporal_entity_representation_id}"
},
{
"name": "020_11_03 Multiple aggregate methods aggregated by one hour duration",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_11_03",
"doc": "Check that you can retrieve the temporal evolution of an entity with the aggregated temporal representation",
"tags": [
"4_5_19",
"5_7_3",
"since_v1.4.1",
"te-retrieve"
],
"setup": null,
"teardown": null,
"template": "Retrieve the temporal evolution of an entity with the aggregated temporal representation",
"then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-11-03-expectation.json'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: attrs set to '${EMPTY}' and\n Query Parameter: options set to '${options}' and\n Query Parameter: aggrMethods set to 'avg,max' and\n Query Parameter: aggrPeriodDuration set to 'PT1H' 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/{temporal_entity_representation_id}"
},
{
"name": "020_11_04 Multiple aggregate methods aggregated by one day duration",
"permutation_tp_id": "TP/NGSI-LD/CI/Cons/TE/020_11_04",
"doc": "Check that you can retrieve the temporal evolution of an entity with the aggregated temporal representation",
"tags": [
"4_5_19",
"5_7_3",
"since_v1.4.1",
"te-retrieve"
],
"setup": null,
"teardown": null,
"template": "Retrieve the temporal evolution of an entity with the aggregated temporal representation",
"then": "then {\n the SUT sends a valid Response for the operations:\n Retrieve Temporal Representation Of Entity with Response Status Code set to 200 and\n Retrieve Temporal Representation Of Entity with Response Body containing EntityTemporal element containing attribute instances in the time range specified by the NGSI-LD temporal query:\n * the payload is defined in the file set to 'vehicle-temporal-representation-020-11-04-expectation.json'\n * the id was changed to '${temporal_entity_representation_id}'\n * response body to be checked set to '${response.json()}'\n}",
"when": "when {\n the SUT receives a Request from the client containing:\n URL set to '/ngsi-ld/v1/temporal/entities/{temporal_entity_representation_id}'\n method set to 'GET'\n Retrieve Temporal Representation of Entity and\n Query Parameter: id set to '${temporal_entity_representation_id}' and\n Query Parameter: attrs set to '${EMPTY}' and\n Query Parameter: options set to '${options}' and\n Query Parameter: aggrMethods set to 'min,max' and\n Query Parameter: aggrPeriodDuration set to 'P1D' 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/{temporal_entity_representation_id}"
}
],
"permutations": [
"then",
"when"
],
"robotpath": "ContextInformation/Consumption/TemporalEntity/RetrieveTemporalEvolutionOfEntity",
"robotfile": "020_11"
}
\ No newline at end of file