Skip to content

Commit

Permalink
#509: Update usage of CELIX_FRAMEWORK_UUID in C++ sources
Browse files Browse the repository at this point in the history
  • Loading branch information
pnoltes committed Oct 29, 2023
1 parent 918fe22 commit 84ea39f
Show file tree
Hide file tree
Showing 6 changed files with 11 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ static void OnServiceBrowseCallback(DNSServiceRef sdRef, DNSServiceFlags flags,
static void OnUseServiceCallback(void *handle, void *svc) {
DiscoveryZeroconfAnnouncerTestSuite *t = (DiscoveryZeroconfAnnouncerTestSuite *)handle;
endpoint_listener_t *epl = (endpoint_listener_t *)svc;
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_UUID, nullptr);
celix_properties_t *properties = celix_properties_create();
if (t->ifIndex == kDNSServiceInterfaceIndexAny) {
celix_properties_set(properties, CELIX_RSA_NETWORK_INTERFACES, "all");
Expand Down Expand Up @@ -249,7 +249,7 @@ TEST_F(DiscoveryZeroconfAnnouncerTestSuite, AddAndRemoveLocalOnlyEndpoint) {
static void OnUseServiceCallbackForRegisterServiceFailure(void *handle, void *svc) {
DiscoveryZeroconfAnnouncerTestSuite *t = (DiscoveryZeroconfAnnouncerTestSuite *)handle;
endpoint_listener_t *epl = (endpoint_listener_t *)svc;
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_UUID, nullptr);
celix_properties_t *properties = celix_properties_create();
celix_properties_set(properties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, fwUuid);
celix_properties_set(properties, CELIX_FRAMEWORK_SERVICE_NAME, "dzc_test_service");
Expand Down Expand Up @@ -291,7 +291,7 @@ TEST_F(DiscoveryZeroconfAnnouncerTestSuite, FailedToRegisterService) {
static void OnUseServiceCallbackForNameConflict(void *handle, void *svc) {
DiscoveryZeroconfAnnouncerTestSuite *t = (DiscoveryZeroconfAnnouncerTestSuite *)handle;
endpoint_listener_t *epl = (endpoint_listener_t *)svc;
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_UUID, nullptr);
celix_properties_t *properties = celix_properties_create();
if (t->ifIndex == kDNSServiceInterfaceIndexAny) {
celix_properties_set(properties, CELIX_RSA_NETWORK_INTERFACES, "all");
Expand Down Expand Up @@ -396,7 +396,7 @@ TEST_F(DiscoveryZeroconfAnnouncerTestSuite, AddAndRemoveLoopBackEndpoint) {
static void OnUseServiceWithJumboEndpointCallback(void *handle, void *svc) {
DiscoveryZeroconfAnnouncerTestSuite *t = (DiscoveryZeroconfAnnouncerTestSuite *)handle;
endpoint_listener_t *epl = (endpoint_listener_t *)svc;
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_UUID, nullptr);
celix_properties_t *properties = celix_properties_create();
if (t->ifIndex == kDNSServiceInterfaceIndexAny) {
celix_properties_set(properties, CELIX_RSA_NETWORK_INTERFACES, "all");
Expand Down Expand Up @@ -462,7 +462,7 @@ static void OnUseServiceWithInvalidEndpointCallback(void *handle, void *svc) {
status = epl->endpointRemoved(epl->handle, nullptr, nullptr);
EXPECT_EQ(status, CELIX_ILLEGAL_ARGUMENT);

const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_UUID, nullptr);
celix_properties_t *properties = celix_properties_create();
celix_properties_set(properties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, fwUuid);
celix_properties_set(properties, CELIX_FRAMEWORK_SERVICE_NAME, "dzc_test_service");
Expand Down Expand Up @@ -500,7 +500,7 @@ TEST_F(DiscoveryZeroconfAnnouncerTestSuite, AddInvalidEndpoint) {
static void OnUseServiceForAddEndpointENOMEM(void *handle, void *svc) {
DiscoveryZeroconfAnnouncerTestSuite *t = (DiscoveryZeroconfAnnouncerTestSuite *)handle;
endpoint_listener_t *epl = (endpoint_listener_t *)svc;
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
const char *fwUuid = celix_bundleContext_getProperty(t->ctx.get(), CELIX_FRAMEWORK_UUID, nullptr);
celix_properties_t *properties = celix_properties_create();
if (t->ifIndex == kDNSServiceInterfaceIndexAny) {
celix_properties_set(properties, CELIX_RSA_NETWORK_INTERFACES, "all");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -293,7 +293,7 @@ TEST_F(DiscoveryZeroconfWatcherTestSuite, AddAndRemoveSelfFrameworkEndpoint) {
char txtBuf[1300] = {0};
TXTRecordRef txtRecord;
TXTRecordCreate(&txtRecord, sizeof(txtBuf), txtBuf);
const char *fwUuid = celix_bundleContext_getProperty(ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
const char *fwUuid = celix_bundleContext_getProperty(ctx.get(), CELIX_FRAMEWORK_UUID, nullptr);
TXTRecordSetValue(&txtRecord, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, fwUuid == nullptr ? 0 : strlen(fwUuid), fwUuid);
TXTRecordSetValue(&txtRecord, CELIX_FRAMEWORK_SERVICE_NAME, strlen("dzc_test_self_fw_service"), "dzc_test_self_fw_service");
TXTRecordSetValue(&txtRecord, OSGI_RSA_ENDPOINT_ID, strlen("60f49d89-d105-430c-b12b-93fbb54b1d19"), "60f49d89-d105-430c-b12b-93fbb54b1d19");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ class RsaShmExportRegUnitTestSuite : public ::testing::Test {
celix_properties_set(properties, OSGI_RSA_ENDPOINT_ID, "7f7efba5-500f-4ee9-b733-68de012091da");
celix_properties_setLong(properties, OSGI_RSA_ENDPOINT_SERVICE_ID, calcSvcId);
celix_properties_set(properties, OSGI_RSA_SERVICE_IMPORTED, "true");
celix_properties_set(properties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, celix_bundleContext_getProperty(ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, ""));
celix_properties_set(properties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, celix_bundleContext_getProperty(ctx.get(), CELIX_FRAMEWORK_UUID, ""));
celix_properties_set(properties, RSA_SHM_SERVER_NAME_KEY, "ShmServ-dummy");
endpoint_description_t *endpoint = nullptr;
auto status = endpointDescription_create(properties, &endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ class RsaShmImportRegUnitTestSuite : public ::testing::Test {
celix_properties_set(properties, OSGI_RSA_ENDPOINT_ID, "7f7efba5-500f-4ee9-b733-68de012091da");
celix_properties_setLong(properties, OSGI_RSA_ENDPOINT_SERVICE_ID, 100);//Set a dummy service id
celix_properties_set(properties, OSGI_RSA_SERVICE_IMPORTED, "true");
celix_properties_set(properties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, celix_bundleContext_getProperty(ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, ""));
celix_properties_set(properties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, celix_bundleContext_getProperty(ctx.get(), CELIX_FRAMEWORK_UUID, ""));
celix_properties_set(properties, RSA_SHM_SERVER_NAME_KEY, "ShmServ-dummy");
endpoint_description_t *endpoint = nullptr;
auto status = endpointDescription_create(properties, &endpoint);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,7 @@ class RsaJsonRpcUnitTestSuite : public ::testing::Test {
EXPECT_NE(endpointDesc, nullptr);
endpointDesc->properties = celix_properties_create();
EXPECT_TRUE(endpointDesc->properties != nullptr);
const char *uuid = celix_bundleContext_getProperty(ctx.get(), CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
const char *uuid = celix_bundleContext_getProperty(ctx.get(), CELIX_FRAMEWORK_UUID, nullptr);
celix_properties_set(endpointDesc->properties, OSGI_RSA_ENDPOINT_FRAMEWORK_UUID, uuid);
celix_properties_set(endpointDesc->properties, CELIX_FRAMEWORK_SERVICE_NAME, RSA_RPC_JSON_TEST_SERVICE);
celix_properties_set(endpointDesc->properties, CELIX_FRAMEWORK_SERVICE_VERSION, "1.0.0");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ pubsub_nanomsg_admin::pubsub_nanomsg_admin(celix_bundle_context_t *_ctx):
ctx{_ctx},
L{ctx, "pubsub_nanomsg_admin"} {
verbose = celix_bundleContext_getPropertyAsBool(ctx, PUBSUB_NANOMSG_VERBOSE_KEY, PUBSUB_NANOMSG_VERBOSE_DEFAULT);
fwUUID = celix_bundleContext_getProperty(ctx, CELIX_FRAMEWORK_FRAMEWORK_UUID, nullptr);
fwUUID = celix_bundleContext_getProperty(ctx, CELIX_FRAMEWORK_UUID, nullptr);

char *ip = nullptr;
const char *confIp = celix_bundleContext_getProperty(ctx, PUBSUB_NANOMSG_PSA_IP_KEY , nullptr);
Expand Down

0 comments on commit 84ea39f

Please sign in to comment.