You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ss...@apache.org on 2020/09/10 13:28:58 UTC

[sling-org-apache-sling-testing-sling-mock] branch master updated (d0704e0 -> ac94e66)

This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git.


    from d0704e0  [maven-release-plugin] prepare for next development iteration
     new 5022a8e  add explicit version for org.apache.sling.serviceusermapper update versions in "latest-*" profiles
     new ac94e66  SLING-9727 sling-mock: Make compatible with o.a.s.resourceresolver 1.7.0

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 core/pom.xml                                       | 24 ++++++++++++-----
 .../sling/ResourceResolverFactoryInitializer.java  | 31 ++++++++++++++++------
 2 files changed, 41 insertions(+), 14 deletions(-)


[sling-org-apache-sling-testing-sling-mock] 02/02: SLING-9727 sling-mock: Make compatible with o.a.s.resourceresolver 1.7.0

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit ac94e66696986f759effe8ca33913d20f7bd7cd5
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Thu Sep 10 15:26:06 2020 +0200

    SLING-9727 sling-mock: Make compatible with o.a.s.resourceresolver 1.7.0
---
 .../sling/ResourceResolverFactoryInitializer.java  | 31 ++++++++++++++++------
 1 file changed, 23 insertions(+), 8 deletions(-)

diff --git a/core/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java b/core/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
index b1d7ea5..48f0d5a 100644
--- a/core/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
+++ b/core/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverFactoryInitializer.java
@@ -48,7 +48,7 @@ import org.slf4j.Logger;
  * Initializes Sling Resource Resolver factories with JCR-resource mapping.
  */
 class ResourceResolverFactoryInitializer {
-    
+
     private ResourceResolverFactoryInitializer() {
         // static methods only
     }
@@ -72,7 +72,7 @@ class ResourceResolverFactoryInitializer {
             ensureJcrResourceProviderDependencies(bundleContext);
             initializeJcrResourceProvider(bundleContext);
         }
-        
+
         // initialize resource resolver factory activator
         ensureResourceResolverFactoryActivatorDependencies(bundleContext);
         initializeResourceResolverFactoryActivator(bundleContext);
@@ -83,7 +83,7 @@ class ResourceResolverFactoryInitializer {
         }
         return (ResourceResolverFactory)bundleContext.getService(factoryRef);
     }
-    
+
     /**
      * Ensure dependencies for JcrResourceProvider are present.
      * @param bundleContext Bundle context
@@ -125,7 +125,7 @@ class ResourceResolverFactoryInitializer {
         MockOsgi.activate(provider, bundleContext, config);
         bundleContext.registerService(ResourceProvider.class, provider, config);
     }
-    
+
     /**
      * Ensure dependencies for ResourceResolverFactoryActivator are present.
      * @param bundleContext Bundle context
@@ -137,6 +137,9 @@ class ResourceResolverFactoryInitializer {
         
         registerServiceIfNotPresent(bundleContext, ResourceAccessSecurityTracker.class, new ResourceAccessSecurityTracker());
         registerServiceIfNotPresent(bundleContext, EventAdmin.class, new MockEventAdmin());
+        // dependency required since resourceresolver 1.7.0
+        registerServiceIfNotPresentByName(bundleContext, "org.apache.sling.resourceresolver.impl.mapping.StringInterpolationProvider",
+                "org.apache.sling.resourceresolver.impl.mapping.StringInterpolationProviderImpl");
     }
  
     /**
@@ -153,7 +156,19 @@ class ResourceResolverFactoryInitializer {
         MockOsgi.activate(activator, bundleContext, config);
         bundleContext.registerService(ResourceResolverFactoryActivator.class.getName(), activator, config);
     }
-    
+
+    @SuppressWarnings({ "unchecked", "null" })
+    private static void registerServiceIfNotPresentByName(@NotNull BundleContext bundleContext,
+            @NotNull String interfaceClassName, @NotNull String implClassName) {
+        try {
+            Class<?> interfaceClass = Class.forName(interfaceClassName);
+            Class<?> implClass = Class.forName(implClassName);
+            registerServiceIfNotPresent(bundleContext, (Class)interfaceClass, implClass.newInstance());
+        } catch (ClassNotFoundException | InstantiationException | IllegalAccessException e) {
+            // ignore - probably not the latest sling models impl version
+        }
+    }
+
     /**
      * Registers a service if the service class is found in classpath,
      * and if no service with this class is already registered.
@@ -165,7 +180,7 @@ class ResourceResolverFactoryInitializer {
             @NotNull T instance) {
         registerServiceIfNotPresent(bundleContext, serviceClass, instance, new Hashtable<String, Object>());
     }
-    
+
     /**
      * Registers a service if the service class is found in classpath,
      * and if no service with this class is already registered.
@@ -182,7 +197,7 @@ class ResourceResolverFactoryInitializer {
             bundleContext.registerService(serviceClass, instance, config);
         }
     }
-    
+
     /**
      * Registers all JCR node types found in classpath.
      * @param slingRepository Sling repository
@@ -204,5 +219,5 @@ class ResourceResolverFactoryInitializer {
           }
       }
     }
-    
+
 }


[sling-org-apache-sling-testing-sling-mock] 01/02: add explicit version for org.apache.sling.serviceusermapper update versions in "latest-*" profiles

Posted by ss...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

sseifert pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 5022a8ed3d2589bb7d6832a452870ec2428b208c
Author: sseifert <ss...@pro-vision.de>
AuthorDate: Thu Sep 10 15:08:05 2020 +0200

    add explicit version for org.apache.sling.serviceusermapper
    update versions in "latest-*" profiles
---
 core/pom.xml | 24 ++++++++++++++++++------
 1 file changed, 18 insertions(+), 6 deletions(-)

diff --git a/core/pom.xml b/core/pom.xml
index 358198a..3f9e818 100644
--- a/core/pom.xml
+++ b/core/pom.xml
@@ -104,6 +104,12 @@
         </dependency>
         <dependency>
             <groupId>org.apache.sling</groupId>
+            <artifactId>org.apache.sling.serviceusermapper</artifactId>
+            <version>1.2.4</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.jcr.api</artifactId>
             <version>2.4.0</version>
             <scope>compile</scope>
@@ -325,31 +331,37 @@
                 <dependency>
                     <groupId>org.apache.sling</groupId>
                     <artifactId>org.apache.sling.api</artifactId>
-                    <version>2.16.4</version>
+                    <version>2.22.0</version>
                     <scope>compile</scope>
                 </dependency>
                 <dependency>
                     <groupId>org.apache.sling</groupId>
                     <artifactId>org.apache.sling.resourceresolver</artifactId>
-                    <version>1.5.34</version>
+                    <version>1.7.0</version>
+                    <scope>compile</scope>
+                </dependency>
+                <dependency>
+                    <groupId>org.apache.sling</groupId>
+                    <artifactId>org.apache.sling.serviceusermapper</artifactId>
+                    <version>1.4.6</version>
                     <scope>compile</scope>
                 </dependency>
                 <dependency>
                     <groupId>org.apache.sling</groupId>
                     <artifactId>org.apache.sling.jcr.resource</artifactId>
-                    <version>3.0.8</version>
+                    <version>3.0.22</version>
                     <scope>compile</scope>
                 </dependency>
                 <dependency>
                     <groupId>org.apache.jackrabbit</groupId>
                     <artifactId>jackrabbit-api</artifactId>
-                    <version>2.16.0</version>
+                    <version>2.19.3</version>
                     <scope>compile</scope>
                 </dependency>
                 <dependency>
                     <groupId>org.apache.jackrabbit</groupId>
                     <artifactId>oak-jcr</artifactId>
-                    <version>1.8.2</version>
+                    <version>1.32.0</version>
                     <scope>compile</scope>
                 </dependency>
             </dependencies>
@@ -366,7 +378,7 @@
                 <dependency>
                     <groupId>org.apache.sling</groupId>
                     <artifactId>org.apache.sling.scripting.core</artifactId>
-                    <version>2.0.58</version>
+                    <version>2.0.60</version>
                     <scope>compile</scope>
                     <exclusions>
                       <exclusion>