You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by "Konrad Windszus (Jira)" <ji...@apache.org> on 2021/11/14 18:14:00 UTC

[jira] [Comment Edited] (SLING-10919) OSGi Mock: Add properties "component.name" and "component.id" for registered DS components

    [ https://issues.apache.org/jira/browse/SLING-10919?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17443412#comment-17443412 ] 

Konrad Windszus edited comment on SLING-10919 at 11/14/21, 6:13 PM:
--------------------------------------------------------------------

This probably requires a change on {{MockOsgi.activate(...)}} to return the merged properties and include the generated ones. Otherwise they won't be passed to the service registration. Alternatively the merged properties and the calculated ones could be calculated (again) in {{OsgiContextImpl.registerInjectActivateService(...)}}.
[~sseifert] Any thoughts?


was (Author: kwin):
This probably requires a change on {{MockOsgi.activate(...)}} to return the merged properties and include the generated ones. Otherwise they won't be passed to the service registration.

> OSGi Mock: Add properties "component.name" and "component.id" for registered DS components
> ------------------------------------------------------------------------------------------
>
>                 Key: SLING-10919
>                 URL: https://issues.apache.org/jira/browse/SLING-10919
>             Project: Sling
>          Issue Type: Improvement
>          Components: Testing
>    Affects Versions: Testing OSGi Mock 3.1.4
>            Reporter: Konrad Windszus
>            Priority: Major
>
> The method {{OsgiContextImpl.registerInjectActivateService(...)}} is used for testing declarative services. According to OSGi Spec all services registered by DS have the mandatory properties "component.name" and "component.id" (http://docs.osgi.org/specification/osgi.cmpn/7.0.0/service.component.html#service.component-component.properties).
> Currently {{OsgiContextImpl}} does not add those mandatory properties so filtering for e.g. {{component.name}} will never succeed.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)