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

[jira] [Closed] (SLING-10479) MockServiceRegistration.unregister should throw IllegalStateException if registration is already closed

     [ https://issues.apache.org/jira/browse/SLING-10479?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Stefan Seifert closed SLING-10479.
----------------------------------

> MockServiceRegistration.unregister should throw IllegalStateException if registration is already closed
> -------------------------------------------------------------------------------------------------------
>
>                 Key: SLING-10479
>                 URL: https://issues.apache.org/jira/browse/SLING-10479
>             Project: Sling
>          Issue Type: Bug
>          Components: Apache Sling Testing Clients
>    Affects Versions: Testing OSGi Mock 3.1.2
>            Reporter: Christian Schneider
>            Assignee: Christian Schneider
>            Priority: Major
>             Fix For: Testing OSGi Mock 3.1.4
>
>          Time Spent: 0.5h
>  Remaining Estimate: 0h
>
> I tested some code that threw IllegalStateException when a service registration was unregistered twice. 
> To test the behaviour automatically I created a unit test to reproduce the behaviour. 
> Unfortunately it seems that when using OsgiContext the MockServiceRegistration I get when registering a service does not show the same behaviour as a real object.
> So I propose we also throw a IllegalStateException when unregister is called twice. I can provide a test case and fix for this.
> There also might be other cases like registration failed when we also would like to throw but I am not sure ho to implement this.
>  



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