You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by ro...@apache.org on 2017/11/07 10:25:40 UTC

[sling-org-apache-sling-testing-sling-mock] 08/14: SLING-5769 expose resource resolver factory from SlingContext

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-2.0.0
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-testing-sling-mock.git

commit 08b7fd53db69ba67740ed2a8466cfbd1d8614b50
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Thu Jun 9 08:49:21 2016 +0000

    SLING-5769 expose resource resolver factory from SlingContext
    
    git-svn-id: https://svn.apache.org/repos/asf/sling/trunk/testing/mocks/sling-mock@1747508 13f79535-47bb-0310-9956-ffa450edef68
---
 .../sling/testing/mock/sling/context/SlingContextImpl.java   | 12 ++++++++++++
 1 file changed, 12 insertions(+)

diff --git a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
index cfaad87..8a9aedb 100644
--- a/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
+++ b/src/main/java/org/apache/sling/testing/mock/sling/context/SlingContextImpl.java
@@ -182,6 +182,18 @@ public class SlingContextImpl extends OsgiContextImpl {
     }
 
     /**
+     * Returns a {@code ResourceResolverFactory}. All resource resolvers being created with the returned factory need to be properly closed.
+     * In most of the cases {@link #resourceResolver()} should be used instead, because its life cycle is managed automatically
+     * (i.e. it is automatically closed after the test). 
+     * @return Resource resolver factory
+     */
+    public final ResourceResolverFactory resourceResolverFactory() {
+        return this.resourceResolverFactory;
+    }
+
+    /**
+     * Returns the singleton resource resolver bound to this context.
+     * It is automatically closed after the test.
      * @return Resource resolver
      */
     public final ResourceResolver resourceResolver() {

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