You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@sling.apache.org by GitBox <gi...@apache.org> on 2021/11/19 08:06:51 UTC

[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin opened a new pull request #13: SLING-10930 don't automatically call deactivate method

kwin opened a new pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13


   This prevents double executions of deactivate() for DS component's
   registered for more than one service


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] sonarcloud[bot] commented on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
sonarcloud[bot] commented on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-973850395


   Kudos, SonarCloud Quality Gate passed!&nbsp; &nbsp; ![Quality Gate passed](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/QualityGateBadge/passed-16px.png 'Quality Gate passed')
   
   [![Bug](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/bug-16px.png 'Bug')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=BUG) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=BUG)  
   [![Vulnerability](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/vulnerability-16px.png 'Vulnerability')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=VULNERABILITY) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=VULNERABILITY)  
   [![Security Hotspot](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/security_hotspot-16px.png 'Security Hotspot')](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=SECURITY_HOTSPOT) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=SECURITY_HOTSPOT)  
   [![Code Smell](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/common/code_smell-16px.png 'Code Smell')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=CODE_SMELL) [![A](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/RatingBadge/A-16px.png 'A')](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&resolved=false&types=CODE_SMELL)
   
   [![No Coverage information](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/NoCoverageInfo-16px.png 'No Coverage information')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&metric=coverage&view=list) No Coverage information  
   [![0.0%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/Duplications/3-16px.png '0.0%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&metric=new_duplicated_lines_density&view=list) [0.0% Duplication](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=13&metric=new_duplicated_lines_density&view=list)
   
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] stefanseifert commented on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
stefanseifert commented on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974367194


   i cannot follow completely - can you give an example which test is failing?
   what do you mean with DS component registry - calling deactivate only on DS components? can't we use the new DS-specific properties you introduced for detecting those?


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin edited a comment on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin edited a comment on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974385346


   The failing use case is:
   1. DS component registered automatically for service A
   2. DS component manually registered as service B (either in activate() or some other explicit method)
   3. DS component unregisters service B in its deactivate method
   3. DS component deactivated via MockBundleContext.shutdown() 
   a) Service B -> deactivate called -> calls BundleContext.unregisterService() .
   b) Service A -> deactivate called -> calls BundleContext.unregisterService() again.
   I will add some test which is failing with calling deactivate() multiple times on the same object.
   
   
   Regarding:
   > what do you mean with DS component registry - calling deactivate only on DS components?
   
   Simple OSGi services can be any type of pojo. (De-)activate methods are only defined and ever called for DS components according to the OSGi specs!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin commented on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-980010627


   Superseded by #14 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin edited a comment on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin edited a comment on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974385346


   The failing use case is:
   1. DS component registered automatically for service A
   2. DS component manually registered as service B (either in activate() or some other explicit method)
   3. DS component unregisters service B in its deactivate method
   3. DS component deactivated via MockBundleContext.shutdown() 
   a) Service B -> deactivate called -> calls BundleContext.unregisterService() .
   b) Service A -> deactivate called -> calls BundleContext.unregisterService() again.
   I will add some test which is failing with calling deactivate() multiple times on the same object.
   
   
   Regarding:
   > what do you mean with DS component registry - calling deactivate only on DS components?
   
   Simple OSGi services can be any type of Mojo. (De-)activate methods are only defined and ever called for DS components according to the OSGi specs!


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin commented on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974385346


   The failing use case is:
   1. DS component registered automatically for service A
   2. DS component manually registered as service B (either in activate() or some other explicit method)
   3. DS component unregisters service B in its deactivate method
   3. DS component deactivated via Service B -> deactivate called -> calls BundleContext.unregisterService() again -> exception is thrown.
   
   I will add some test which is failing with calling deactivate() multiple times on the same object.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin closed pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin closed pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13


   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] stefanseifert commented on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
stefanseifert commented on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974356131


   i would rather keep this deactivation - maybe resources are closed there which otherwise may leak or block other tests.
   if there is an edge case calling this multiple times, probably we can fix this easily, e.g. recording a set of impl classes during shutdown where we already called the deactivate method, and not calling it again on those.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin edited a comment on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin edited a comment on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974385346


   The failing use case is:
   1. DS component registered automatically for service A
   2. DS component manually registered as service B (either in activate() or some other explicit method)
   3. DS component unregisters service B in its deactivate method
   3. DS component deactivated via MockBundleContext.shutdown() 
   a) Service B -> deactivate called -> calls BundleContext.unregisterService() .
   b) Service A -> deactivate called -> calls BundleContext.unregisterService() again.
   I will add some test which is failing with calling deactivate() multiple times on the same object.


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin commented on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974362159


   This was experienced with a DS component I wanted to test. So a white list approach does not help here


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin commented on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin commented on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-975796970


   I added a failing test case in #14 


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin edited a comment on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin edited a comment on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974362159


   This was experienced with a DS component I wanted to test. So a white list approach does not help here. If we really need to call deactivate we need to introduce a DS component registry... OTOH simple OSGi services are not unregistered either...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org



[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin edited a comment on pull request #13: SLING-10930 don't automatically call deactivate method

Posted by GitBox <gi...@apache.org>.
kwin edited a comment on pull request #13:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/13#issuecomment-974362159


   This was experienced with a DS component I wanted to test. So a white list approach does not help here. If we really need to call deactivate we need to introduce a DS component registry...


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: dev-unsubscribe@sling.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org