sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From romb...@apache.org
Subject [sling-org-apache-sling-testing-sling-mock] 03/15: SLING-4605 - Add support for an Oak resource resolver type mock
Date Tue, 07 Nov 2017 10:22:42 GMT
This is an automated email from the ASF dual-hosted git repository.

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

commit bb580619ab05a6dc71290c1a75a24f4640cebe62
Author: Robert Munteanu <rombert@apache.org>
AuthorDate: Wed May 27 11:42:35 2015 +0000

    SLING-4605 - Add support for an Oak resource resolver type mock
    
    Initial revision of the sling-mock-oak module
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1681992
13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/testing/mock/sling/ResourceResolverType.java     | 14 ++++++++++++++
 .../org/apache/sling/testing/mock/sling/package-info.java  |  2 +-
 .../resource/AbstractSlingCrudResourceResolverTest.java    |  6 ++++--
 3 files changed, 19 insertions(+), 3 deletions(-)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverType.java b/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverType.java
index f1550e5..29ba5cb 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverType.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/ResourceResolverType.java
@@ -66,6 +66,20 @@ public enum ResourceResolverType {
      */
     JCR_JACKRABBIT("org.apache.sling.testing.mock.sling.jackrabbit.JackrabbitMockResourceResolverAdapter",
             "org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit"),
+
+    /**
+     * Uses a real JCR Jackrabbit Oak repository.
+     * <ul>
+     * <li>Uses the real Sling Resource Resolver and JCR Resource mapping
+     * implementation.</li>
+     * <li>The JCR repository is started on first access, this may take some
+     * seconds.</li>
+     * <li>Beware: The repository is not cleared for each unit test, so make
+     * sure us use a unique node path for each unit test.</li>
+     * </ul>
+     */
+    JCR_OAK("org.apache.sling.testing.mock.sling.oak.OakMockResourceResolverAdapter",
+            "org.apache.sling:org.apache.sling.testing.sling-mock-jackrabbit-oak"),
             
     /**
      * Provides resource resolver environment without any ResourceProvider.
diff --git a/src/main/java/org/apache/sling/testing/mock/sling/package-info.java b/src/main/java/org/apache/sling/testing/mock/sling/package-info.java
index 0d89d03..41f438c 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/package-info.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/package-info.java
@@ -19,5 +19,5 @@
 /**
  * Mock implementation of selected Sling APIs.
  */
-@aQute.bnd.annotation.Version("1.3")
+@aQute.bnd.annotation.Version("1.4")
 package org.apache.sling.testing.mock.sling;
diff --git a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
index 572cf6c..a3d2411 100644
--- a/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
+++ b/src/test/java/org/apache/sling/testing/mock/sling/resource/AbstractSlingCrudResourceResolverTest.java
@@ -161,7 +161,8 @@ public abstract class AbstractSlingCrudResourceResolverTest {
         // TODO: enable this test when JCR resource implementation supports
         // writing Date objects (SLING-3846)
         if (getResourceResolverType() != ResourceResolverType.JCR_MOCK
-                && getResourceResolverType() != ResourceResolverType.JCR_JACKRABBIT)
{
+                && getResourceResolverType() != ResourceResolverType.JCR_JACKRABBIT

+                && getResourceResolverType() != ResourceResolverType.JCR_OAK ) {
             assertEquals(DATE_VALUE, props.get("dateProp", Date.class));
         }
     }
@@ -173,7 +174,8 @@ public abstract class AbstractSlingCrudResourceResolverTest {
         // TODO: enable this test when JCR resource implementation supports
         // writing Date objects (SLING-3846)
         if (getResourceResolverType() != ResourceResolverType.JCR_MOCK
-                && getResourceResolverType() != ResourceResolverType.JCR_JACKRABBIT)
{
+                && getResourceResolverType() != ResourceResolverType.JCR_JACKRABBIT
+                && getResourceResolverType() != ResourceResolverType.JCR_OAK ) {
             Calendar calendarValue = props.get("dateProp", Calendar.class);
             assertNotNull(calendarValue);
             assertEquals(DATE_VALUE, calendarValue.getTime());

-- 
To stop receiving notification emails like this one, please contact
"commits@sling.apache.org" <commits@sling.apache.org>.

Mime
View raw message