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

rombert pushed a commit to annotated tag 
org.apache.sling.testing.resourceresolver-mock-1.1.0
in repository 
https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-resourceresolver-mock.git

commit 139e206876266eddffd92c94bded104b8f771889
Author: Stefan Seifert <[email protected]>
AuthorDate: Sat Oct 11 13:49:56 2014 +0000

    SLING-4033 fix InputStream problem with API versions <= 2.6.0
    add maven profiles to run unit tests against different API versions
    
    git-svn-id: 
https://svn.apache.org/repos/asf/sling/trunk/testing/resourceresolver-mock@1631044
 13f79535-47bb-0310-9956-ffa450edef68
---
 pom.xml                                            | 52 ++++++++++++++++++++--
 .../testing/resourceresolver/MockResource.java     |  3 +-
 2 files changed, 50 insertions(+), 5 deletions(-)

diff --git a/pom.xml b/pom.xml
index 3fbb372..f70bc14 100644
--- a/pom.xml
+++ b/pom.xml
@@ -62,9 +62,7 @@
         <dependency>
             <groupId>org.apache.sling</groupId>
             <artifactId>org.apache.sling.api</artifactId>
-            <!-- TODO: resarch why unit tests fail on InputStream tests with 
Sling API < 2.7.0 -->
-            <!--version>2.4.0</version-->
-            <version>2.7.0</version>
+            <version>2.4.0</version>
             <scope>provided</scope>
         </dependency>
         <dependency>
@@ -96,4 +94,52 @@
         </dependency>
     </dependencies>
     
+    <!-- Profiles to run unit tests against different Sling API versions -->
+    <profiles>
+        <profile>
+            <id>api-2.5</id>
+            <dependencies>
+            <dependency>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>org.apache.sling.api</artifactId>
+                <version>2.5.0</version>
+                <scope>provided</scope>
+            </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <id>api-2.6</id>
+            <dependencies>
+            <dependency>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>org.apache.sling.api</artifactId>
+                <version>2.6.0</version>
+                <scope>provided</scope>
+            </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <id>api-2.7</id>
+            <dependencies>
+            <dependency>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>org.apache.sling.api</artifactId>
+                <version>2.7.0</version>
+                <scope>provided</scope>
+            </dependency>
+            </dependencies>
+        </profile>
+        <profile>
+            <id>api-2.8</id>
+            <dependencies>
+            <dependency>
+                <groupId>org.apache.sling</groupId>
+                <artifactId>org.apache.sling.api</artifactId>
+                <version>2.8.0</version>
+                <scope>provided</scope>
+            </dependency>
+            </dependencies>
+        </profile>
+    </profiles>
+    
 </project>
diff --git 
a/src/main/java/org/apache/sling/testing/resourceresolver/MockResource.java 
b/src/main/java/org/apache/sling/testing/resourceresolver/MockResource.java
index 71dbf8e..687bd57 100644
--- a/src/main/java/org/apache/sling/testing/resourceresolver/MockResource.java
+++ b/src/main/java/org/apache/sling/testing/resourceresolver/MockResource.java
@@ -29,7 +29,6 @@ import org.apache.sling.api.resource.ResourceResolver;
 import org.apache.sling.api.resource.ResourceUtil;
 import org.apache.sling.api.resource.ValueMap;
 import org.apache.sling.api.wrappers.ModifiableValueMapDecorator;
-import org.apache.sling.api.wrappers.ValueMapDecorator;
 
 public class MockResource extends AbstractResource {
 
@@ -89,7 +88,7 @@ public class MockResource extends AbstractResource {
     @Override
     public <AdapterType> AdapterType adaptTo(final Class<AdapterType> type) {
         if ( type == ValueMap.class ) {
-            return (AdapterType)new ValueMapDecorator(this.props);
+            return (AdapterType)this.props;
         }
         else if ( type == ModifiableValueMap.class ) {
             ((MockResourceResolver)this.resolver).addChanged(this.path, 
this.props);

-- 
To stop receiving notification emails like this one, please contact
"[email protected]" <[email protected]>.

Reply via email to