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

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


The following commit(s) were added to refs/heads/master by this push:
     new e54dce518 Release Servlet Helpers 1.4.6, Testing JCR Mock 1.6.8, 
Testing Sling Mock 3.4.6
e54dce518 is described below

commit e54dce518eb769ea45e62fc5a75beb96bf0f9099
Author: Eric Norman <[email protected]>
AuthorDate: Thu Apr 27 09:57:03 2023 -0700

    Release Servlet Helpers 1.4.6, Testing JCR Mock 1.6.8, Testing Sling
    Mock 3.4.6
---
 .../content/documentation/development/jcr-mock.md  | 34 ++++++++++++++++++++++
 src/main/jbake/content/releases.md                 |  1 +
 src/main/jbake/templates/downloads.tpl             | 10 +++----
 3 files changed, 40 insertions(+), 5 deletions(-)

diff --git a/src/main/jbake/content/documentation/development/jcr-mock.md 
b/src/main/jbake/content/documentation/development/jcr-mock.md
index 9c575c7fa..c11b8ac25 100644
--- a/src/main/jbake/content/documentation/development/jcr-mock.md
+++ b/src/main/jbake/content/documentation/development/jcr-mock.md
@@ -75,3 +75,37 @@ Example:
     MockJcr.setQueryResult(session, "your query statement", Query.JCR_SQL2, 
resultNodes);
 
 Alternatively you can use the `MockJcr.addQueryResultHandler` method to pass a 
callback object that allows you to return a query result after inspecting the 
given query object.
+
+### Mocking node type management
+
+*Since Version 1.6.8*
+
+If you want to test code that interacts with node types you can simulate real 
node type definitions while setting up your unit test.
+
+Example:
+
+    String[] cndResourcesToLoad = new String[] {
+            "/org/apache/jackrabbit/oak/builtin_nodetypes.cnd",
+            "/your/test/nodetypes.cnd"
+    };
+    for (String resourceName : cndResourcesToLoad) {
+        URL cndUrl = getClass().getResource(resourceName);
+        if (cndUrl == null) {
+            fail("Failed to load CND nodetypes resource: " + resourceName);
+        }
+        try (Reader reader = new InputStreamReader(cndUrl.openStream())) {
+            MockJcr.loadNodeTypeDefs(session, reader);
+        }
+    }
+
+### Mocking access control manager
+
+*Since Version 1.6.8*
+
+If you want to test code that interacts with the access control manager you 
can set your own mock implementation while setting up your unit test.
+
+Example:
+
+    AccessControlManager acm = Mockito.mock(AccessControlManager.class);
+    MockJcr.setAccessControlManager(jcrSession, acm);
+
diff --git a/src/main/jbake/content/releases.md 
b/src/main/jbake/content/releases.md
index 6ab5bc54b..03cf7a87a 100644
--- a/src/main/jbake/content/releases.md
+++ b/src/main/jbake/content/releases.md
@@ -8,6 +8,7 @@ This is a list of all our releases, available from our 
[downloads](/downloads.cg
 
 ## April 2023
 
+* Testing Servlet Helpers 1.4.6, JCR Mock 1.6.8, Sling Mock 3.4.6 (27rd)
 * GraphQL Corea 0.0.20 (25th)
 * XSS Protection API 2.3.6 (9th)
 * JCR Base 3.1.14 (5th)
diff --git a/src/main/jbake/templates/downloads.tpl 
b/src/main/jbake/templates/downloads.tpl
index 9e3ec8410..58a245baf 100644
--- a/src/main/jbake/templates/downloads.tpl
+++ b/src/main/jbake/templates/downloads.tpl
@@ -250,7 +250,7 @@ def bundles=[
   "Service User Mapper|org.apache.sling.serviceusermapper|1.5.6|Y|jar",
   "Service User 
WebConsole|org.apache.sling.serviceuser.webconsole|1.0.2|Y|jar",
   "Servlet Annotations|org.apache.sling.servlets.annotations|1.2.6|Y|jar",
-  "Servlet Helpers|org.apache.sling.servlet-helpers|1.4.4|Y|jar",
+  "Servlet Helpers|org.apache.sling.servlet-helpers|1.4.6|Y|jar",
   "Servlets Get|org.apache.sling.servlets.get|2.1.40|Y|jar",
   "Servlets Post|org.apache.sling.servlets.post|2.5.0|Y|jar",
   "Servlets Resolver|org.apache.sling.servlets.resolver|2.9.10|Y|jar",
@@ -267,7 +267,7 @@ def bundles=[
   "Testing Clients|org.apache.sling.testing.clients|3.0.18|Y|jar",
   "Testing Email|org.apache.sling.testing.email|1.0.0|Y|jar",
   "Testing Hamcrest|org.apache.sling.testing.hamcrest|1.0.2|Y|jar",
-  "Testing JCR Mock|org.apache.sling.testing.jcr-mock|1.6.6|Y|jar",
+  "Testing JCR Mock|org.apache.sling.testing.jcr-mock|1.6.8|Y|jar",
   "Testing Logging Mock|org.apache.sling.testing.logging-mock|2.0.0|Y|jar",
   "Testing OSGi Mock 
Core|org.apache.sling.testing.osgi-mock.core|3.3.6|org.apache.sling.testing.osgi-mock|jar",
   "Testing OSGi Mock JUnit 
4|org.apache.sling.testing.osgi-mock.junit4|3.3.6|org.apache.sling.testing.osgi-mock|jar",
@@ -276,9 +276,9 @@ def bundles=[
   "Testing Rules|org.apache.sling.testing.rules|2.0.2|Y|jar",
   "Testing Resource Resolver 
Mock|org.apache.sling.testing.resourceresolver-mock|1.4.0|Y|jar",
   "Testing Server Setup 
Tools|org.apache.sling.testing.serversetup|1.0.4|Y|jar",
-  "Testing Sling Mock 
Core|org.apache.sling.testing.sling-mock.core|3.4.4|org.apache.sling.testing.sling-mock|jar",
-  "Testing Sling Mock JUnit 
4|org.apache.sling.testing.sling-mock.junit4|3.4.4|org.apache.sling.testing.sling-mock|jar",
-  "Testing Sling Mock JUnit 
5|org.apache.sling.testing.sling-mock.junit5|3.4.4|org.apache.sling.testing.sling-mock|jar",
+  "Testing Sling Mock 
Core|org.apache.sling.testing.sling-mock.core|3.4.6|org.apache.sling.testing.sling-mock|jar",
+  "Testing Sling Mock JUnit 
4|org.apache.sling.testing.sling-mock.junit4|3.4.6|org.apache.sling.testing.sling-mock|jar",
+  "Testing Sling Mock JUnit 
5|org.apache.sling.testing.sling-mock.junit5|3.4.6|org.apache.sling.testing.sling-mock|jar",
   "Testing Sling Mock 
Oak|org.apache.sling.testing.sling-mock-oak|3.1.8-1.44.0|Y|jar",
   "Thumbnails|org.apache.sling.thumbnails|1.0.0|Y|jar",
   "Tooling Support 
Install|org.apache.sling.tooling.support.install|1.1.0|Y|jar",

Reply via email to