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 2021/11/30 14:36:05 UTC

[sling-org-apache-sling-testing-resourceresolver-mock] branch master updated (4cc74b6 -> 10ae37b)

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-resourceresolver-mock.git.


    from 4cc74b6  update to sling-bundle-parent 46
     new ce105db  add maven profile for testing against latest dependency versions
     new 10ae37b  SLING-10950 Make compatible with Sling API 2.24.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:
 pom.xml                                            | 23 ++++++++++++++++++++++
 .../resourceresolver/MockResourceResolver.java     | 14 ++++++++++++-
 .../MockResourceResolverFactory.java               |  8 ++++++++
 .../testing/resourceresolver/package-info.java     |  2 +-
 4 files changed, 45 insertions(+), 2 deletions(-)

[sling-org-apache-sling-testing-resourceresolver-mock] 01/02: add maven profile for testing against latest dependency versions

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-resourceresolver-mock.git

commit ce105db33ec49c059f42987f7f85fdfa9179f80a
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Nov 30 15:32:05 2021 +0100

    add maven profile for testing against latest dependency versions
---
 pom.xml | 23 +++++++++++++++++++++++
 1 file changed, 23 insertions(+)

diff --git a/pom.xml b/pom.xml
index 14d4a74..9df2132 100644
--- a/pom.xml
+++ b/pom.xml
@@ -148,4 +148,27 @@
         </dependencies>
     </dependencyManagement>
 
+   <profiles>
+        <profile>
+            <id>latest-dependency-versions</id>
+            <activation>
+                <activeByDefault>false</activeByDefault>
+            </activation>
+            <dependencyManagement>
+                <dependencies>
+                    <dependency>
+                        <groupId>org.apache.sling</groupId>
+                        <artifactId>org.apache.sling.api</artifactId>
+                        <version>2.24.0</version>
+                    </dependency>
+                    <dependency>
+                        <groupId>org.apache.jackrabbit</groupId>
+                        <artifactId>jackrabbit-jcr-commons</artifactId>
+                        <version>2.19.3</version>
+                    </dependency>
+                </dependencies>
+            </dependencyManagement>
+        </profile>
+    </profiles>
+
 </project>

[sling-org-apache-sling-testing-resourceresolver-mock] 02/02: SLING-10950 Make compatible with Sling API 2.24.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-resourceresolver-mock.git

commit 10ae37b8b166f8fb9235be42c2ce95a36d6e9123
Author: Stefan Seifert <st...@users.noreply.github.com>
AuthorDate: Tue Nov 30 15:33:43 2021 +0100

    SLING-10950 Make compatible with Sling API 2.24.0
---
 .../testing/resourceresolver/MockResourceResolver.java     | 14 +++++++++++++-
 .../resourceresolver/MockResourceResolverFactory.java      |  8 ++++++++
 .../sling/testing/resourceresolver/package-info.java       |  2 +-
 3 files changed, 22 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java b/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java
index e09f529..a9e535e 100644
--- a/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java
+++ b/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolver.java
@@ -45,6 +45,7 @@ import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.api.resource.ValueMap;
 import org.jetbrains.annotations.NotNull;
+import org.jetbrains.annotations.Nullable;
 import org.osgi.service.event.Event;
 import org.osgi.service.event.EventAdmin;
 
@@ -247,7 +248,7 @@ public class MockResourceResolver extends SlingAdaptable implements ResourceReso
         return children.iterator();
     }
 
-    private Resource newMockResource(final String path, 
+    private Resource newMockResource(final String path,
             final Map<String, Object> properties,
             final ResourceResolver resolver) {
         return this.options.getMockResourceFactory()
@@ -522,4 +523,15 @@ public class MockResourceResolver extends SlingAdaptable implements ResourceReso
         throw new UnsupportedOperationException();
     }
 
+    // Sling API 2.24.0
+    public boolean orderBefore(@NotNull Resource parent, @NotNull String name,
+            @Nullable String followingSiblingName) throws UnsupportedOperationException, PersistenceException, IllegalArgumentException {
+        throw new UnsupportedOperationException();
+    }
+
+    // Sling API 2.24.0
+    public @NotNull Map<String, Object> getPropertyMap() {
+        throw new UnsupportedOperationException();
+    }
+
 }
diff --git a/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolverFactory.java b/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolverFactory.java
index eb5bad0..12a7e05 100644
--- a/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolverFactory.java
+++ b/src/main/java/org/apache/sling/testing/resourceresolver/MockResourceResolverFactory.java
@@ -18,8 +18,10 @@
  */
 package org.apache.sling.testing.resourceresolver;
 
+import java.util.Arrays;
 import java.util.HashMap;
 import java.util.LinkedHashMap;
+import java.util.List;
 import java.util.Map;
 import java.util.Stack;
 
@@ -126,4 +128,10 @@ public class MockResourceResolverFactory implements ResourceResolverFactory {
             resolverStack.remove(resolver);
         }
     }
+
+    // Sling API 2.24.0
+    public @NotNull List<String> getSearchPath() {
+        return Arrays.asList(this.options.getSearchPaths());
+    }
+
 }
diff --git a/src/main/java/org/apache/sling/testing/resourceresolver/package-info.java b/src/main/java/org/apache/sling/testing/resourceresolver/package-info.java
index 48d8cf1..70071bd 100644
--- a/src/main/java/org/apache/sling/testing/resourceresolver/package-info.java
+++ b/src/main/java/org/apache/sling/testing/resourceresolver/package-info.java
@@ -19,5 +19,5 @@
 /**
  * Apache Sling Testing Resource Resolver Mock
  */
-@org.osgi.annotation.versioning.Version("2.1.0")
+@org.osgi.annotation.versioning.Version("2.2")
 package org.apache.sling.testing.resourceresolver;