Skip to content

Commit

Permalink
Fixed another bug in ftClient
Browse files Browse the repository at this point in the history
  • Loading branch information
kzangeli committed Oct 1, 2024
1 parent cbb73b4 commit 6d38b4e
Show file tree
Hide file tree
Showing 2 changed files with 55 additions and 13 deletions.
64 changes: 53 additions & 11 deletions test/functionalTest/cases/0000_dds/dds_notifications.test
Original file line number Diff line number Diff line change
Expand Up @@ -33,8 +33,9 @@ ftClientStart -t 0-5000
#
# 01. Ask FT to publish an entity urn:E1 on topic 'P1'
# 02. Ask FT to publish an entity urn:E2 on topic 'P2'
# 03. Ask FT to publish an entity urn:E1 on topic 'P3'
# 04. Query the broker for all its entities, see urn:E1 and urn:E2
# 03. Ask FT to publish an entity urn:E3 on topic 'P3'
# 04. Ask FT to publish an entity urn:E4 on topic 'P4'
# 05. Query the broker for all its entities, see all four
#

echo "01. Ask FT to publish an entity urn:E1 on topic 'P1'"
Expand All @@ -57,7 +58,7 @@ echo
echo


echo "03. Ask FT to publish an entity urn:E1 on topic 'P3'"
echo "03. Ask FT to publish an entity urn:E3 on topic 'P3'"
echo "===================================================="
payload='{
"f": 3.14
Expand All @@ -67,8 +68,20 @@ echo
echo


echo "04. Query the broker for all its entities, see urn:E1 and urn:E2"
echo "================================================================"
echo "04. Ask FT to publish an entity urn:E4 on topic 'P4'"
echo "===================================================="
payload='{
"s": "p4",
"i": 4,
"f": 4.14
}'
orionCurl --url '/dds/pub?ddsTopicType=xyz&entityId=urn:E4&entityType=T&ddsTopicName=P4' --port $FT_PORT --payload "$payload"
echo
echo


echo "05. Query the broker for all its entities, see all four"
echo "======================================================="
orionCurl --url /ngsi-ld/v1/entities?local=true
echo
echo
Expand All @@ -89,17 +102,24 @@ Date: REGEX(.*)



03. Ask FT to publish an entity urn:E1 on topic 'P3'
03. Ask FT to publish an entity urn:E3 on topic 'P3'
====================================================
HTTP/1.1 204 No Content
Date: REGEX(.*)



04. Query the broker for all its entities, see urn:E1 and urn:E2
================================================================
04. Ask FT to publish an entity urn:E4 on topic 'P4'
====================================================
HTTP/1.1 204 No Content
Date: REGEX(.*)



05. Query the broker for all its entities, see all four
=======================================================
HTTP/1.1 200 OK
Content-Length: 610
Content-Length: 820
Content-Type: application/json
Date: REGEX(.*)
Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-contextREGEX(.*)
Expand Down Expand Up @@ -156,8 +176,8 @@ Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-contextREGEX(.*)
"data": {
"0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0": {
"b": false,
"f": 0,
"i": 3,
"f": 3.14,
"i": 0,
"ia": [
0,
0
Expand All @@ -170,6 +190,28 @@ Link: <https://uri.etsi.org/ngsi-ld/v1/ngsi-ld-core-contextREGEX(.*)
},
"id": "urn:REGEX(.*)",
"type": "T"
},
{
"P4": {
"type": "Property",
"value": {
"data": {
"0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0": {
"b": false,
"f": 4.14,
"i": 4,
"ia": [
0,
0
],
"s": "p4"
}
},
"type": "NgsildSample"
}
},
"id": "urn:REGEX(.*)",
"type": "T"
}
]

Expand Down
4 changes: 2 additions & 2 deletions test/functionalTest/ftClient/ddsPublish.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -144,8 +144,8 @@ void ddsPublishEntity
{
if (strcmp(attributeP->name, "s") == 0) s = attributeP->value.s;
else if (strcmp(attributeP->name, "i") == 0) i = attributeP->value.i;
else if (strcmp(attributeP->name, "f") == 0) i = attributeP->value.f;
else if (strcmp(attributeP->name, "b") == 0) i = attributeP->value.b;
else if (strcmp(attributeP->name, "f") == 0) f = attributeP->value.f;
else if (strcmp(attributeP->name, "b") == 0) b = attributeP->value.b;
}

publisherP->publish(entityType, entityId, topicName, s, i, f, b);
Expand Down

0 comments on commit 6d38b4e

Please sign in to comment.