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/16 15:56:37 UTC

[GitHub] [sling-org-apache-sling-testing-osgi-mock] kwin opened a new pull request #11: SLING-10922 don't consider DS metadata/CA for plain OSGi service

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


   registration


-- 
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 merged pull request #11: SLING-10922 don't consider DS metadata/CA for plain OSGi service

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


   


-- 
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 a change in pull request #11: SLING-10922 don't consider DS metadata/CA for plain OSGi service

Posted by GitBox <gi...@apache.org>.
stefanseifert commented on a change in pull request #11:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/11#discussion_r751481635



##########
File path: core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
##########
@@ -133,75 +133,73 @@ private void registerDefaultServices() {
     }
 
     /**
-     * Injects dependencies, activates and registers a service in the mocked OSGi environment.
-     * @param <T> Service type
-     * @param service Service instance
-     * @return Registered service instance
+     * Injects dependencies, activates and registers a DS component in the mocked OSGi environment.
+     * Construction injection for OSGi services is supported.
+     * @param <T> DS Component type
+     * @param component a DS component instance
+     * @return the DS component instance
      */
-    public final @NotNull <T> T registerInjectActivateService(@NotNull final T service) {
-        return registerInjectActivateService(service, (Map<String,Object>)null);
+    public final @NotNull <T> T registerInjectActivateService(@NotNull final T component) {

Review comment:
       i would prefer updating the comments if required than renaming the method - the name is a bit awkward but used in nearly every unit test over all those years, it think there is no benefit renaming it now (although i like the simplicity of "setupDsComponent")




-- 
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 a change in pull request #11: SLING-10922 don't consider DS metadata/CA for plain OSGi service

Posted by GitBox <gi...@apache.org>.
kwin commented on a change in pull request #11:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/11#discussion_r750560287



##########
File path: core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
##########
@@ -133,75 +133,73 @@ private void registerDefaultServices() {
     }
 
     /**
-     * Injects dependencies, activates and registers a service in the mocked OSGi environment.
-     * @param <T> Service type
-     * @param service Service instance
-     * @return Registered service instance
+     * Injects dependencies, activates and registers a DS component in the mocked OSGi environment.
+     * Construction injection for OSGi services is supported.
+     * @param <T> DS Component type
+     * @param component a DS component instance
+     * @return the DS component instance
      */
-    public final @NotNull <T> T registerInjectActivateService(@NotNull final T service) {
-        return registerInjectActivateService(service, (Map<String,Object>)null);
+    public final @NotNull <T> T registerInjectActivateService(@NotNull final T component) {

Review comment:
       The name is a bit weird as this may potentially register multiple services but I guess it is too late now to change that. Maybe we can deprecate these method names and instead introduce `injectActivateRegisterComponent` (because in fact service registration happens after calling activate). WDYT @stefanseifert 




-- 
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 #11: SLING-10922 don't consider DS metadata/CA for plain OSGi service

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


   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=11&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=11&resolved=false&types=BUG) [0 Bugs](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=11&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=11&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=11&resolved=false&types=VULNERABILITY) [0 Vulnerabilities](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=11&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=11&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=11&resolved=false&types=SECURITY_HOTSPOT) [0 Security Hotspots](https://sonarcloud.io/project/security_hotspots?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=11&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=11&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=11&resolved=false&types=CODE_SMELL) [0 Code Smells](https://sonarcloud.io/project/issues?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=11&resolved=false&types=CODE_SMELL)
   
   [![84.8%](https://sonarsource.github.io/sonarcloud-github-static-resources/v2/checks/CoverageChart/60-16px.png '84.8%')](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=11&metric=new_coverage&view=list) [84.8% Coverage](https://sonarcloud.io/component_measures?id=apache_sling-org-apache-sling-testing-osgi-mock&pullRequest=11&metric=new_coverage&view=list)  
   [![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=11&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=11&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] kwin commented on a change in pull request #11: SLING-10922 don't consider DS metadata/CA for plain OSGi service

Posted by GitBox <gi...@apache.org>.
kwin commented on a change in pull request #11:
URL: https://github.com/apache/sling-org-apache-sling-testing-osgi-mock/pull/11#discussion_r750561405



##########
File path: core/src/main/java/org/apache/sling/testing/mock/osgi/context/OsgiContextImpl.java
##########
@@ -133,75 +133,73 @@ private void registerDefaultServices() {
     }
 
     /**
-     * Injects dependencies, activates and registers a service in the mocked OSGi environment.
-     * @param <T> Service type
-     * @param service Service instance
-     * @return Registered service instance
+     * Injects dependencies, activates and registers a DS component in the mocked OSGi environment.
+     * Construction injection for OSGi services is supported.
+     * @param <T> DS Component type
+     * @param component a DS component instance
+     * @return the DS component instance
      */
-    public final @NotNull <T> T registerInjectActivateService(@NotNull final T service) {
-        return registerInjectActivateService(service, (Map<String,Object>)null);
+    public final @NotNull <T> T registerInjectActivateService(@NotNull final T component) {

Review comment:
       or alternatively just `setupComponent(...)` or `setupDsComponent(...)`




-- 
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 #11: SLING-10922 don't consider DS metadata/CA for plain OSGi service

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


   @stefanseifert Thanks for merging, although in this case I would have preferred "Squash and Merge" (https://cwiki.apache.org/confluence/display/SLING/Using+Git+with+Sling)


-- 
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 #11: SLING-10922 don't consider DS metadata/CA for plain OSGi service

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


   yes, thought the same afterwards, but was too quick on the merge button


-- 
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