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

[jira] [Commented] (SLING-10497) JUnit Jupiter ParameterResolver for OSGi

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

Julian Sedding commented on SLING-10497:
----------------------------------------

I created [PR #8|https://github.com/apache/sling-org-apache-sling-junit-core/pull/8] for this issue.

I am uncertain if the JUnit Core bundle is the best place for this addition. It adds optional dependencies to {{org.junit.jupiter.api.extension}} and to {{org.apache.commons.lang3.reflect}}. If I judge the situation correctly, it would be possible, without too much trouble, to separate it into its own module.

> JUnit Jupiter ParameterResolver for OSGi
> ----------------------------------------
>
>                 Key: SLING-10497
>                 URL: https://issues.apache.org/jira/browse/SLING-10497
>             Project: Sling
>          Issue Type: New Feature
>          Components: JUnit Core, Testing
>    Affects Versions: JUnit Core 1.1.2
>            Reporter: Julian Sedding
>            Assignee: Julian Sedding
>            Priority: Minor
>
> Sling JUnit Core provides support for server-side tests, i.e. tests running within an OSGi environment. The bundle has recently been enhanced to (optionally) support the use of "JUnit Platform"-based {{TestEngine}}s. This allows running e.g. Jupiter (aka JUnit 5) tests.
> However, currently there is no Jupiter-style way to easily access OSGi services, as all existing utilities are tied to JUnit 4 APIs (e.g. {{TestRunner}} or {{TestRule}}).
> It would be desirable to allow easy access to OSGi services and the {{BundleContext}}/{{Bundle}} objects in Jupiter tests. This is typically done using a {{ParameterResolver}}, which allows injecting objects as method or constructor parameters.



--
This message was sent by Atlassian Jira
(v8.3.4#803005)